Chinaunix首页 | 论坛 | 博客
  • 博客访问: 7488912
  • 博文数量: 368
  • 博客积分: 9600
  • 博客等级: 上校
  • 技术积分: 18875
  • 用 户 组: 普通用户
  • 注册时间: 2009-01-01 00:00
文章分类

全部博文(368)

文章存档

2017年(9)

2016年(19)

2015年(3)

2014年(6)

2013年(8)

2012年(78)

2011年(66)

2010年(135)

2009年(44)

分类: LINUX

2010-04-13 12:22:15

Nginx平滑升级

Posted by – 2009-09-27

#################################
# Nginx平滑升级 #
# Author: 楚霏 #
# Date: 2009-09-25#
# Env: Centos 5.3 x86_64#
#################################

#以nginx0.7.61升级到nginx0.7.62为例
#下载新版
cd /usr/local/src
wget
tar xvf nginx-0.7.62.tar.gz
cd nginx-0.7.62
#和旧版本的编译参数一样
./configure --prefix=/usr/local/nginx --sbin-path=/usr/local/nginx/sbin/nginx --conf-path=/usr/local/nginx/conf/nginx.conf --error-log-path=/usr/local/nginx/logs/error.log --http-log-path=/usr/local/nginx/logs/access.log --pid-path=/usr/local/nginx/var/nginx.pid --lock-path=/usr/local/nginx/var/nginx.lock --without-select_module --without-poll_module --with-http_realip_module --with-http_sub_module --with-http_gzip_static_module --with-http_stub_status_module --without-http_ssi_module --without-http_userid_module --without-http_geo_module --without-http_memcached_module --without-http_map_module --without-mail_pop3_module --without-mail_imap_module --without-mail_smtp_module
make
#先不要安装拷贝文件,把旧版本重命名

mv /usr/local/nginx /usr/local/nginx.0.7.61
#可以安装了
make install
#拷回配置文件
cd /usr/local/nginx
mv conf conf.bak
mv ../nginx.0.7.61/conf ./
#检查配置
service nginx configtest
#过滤出现在正在运行的nginx进程
ps -ef | grep "nginx: master process" | grep -v "grep" | awk -F ' ' '{print $2}'
#再輸入以下 3 個命令 ( 數字部份請填入你自己的pid )
kill -USR2 3084
kill -WINCH 3084
kill -QUIT 3084
#检查一下,pid已经和以前的已经不同了
ps aux | grep nginx
#完成

阅读(1656) | 评论(0) | 转发(1) |
给主人留下些什么吧!~~