在ubuntu 14.04中更新nginx

前端之家收集整理的这篇文章主要介绍了在ubuntu 14.04中更新nginx前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

在我的服务器中,Nginx -v返回Nginx版本:Nginx / 1.4.6(Ubuntu),它很老,所以我决定将它更新到最新的稳定版本.

然后,我跟着this answer

  1. sudo apt-get update
  2. sudo apt-get install Nginx

它给:

  1. Reading package lists... Done
  2. Building dependency tree
  3. Reading state information... Done
  4. The following extra packages will be installed:
  5. Nginx-common Nginx-core
  6. Suggested packages:
  7. fcgiwrap Nginx-doc
  8. The following packages will be upgraded:
  9. Nginx Nginx-common Nginx-core
  10. 3 upgraded,0 newly installed,0 to remove and 311 not upgraded.
  11. Need to get 349 kB of archives.
  12. After this operation,3,072 B of additional disk space will be used.
  13. Do you want to continue? [Y/n]
  14. Get:1 http://mirrors.digitalocean.com/ubuntu/ trusty-updates/main Nginx-common all 1.4.6-1ubuntu3.7 [19.0 kB]
  15. Get:2 http://mirrors.digitalocean.com/ubuntu/ trusty-updates/main Nginx all 1.4.6-1ubuntu3.7 [5,352 B]
  16. Get:3 http://mirrors.digitalocean.com/ubuntu/ trusty-updates/main Nginx-core amd64 1.4.6-1ubuntu3.7 [325 kB]
  17. Fetched 349 kB in 0s (431 kB/s)
  18. Preconfiguring packages ...
  19. (Reading database ... 111751 files and directories currently installed.)
  20. Preparing to unpack .../Nginx-common_1.4.6-1ubuntu3.7_all.deb ...
  21. Unpacking Nginx-common (1.4.6-1ubuntu3.7) over (1.4.6-1ubuntu3.5) ...
  22. Preparing to unpack .../Nginx_1.4.6-1ubuntu3.7_all.deb ...
  23. Unpacking Nginx (1.4.6-1ubuntu3.7) over (1.4.6-1ubuntu3.5) ...
  24. Preparing to unpack .../Nginx-core_1.4.6-1ubuntu3.7_amd64.deb ...
  25. Unpacking Nginx-core (1.4.6-1ubuntu3.7) over (1.4.6-1ubuntu3.5) ...
  26. Processing triggers for ufw (0.34~rc-0ubuntu2) ...
  27. Processing triggers for ureadahead (0.100.0-16) ...
  28. Processing triggers for man-db (2.6.7.1-1ubuntu1) ...
  29. Setting up Nginx-common (1.4.6-1ubuntu3.7) ...
  30. Setting up Nginx-core (1.4.6-1ubuntu3.7) ...
  31. Setting up Nginx (1.4.6-1ubuntu3.7) ...

但是,Nginx -v仍会返回Nginx版本:Nginx / 1.4.6(Ubuntu).

有没有人知道更新Nginx的安全方法,而无需修改配置文件?因为它是在生产中的服务器,我想要非常小心……

最佳答案
第一次运行

sudo apt-get install software-properties-common python-software-properties

然后,添加Nginx稳定仓库:

sudo add-apt-repository ppa:Nginx/stable

然后运行

sudo apt-get update

sudo apt-get install Nginx

猜你在找的Nginx相关文章