zoukankan      html  css  js  c++  java
  • nginx平滑升级

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

  • 相关阅读:
    线程的终止pthread_exit和返回为什么终止的原因
    临界区互斥使用之使用自旋锁
    临界区的同步操作-------------使用信号量 实现
    常用解压操作
    group compare vs pair compare
    两个总体的参数关系
    纳伪|去真
    Ho|H1|p-value|p值与U值|单侧检验
    统计分布近似转化
    样本均值的标准误差|样本均值的标准差|总体标准差|样本标准差|简单随机抽样|样本均值估计|样本方差估计|
  • 原文地址:https://www.cnblogs.com/charon2/p/10349845.html
Copyright © 2011-2022 走看看