Nginx版本升级

快来打我* 2022-04-21 23:54 345阅读 0赞

###编译新版本nginx软件
在这里插入图片描述
[root@localhost lnmp_soft]# tar -xf nginx-1.12.2.tar.gz
[root@localhost lnmp_soft]# cd nginx-1.12.2/

在这里插入图片描述
[root@localhost nginx-1.12.2]# ./configure \

–prefix=/usr/local/nginx \ //指定安装路径
–with-http_ssl_module //安装ssl加密功能

在这里插入图片描述
编译新版本的nginx:
[root@localhost nginx-1.12.2]# make

###拷贝老版本的nginx主程序并使用编译号的新版本nginx替换老版本
在这里插入图片描述
当前使用mv命令的原因:将老版本切换位置,避免出错后老版本也没了
当前使用cp命令的原因:拷贝新版本
[root@localhost nginx-1.12.2]# mv /usr/local/nginx/sbin/nginx /usr/local/nginx/sbin/nginx.1.10.2.bak
[root@localhost nginx-1.12.2]# ls
[root@localhost nginx-1.12.2]# cp objs/nginx /usr/local/nginx/sbin/nginx

在这里插入图片描述
[root@localhost nginx-1.12.2]# make upgrade //升级

在这里插入图片描述
查看版本
[root@localhost nginx-1.12.2]# /usr/local/nginx/sbin/nginx -v

完成…

发表评论

表情:
评论列表 (有 0 条评论,345人围观)

还没有评论,来说两句吧...

相关阅读

    相关 Nginx平滑升级

    一、环境准备 在业务不关闭情况下进行升级,并且不要版本差距太大,不然很多东西不支持容易崩溃 环境:centos7.3一台 版本:旧的1.8,新的1.10 部署目