加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 运营中心 > Nginx > 正文

在ubuntu 14.04中更新nginx

发布时间:2020-12-13 21:34:15 所属栏目:Nginx 来源:网络整理
导读:在我的服务器中,nginx -v返回nginx版本:nginx / 1.4.6(Ubuntu),它很老,所以我决定将它更新到最新的稳定版本. 然后,我跟着this answer: sudo apt-get updatesudo apt-get install nginx 它给: Reading package lists... DoneBuilding dependency tree Read

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

然后,我跟着this answer:

sudo apt-get update
sudo apt-get install nginx

它给:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  nginx-common nginx-core
Suggested packages:
  fcgiwrap nginx-doc
The following packages will be upgraded:
  nginx nginx-common nginx-core
3 upgraded,0 newly installed,0 to remove and 311 not upgraded.
Need to get 349 kB of archives.
After this operation,3,072 B of additional disk space will be used.
Do you want to continue? [Y/n] 
Get:1 http://mirrors.digitalocean.com/ubuntu/ trusty-updates/main nginx-common all 1.4.6-1ubuntu3.7 [19.0 kB]
Get:2 http://mirrors.digitalocean.com/ubuntu/ trusty-updates/main nginx all 1.4.6-1ubuntu3.7 [5,352 B]
Get:3 http://mirrors.digitalocean.com/ubuntu/ trusty-updates/main nginx-core amd64 1.4.6-1ubuntu3.7 [325 kB]
Fetched 349 kB in 0s (431 kB/s)
Preconfiguring packages ...
(Reading database ... 111751 files and directories currently installed.)
Preparing to unpack .../nginx-common_1.4.6-1ubuntu3.7_all.deb ...
Unpacking nginx-common (1.4.6-1ubuntu3.7) over (1.4.6-1ubuntu3.5) ...
Preparing to unpack .../nginx_1.4.6-1ubuntu3.7_all.deb ...
Unpacking nginx (1.4.6-1ubuntu3.7) over (1.4.6-1ubuntu3.5) ...
Preparing to unpack .../nginx-core_1.4.6-1ubuntu3.7_amd64.deb ...
Unpacking nginx-core (1.4.6-1ubuntu3.7) over (1.4.6-1ubuntu3.5) ...
Processing triggers for ufw (0.34~rc-0ubuntu2) ...
Processing triggers for ureadahead (0.100.0-16) ...
Processing triggers for man-db (2.6.7.1-1ubuntu1) ...
Setting up nginx-common (1.4.6-1ubuntu3.7) ...
Setting up nginx-core (1.4.6-1ubuntu3.7) ...
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

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读