Ubuntu 14.04 升级到最新 Nginx
时间:2016-03-28 18:08 来源:未知 作者:IT
print 'deb http://nginx.org/packages/mainline/ubuntu/ trusty nginx\n' 'deb-src http://nginx.org/packages/mainline/ubuntu/ trusty nginx' > /etc/apt/sources.list.d/nginx.list
wget http://nginx.org/keys/nginx_signing.key -O - | sudo apt-key add -
apt-get update
apt-get -o Dpkg::Options::="--force-overwrite" install nginx
# move host file
pkill nginx
service nginx start
补充一下, Nginx 官方源的包可能和 ubuntu 源的默认配置目录位置不同,更新完后可能需要在 /etc/nginx/nginx.conf 中加上
“
include /etc/nginx/sites-available/*.conf;
”
/etc/nginx/ 可以去掉。
直接 include sites-available/*.conf (责任编辑:IT)
print 'deb http://nginx.org/packages/mainline/ubuntu/ trusty nginx\n' 'deb-src http://nginx.org/packages/mainline/ubuntu/ trusty nginx' > /etc/apt/sources.list.d/nginx.list wget http://nginx.org/keys/nginx_signing.key -O - | sudo apt-key add - apt-get update apt-get -o Dpkg::Options::="--force-overwrite" install nginx # move host file pkill nginx service nginx start 补充一下, Nginx 官方源的包可能和 ubuntu 源的默认配置目录位置不同,更新完后可能需要在 /etc/nginx/nginx.conf 中加上 “ include /etc/nginx/sites-available/*.conf; ” /etc/nginx/ 可以去掉。 直接 include sites-available/*.conf (责任编辑:IT) |