nginx升级

###编译新版本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

完成…

猜你喜欢

转载自blog.csdn.net/wgw_dream/article/details/83590737