Nginx 平滑升级
nginx/1.20.1 --->1.22.1
1、查看原编译参数
nginx -V
--------------------------------------------
nginx version: nginx/1.20.1
built by gcc 4.8.5 20150623 (Red Hat 4.8.5-44) (GCC)
built with OpenSSL 1.0.2k-fips 26 Jan 2017
TLS SNI support enabled
configure arguments: --with-http_stub_status_module --with-http_ssl_modul
2、解压源码进行编译
1)解压
tar -zxvf nginx-1.22.1.tar.gz
2)配置编译
./configure --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module
make
3、备份替换nginx文件
1)备份原来 nginx 二进制文件
mv /usr/local/nginx/sbin/nginx /usr/local/nginx/sbin/nginx.old
2) 复制新的nginx二进制文件
cp /data/software/nginx-1.22.1/objs/nginx /usr/local/nginx/sbin
3)测试nginx是否正常
nginx -t
4) 平滑升级
kill -USR2 `cat /usr/local/nginx/logs/nginx.pid`
test -f /usr/local/nginx/logs/nginx.pid.oldbin
kill -QUIT `cat /usr/local/nginx/logs/nginx.pid.oldbin`
标签:http,logs,nginx,--,平滑,升级,Nginx,usr,local
From: https://www.cnblogs.com/wsx2019/p/17450919.html