码迷,mamicode.com
首页 > 其他好文 > 详细

nginx平滑升级

时间:2019-02-03 12:51:21      阅读:178      评论:0      收藏:0      [点我收藏+]

标签:sof   nginx平滑升级   -o   nginx   pre   host   error   成功   zip   

[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 删除

 

nginx平滑升级

标签:sof   nginx平滑升级   -o   nginx   pre   host   error   成功   zip   

原文地址:https://www.cnblogs.com/charon2/p/10349845.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!