查看下载nginx版本信息
/opt/nginx/sbin/nginx -V
nginx version: nginx/1.8.0
下载最新的nginx源码包,解压,编译,make完成以后不需要再自行make install。
tar zxvf nginx-1.10.1.tar.gz
cd nginx-1.10.1
./configure --prefix=/opt/nginx --user=nginx --group=nginx --with-http_ssl_module --with-http_realip_module --with-stream --with-http_upstream_check_module
make
接下来重名/sbin/nginx为nginx.old
mv /opt/nginx/sbin/nginx /opt/nginx/sbin/nginx.old
在编译目录
cp objs/nginx /opt/nginx/sbin/
生成新的nginx.pid文件
kill -USR2 `cat /opt/nginx/logs/nginx.pid`
退出旧版本低nginx
kill -QUIT `cat /opt/nginx/logs/nginx.pid.old`
查看最新的版本号
/opt/nginx/sbin/nginx -V
nginx version: nginx/1.10.1