nginx平滑升级—>1.20(源码)

一、下载nginx源码包

nginx官网
http://nginx.org/en/download.html
在这里插入图片描述

二、开始平滑升级

1. 解压nginx源码包

[root@localhost ~]# tar xf nginx-1.20.1.tar.gz

2. 查看老版本nginx的配置

[root@localhost nginx]# ./sbin/nginx -V
nginx version: nginx/1.14.2
built by gcc 4.8.5 20150623 (Red Hat 4.8.5-44) (GCC) 
configure arguments: --prefix=/nginx --with-http_v2_module

3. 编译新版本nginx

[root@localhost nginx-1.20.1]# ./configure --prefix=/nginx --with-http_v2_module      #安装目录指定老版本地址
[root@localhost nginx-1.20.1]# make  #不需要make install

4. 备份旧版本nginx

[root@localhost nginx]# mv ./sbin/nginx ./sbin/nginx.old

5. 拷贝新版本nginx

[root@localhost nginx-1.20.1]# cp ./objs/nginx 	/nginx/sbin/nginx

6. 执行平滑升级命令

[root@localhost nginx-1.20.1]# make upgrade
/nginx/sbin/nginx -t
nginx: the configuration file /nginx/conf/nginx.conf syntax is ok
nginx: configuration file /nginx/conf/nginx.conf test is successful
kill -USR2 `cat /nginx/logs/nginx.pid`
sleep 1
test -f /nginx/logs/nginx.pid.oldbin
kill -QUIT `cat /nginx/logs/nginx.pid.oldbin`

没有报错就安装成功

7. 查看nginx版本号

[root@localhost nginx]# ./sbin/nginx -V
nginx version: nginx/1.20.1
built by gcc 4.8.5 20150623 (Red Hat 4.8.5-44) (GCC) 
configure arguments: --prefix=/app/baiing/nginx --with-http_v2_module

升级成功!!!

  • 1
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值