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

完成…

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章