指引网

当前位置: 主页 > 服务器 > Nginx >

VPS服务器使用apt-get方式升级nginx(ubuntu/debian)

来源:网络 作者:佚名 点击: 时间:2017-06-13 21:31
[摘要]  最近用一台VPS服务器了,使用的是ubuntu系统了,下面我来给大家介绍利用apt-get方式升级nginx方法,这个体但可以用于ubuntu系统,同时还可以用于debian系统哦,下面我们一起来看操作

打开 /etc/apt/sources.list 添加下面两行

Ubuntu :
deb http://nginx.org/packages/ubuntu/ lucid nginx
deb-src http://nginx.org/packages/ubuntu/ lucid nginx

debian:
deb http://nginx.org/packages/debian/ squeeze nginx
deb-src http://nginx.org/packages/debian/ squeeze nginx

更新包、安装nginx
apt-get update
apt-get install nginx

提示:

Configuration file `/etc/nginx/nginx.conf'
==> Modified (by you or by a script) since installation.
==> Package distributor has shipped an updated version.
What would you like to do about it ? Your options are:
Y or I : install the package maintainer's version
N or O : keep your currently-installed version
D : show the differences between the versions
Z : background this process www.111cn.net to examine the situation
The default action is to keep your current version.
*** nginx.conf (Y/I/N/O/D/Z) [default=N] ?

这时输入N,保留之前的nginx.conf配置。

完成安装后,重启nginx
service nginx restart

完成更新,可以输入以下命令查看当前版本。
nginx -v

------分隔线----------------------------