gpt4 book ai didi

ubuntu - 在 ubuntu 14.04 中更新 nginx

转载 作者:太空宇宙 更新时间:2023-11-03 16:45:03 25 4
gpt4 key购买 nike

在我的服务器中,nginx -v返回nginx version: 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 version: 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

关于ubuntu - 在 ubuntu 14.04 中更新 nginx,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44116176/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com