咨询热线:4006-75-4006
售前:9:00-23:30 备案:9:00-18:00 技术:7*24h
加入nginx的repository
$ cd /home/
$ wget http://www.landui.com/keys/nginx_signing.key
$ sudo apt-key add nginx_signing.key
$ cd /etc/apt/sources.list.d/
$ sudo vim nginx.list
将下面2行复制粘贴到这个文件
deb http://www.landui.com/packages/ubuntu/ lucid nginx
deb-src http://www.landui.com/packages/ubuntu/ lucid nginx
2.用apt安装
$ sudo apt-get update
$ sudo apt-get install nginx
3.配置文件位置
/etc/nginx/nginx.conf
这个配置文件会包含/etc/nginx/conf.d/*.conf
默认主目录:/usr/share/nginx/html/
4.管理nginx服务
启动:$ sudo service nginx start
停止:$ sudo service nginx stop
重启:$ sudo service nginx restart