一、安装环境
Centos 6.5
二、nginx安装
1.nginx下载:http://nginx.org/en/download.html
2.解压tar包:tar zxvf nginx.tar.gz
3../configure --prefix=/opt/nginx/nginx-1.9.2
make -j16
make install -j16
make clean -j16
注:其中-j参数是线程数,可以提高编译速度
三、安装过程遇到问题
需要rewrite 模块需要 pcre 库
wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.37.tar.gz
解压安装,
需要安装 gcc-c++
至此安装成功。
四、启动关闭服务
启动./nginx
平滑重启1 kill -HUP `cat logs/nginx.pid`
平滑重启2 kill ./nginx -s reload
停止服务 ./nginx -s stop