Nginx的安装
检查并且安装依赖组件
检查安装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的信号控制
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
原文地址:http://kaibinyuan.blog.51cto.com/7304008/1612546