溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

nginx編譯安裝后如何對nginx進行平滑升級

發布時間:2021-08-21 10:30:33 來源:億速云 閱讀:406 作者:小新 欄目:服務器

這篇文章給大家分享的是有關nginx編譯安裝后如何對nginx進行平滑升級的內容。小編覺得挺實用的,因此分享給大家做個參考,一起跟隨小編過來看看吧。

nginx-1.13.6升級到nginx-1.13.12的過程,其他版本也適用。

一、nginx新版的下載

nginx編譯安裝后如何對nginx進行平滑升級

下載頁面:http://nginx.org/en/download.html

wget -c http://nginx.org/download/nginx-1.13.12.tar.gz

二、獲取老版本nginx的配置

查看當前版本: /usr/local/nginx/sbin/nginx -v

查看當前配置: /usr/local/nginx/sbin/nginx -V

[root@zixuephp nginx-1.13.6]# /usr/local/nginx/sbin/nginx -v
nginx version: nginx/1.13.6
[root@zixuephp nginx-1.13.6]# /usr/local/nginx/sbin/nginx -V
nginx version: nginx/1.13.6
built by gcc 4.8.5 20150623 (Red Hat 4.8.5-16) (GCC) 
built with OpenSSL 1.0.2k-fips 26 Jan 2017
TLS SNI support enabled
configure arguments: --prefix=/usr/local/nginx --user=www --group=www --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_v2_module --with-http_gzip_static_module --with-http_sub_module --with-pcre --with-http_ssl_module

三、解壓新版nginx源碼包

tar -xzvf nginx-1.13.12.tar.gz
cd nginx-1.13.12

四、對新版重新編譯前的配置

這里的配置和老版本的一樣 : /usr/local/nginx/sbin/nginx -V

復制代碼 代碼如下:

./configure --prefix=/usr/local/nginx --user=www --group=www --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_v2_module --with-http_gzip_static_module --with-http_sub_module --with-pcre --with-http_ssl_module

五、編譯生成objs目錄,進入目錄,替換nginx

make

編譯后通過ls可以看到有個objs的目錄

[root@zixuephp nginx-1.13.12]# ls
auto CHANGES CHANGES.ru conf configure contrib html LICENSE Makefile man objs README src
[root@zixuephp nginx-1.13.12]#

進入objs目錄,替換老版本的nginx主程序(在操作這里前一定要先備份,免得出錯)

[root@zixuephp objs]#mv nginx /usr/local/nginx/sbin/nginx

六、平滑升級

make upgrade

七、升級成功,查看版本

[root@zixuephp nginx-1.13.12]# /usr/local/nginx/sbin/nginx -v
nginx version: nginx/1.13.12
[root@zixuephp nginx-1.13.12]# /usr/local/nginx/sbin/nginx -V
nginx version: nginx/1.13.12
built by gcc 4.8.5 20150623 (Red Hat 4.8.5-16) (GCC) 
built with OpenSSL 1.0.2k-fips 26 Jan 2017
TLS SNI support enabled
configure arguments: --prefix=/usr/local/nginx --user=www --group=www --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_v2_module --with-http_gzip_static_module --with-http_sub_module --with-pcre --with-http_ssl_module

在升級前一定要提前備份好nginx程序和網站等文件,避免出錯。

感謝各位的閱讀!關于“nginx編譯安裝后如何對nginx進行平滑升級”這篇文章就分享到這里了,希望以上內容可以對大家有一定的幫助,讓大家可以學到更多知識,如果覺得文章不錯,可以把它分享出去讓更多的人看到吧!

向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

亚洲午夜精品一区二区_中文无码日韩欧免_久久香蕉精品视频_欧美主播一区二区三区美女