nginx 升級指南,最詳細的nginx升級步驟

來源:互聯網
上載者:User
查看nginx目前的版本

通過nginx -V 命令就可以查看當前的版本,已經目前的版本安裝時候的一些nginx命令
[root@localhost sbin]# ./nginx -V
nginx version: nginx/1.2.9
built by gcc 4.4.7 20120313 (Red Hat 4.4.7-3) (GCC)
configure arguments: --prefix=/nginx_instal

1.下載新版本的nginx 1.44,解壓後,進入該目錄
使用上文同樣的configure進行配置

#./configure --prefix=/nginx_instal
#make

2.備份之前舊的nginx檔案,這裡只需要備份nginx 這個檔案即可

[root@localhost sbin]# mv ./nginx ./nginx.old

3.複製新的nginx到nginx的目錄,只需要替換sbin 目錄下的nginx檔案
[root@localhost nginx-1.4.4]# cp nginx /nginx_instal/sbin


4.執行升級
直接調用nginx命令 make upgrade 進行升級,升級的具體代碼如下:

[root@localhost nginx-1.4.4]# make upgrade
/nginx_instal/sbin/nginx -t
nginx: the configuration file /nginx_instal/conf/nginx.conf syntax is ok
nginx: configuration file /nginx_instal/conf/nginx.conf test is successful
kill -USR2 `cat /nginx_instal/logs/nginx.pid`
sleep 1
test -f /nginx_instal/logs/nginx.pid.oldbin
kill -QUIT `cat /nginx_instal/logs/nginx.pid.oldbin`


5,如無錯誤提示,則升級完成
再次通過 /nginx -V 命令查看當前的版本
[root@localhost sbin]# ./nginx -V
nginx version: nginx/1.4.4
built by gcc 4.4.7 20120313 (Red Hat 4.4.7-3) (GCC)
configure arguments: --prefix=/nginx_instal


原文地址:http://www.itmmd.com/201410/71.html
該文章由 android開發 整理髮布,轉載須標明出處。

以上就介紹了nginx 升級指南,最詳細的nginx升級步驟,包括了方面的內容,希望對PHP教程有興趣的朋友有所協助。

  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.