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
1
refraction 2016-02-25 22:11:24 +08:00
补充一下, Nginx 官方源的包可能和 ubuntu 源的默认配置目录位置不同,更新完后可能需要在 /etc/nginx/nginx.conf 中加上
“ include /etc/nginx/sites-available/*.conf; ” |
2
wittyfox 2016-02-26 13:25:57 +08:00 via Android 1
@refraction /etc/nginx/ 可以去掉。
直接 include sites-available/*.conf |
3
Livid MOD |
4
kawaiiushio 2016-03-10 21:06:21 +08:00
珍爱生命 服务器远离 ubuntu 暗坑太多
|