###編譯新版本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
完成…