nginx平滑升级

左手的ㄟ右手 2021-12-20 04:17 456阅读 0赞

[root@localhost sbin]# ./nginx -V

nginx version: nginx/1.11.10

built by gcc 4.8.5 20150623 (Red Hat 4.8.5-28) (GCC)

configure arguments: —prefix=/soft/nginx

[root@localhost logs]# wget https://codeload.github.com/openresty/headers-more-nginx-module/zip/master -O ./headers-more-nginx-module-master.zip

[root@localhost soft]# unzip headers-more-nginx-module-master.zip

[root@localhost nginx-1.11.10]# make clean

rm -rf Makefile objs

[root@localhost logs]# ./configure —prefix=/soft/nginx —add-module=/soft/headers-more-nginx-module-master

make && make install

[root@localhost logs]# kill -s USR2 `cat /soft/nginx/logs/nginx.pid`

root 17105 1 0 17:30 ? 00:00:00 nginx: master process ./nginx

nobody 17106 17105 0 17:30 ? 00:00:00 nginx: worker process

root 19788 17105 0 17:35 ? 00:00:00 nginx: master process ./nginx

nobody 19789 19788 0 17:35 ? 00:00:00 nginx: worker process

root 19791 12252 0 17:35 pts/5 00:00:00 grep —color=auto nginx

[root@localhost logs]# kill -s WINCH `cat /soft/nginx/logs/nginx.pid.oldbin`

[root@localhost logs]# ps -ef | grep nginx

root 17105 1 0 17:30 ? 00:00:00 nginx: master process ./nginx

root 19788 17105 0 17:35 ? 00:00:00 nginx: master process ./nginx

nobody 19789 19788 0 17:35 ? 00:00:00 nginx: worker process

root 19826 12252 0 17:38 pts/5 00:00:00 grep —color=auto nginx

[root@localhost logs]# ls

access.log error.log nginx.pid nginx.pid.oldbin

[root@localhost logs]# kill -s QUIT `cat /soft/nginx/logs/nginx.pid.oldbin`

[root@localhost logs]# ps -ef | grep nginx

root 19788 1 0 17:35 ? 00:00:00 nginx: master process ./nginx

nobody 19789 19788 0 17:35 ? 00:00:00 nginx: worker process

root 19830 12252 0 17:38 pts/5 00:00:00 grep —color=auto nginx

到此 Nginx 已重新编译并平滑升级成功。

在 Nginx 的配置文件中加入代码,将之前请求网站返回 Header 中的 X-Powered-By 和 WP-Super-Cache 删除

转载于:https://www.cnblogs.com/charon2/p/10349845.html

发表评论

表情:
评论列表 (有 0 条评论,456人围观)

还没有评论,来说两句吧...

相关阅读

    相关 nginx平滑升级

    1、为什么要对 nginx 平滑升级 随着 `nginx` 越来越流行,并且 `nginx` 的优势也越来越明显,`nginx` 的版本迭代也来时加速模式,1.9.0版本

    相关 Nginx平滑升级

    一、环境准备 在业务不关闭情况下进行升级,并且不要版本差距太大,不然很多东西不支持容易崩溃 环境:centos7.3一台 版本:旧的1.8,新的1.10 部署目