Nginx升级【不平滑方式】

检查旧nginx配置参数
[root@localhost nginx]$ cd /usr/local/nginx/sbin
[root@localhost sbin]$ ./nginx -V
nginx version: nginx/1.19.3
built by gcc 4.8.5 20150623 (Red Hat 4.8.5-28) (GCC)
configure arguments:
上传新的nginx,解压缩
[root@localhost software]$ tar -zvxf nginx-1.22.0.tar.gz

编译新的nginx

[root@localhost nginx-1.22.0]$ ./configure --prefix=/usr/local/nginx  --with-http_ssl_module
[root@localhost nginx-1.22.0]$ make
备份旧版本的nginx可执行文件,复制新版本的nginx执行文件
[root@localhost sbin]# mv nginx nginx20220803.old
[root@localhost sbin]# ls
nginx20220803.old  nginx.old
[root@localhost nginx-1.22.0]$ cp objs/nginx /usr/local/nginx/sbin/
因对系统响应实时度不高,故先关旧nginx,再重启nginx,不要求平滑升级
[root@localhost nginx-1.22.0]# ps -ef|grep nginx
root     20139 27781  0 14:57 ?        00:00:00 nginx: worker process
root     20200 20165  0 14:57 pts/1    00:00:00 grep --color=auto nginx
root     27781     1  0  2020 ?        00:00:00 nginx: master process ./nginx
[root@localhost nginx-1.22.0]# kill -9 27781
[root@localhost nginx]$ cd /usr/local/nginx/sbin
[root@localhost sbin]$ ./nginx
查看nginx版本已经升级到新版
[root@localhost sbin]$ ./nginx -V
nginx version: nginx/1.22.0
built by gcc 4.8.5 20150623 (Red Hat 4.8.5-28) (GCC)
built with OpenSSL 1.0.2k-fips  26 Jan 2017
TLS SNI support enabled
configure arguments: --prefix=/usr/local/nginx --with-http_ssl_module
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值