Nginx平滑升级

Nginx平滑升级

先安装1.0.15版本的Nginx

[root@localhost src]# yum -y install gcc gcc-c++ make libtool zlib zlib-devel pcre pcre-devel openssl openssl-devel
[root@localhost src]# tar zxf nginx-1.0.15.tar.gz 
[root@localhost src]# cd nginx-1.0.15/
[root@localhost nginx-1.0.15]# ./configure --prefix=/usr/local/nginx1.0  && make && make install
[root@localhost nginx-1.0.15]# ln -s /usr/local/nginx1.0/sbin/* /usr/local/sbin/
[root@localhost nginx-1.0.15]# nginx -t
nginx: the configuration file /usr/local/nginx1.0/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx1.0/conf/nginx.conf test is successful
[root@localhost nginx-1.0.15]# nginx

升级

[root@localhost src]# tar zxf nginx-1.14.0.tar.gz 
[root@localhost src]# cd nginx-1.14.0/
[root@localhost nginx-1.14.0]# ./configure --prefix=/usr/local/nginx1.14 --with-http_stub_status_module && make
[root@localhost ~]# mv /usr/local/nginx1.0/sbin/nginx /usr/local/nginx1.0/sbin/nginx_old
[root@localhost ~]# cp /usr/local/nginx-1.14.0/objs/nginx /usr/local/nginx1.0/sbin/
[root@localhost ~]# mv /usr/local/nginx1.0/conf/nginx.conf /usr/local/nginx1.0/conf/nginx.conf.old
[root@localhost ~]# cp /usr/local/nginx-1.14.0/conf/nginx.conf /usr/local/nginx1.0/conf/nginx.conf
[root@localhost ~]# kill -USR2 `cat /usr/local/nginx1.0/logs/nginx.pid`
[root@localhost ~]# ls /usr/local/nginx1.0/logs/
access.log  error.log  nginx.pid
[root@localhost ~]# ps aux | grep nginx
root     22194  0.0  0.0  24744   944 ?        Ss   20:38   0:00 nginx: master process nginx
nobody   22195  0.0  0.0  27224  1752 ?        S    20:38   0:00 nginx: worker process
root     25153  0.0  0.0 112648   952 pts/1    S+   20:52   0:00 grep --color=auto nginx
[root@localhost ~]# nginx -v
nginx version: nginx/1.14.0

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值