1、查看nginx当前版本
通过nginx -V 命令就可以查看当前的版本,已经当前版本安装时候的一些nginx命令
[root@taotao sbin]# ./nginx -V nginx version: nginx/1.10.3 built by gcc 4.4.7 20120313 (Red Hat 4.4.7-17) (GCC) built with OpenSSL 1.0.1e-fips 11 Feb 2013 TLS SNI support enabled configure arguments: --user=www --group=www --with-http_stub_status_module --with-http_ssl_module
2、下载新版本的nginx
wget http://nginx.org/download/nginx-1.12.1.tar.gz
3、解压缩新版本nginx
tar xf nginx-1.12.1.tar.gz
cd nginx-1.12.1
4、编译并修改文件
./configure –user=www –group=www –with-http_stub_status_module –with-http_ssl_module
make
cd /usr/local/nginx/sbin
mv nginx nginx_old
cp /root/nginx-1.12.1/objs/nginx .
5、执行升级
[root@taotao nginx-1.12.1]# make upgrade /usr/local/nginx/sbin/nginx -t nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful kill -USR2 `cat /usr/local/nginx/logs/nginx.pid` sleep 1 test -f /usr/local/nginx/logs/nginx.pid.oldbin kill -QUIT `cat /usr/local/nginx/logs/nginx.pid.oldbin`
6、查看是否升级成功
[root@taotao sbin]# ./nginx -V nginx version: nginx/1.12.1 built by gcc 4.4.7 20120313 (Red Hat 4.4.7-17) (GCC) built with OpenSSL 1.0.1e-fips 11 Feb 2013 TLS SNI support enabled configure arguments: --user=www --group=www --with-http_stub_status_module --with-http_ssl_module
如无特殊说明,文章均为本站原创,转载请注明出处
- 转载请注明来源:nginx升级
- 本文永久链接地址:http://www.hongxiaowei.com/xiaowei/645.html