码迷,mamicode.com
首页 > 其他好文 > 详细

Nginx学习(一)安装及基本功能

时间:2015-02-07 06:56:03      阅读:160      评论:0      收藏:0      [点我收藏+]

标签:开发   第三方   依赖性   

  • Nginx的安装

  1. 检查并且安装依赖组件

检查安装nginx的依赖性,nginx的模块需要第三方库的支持,编译的时候需要开发库(gcc,gcc-c++)检查是否安装下列库:zlib、zlib-devel、openssl、openssl-devel、prce-devel如果没有,则全部装上

[root@kaibin ~]# yum -y install zlib zlib-devel openssl openssl-devel pcre-devel gcc gcc-c++

2.安装pcre(支持正则表达式及地址重写功能)

[root@kaibin ~]# wget 
[root@kaibin src]# tar zxvf pcre-8.36.tar.gz 
[root@kaibin pcre-8.36]# ./configure
[root@kaibin pcre-8.36]# make && make install

3.编译安装nginx

[root@kaibin src]# useradd -s /sbin/nologin nginx
[root@kaibin src]# wget 
[root@kaibin src]# tar zxvf nginx-1.6.2.tar.gz 
[root@kaibin nginx-1.6.2]# ./configure --prefix=/usr/local/nginx-1.6.2 --user=nginx --group=nginx > --with-http_stub_status_module > --with-http_sub_module > --with-http_ssl_module > --with-pcre=/usr/local/src/pcre-8.36 > --with-http_gzip_static_module
[root@kaibin nginx-1.6.2]# make && make install
  • Nginx的信号控制

  1. Master进程可以处理的信号

技术分享

[root@kaibin sbin]# ps -ef | grep nginx | grep -v "grep"
root     12154     1  0 18:50 ?        00:00:00 nginx: master process ./nginx
nginx    12159 12154  0 18:50 ?        00:00:00 nginx: worker process
[root@kaibin sbin]# kill -WINCH 12154
[root@kaibin sbin]# ps -ef | grep nginx | grep -v "grep"
root     12154     1  0 18:50 ?        00:00:00 nginx: master process ./nginx

[root@kaibin sbin]# ps -ef | grep nginx | grep -v "grep"
root     12206     1  0 19:01 ?        00:00:00 nginx: master process ./nginx
nginx    12207 12206  0 19:01 ?        00:00:00 nginx: worker process
[root@kaibin sbin]# kill -QUIT 12206
[root@kaibin sbin]# ps -ef | grep nginx | grep -v "grep"

[root@kaibin sbin]# ps -ef | grep nginx | grep -v "grep"
root     12217     1  0 19:02 ?        00:00:00 nginx: master process ./nginx
nginx    12218 12217  0 19:02 ?        00:00:00 nginx: worker process
[root@kaibin sbin]# kill -HUP 12217
[root@kaibin sbin]# ps -ef | grep nginx | grep -v "grep"
root     12217     1  0 19:02 ?        00:00:00 nginx: master process ./nginx
nginx    12222 12217  0 19:03 ?        00:00:00 nginx: worker process

2. Worker可以处理的进程

技术分享

本文出自 “Linux革命” 博客,请务必保留此出处http://kaibinyuan.blog.51cto.com/7304008/1612546

Nginx学习(一)安装及基本功能

标签:开发   第三方   依赖性   

原文地址:http://kaibinyuan.blog.51cto.com/7304008/1612546

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!