- Nginx的安装
- 检查并且安装依赖组件
检查安装nginx的依赖性,nginx的模块需要第三方库的支持,编译的时候需要开发库(gcc,gcc-c++)检查是否安装下列库:zlib、zlib-devel、openssl、openssl-devel、prce-devel如果没有,则全部装上
[[email protected] ~]# yum -y install zlib zlib-devel openssl openssl-devel pcre-devel gcc gcc-c++
2.安装pcre(支持正则表达式及地址重写功能)
[[email protected] ~]# wget [[email protected] src]# tar zxvf pcre-8.36.tar.gz [[email protected] pcre-8.36]# ./configure [[email protected] pcre-8.36]# make && make install
3.编译安装nginx
[[email protected] src]# useradd -s /sbin/nologin nginx [[email protected] src]# wget [[email protected] src]# tar zxvf nginx-1.6.2.tar.gz [[email protected] 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 [[email protected] nginx-1.6.2]# make && make install
- Nginx的信号控制
- Master进程可以处理的信号
[[email protected] 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 [[email protected] sbin]# kill -WINCH 12154 [[email protected] sbin]# ps -ef | grep nginx | grep -v "grep" root 12154 1 0 18:50 ? 00:00:00 nginx: master process ./nginx [[email protected] 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 [[email protected] sbin]# kill -QUIT 12206 [[email protected] sbin]# ps -ef | grep nginx | grep -v "grep" [[email protected] 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 [[email protected] sbin]# kill -HUP 12217 [[email protected] 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可以处理的进程
时间: 2024-10-12 15:30:21