File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ ## Nginx
2+
3+ Nginx 官网:[ http://nginx.org/ ] ( http://nginx.org/ )
4+
5+ ### 安装 Nginx
6+
7+ 1、加入nginx repository signature
8+ ```
9+ $ cd /tmp/
10+ $ wget http://nginx.org/keys/nginx_signing.key
11+ $ sudo apt-key add nginx_signing.key
12+ $ cd /etc/apt/sources.list.d/
13+ $ sudo vim nginx.list
14+ ```
15+ 将下面2行复制粘贴到这个文件[ ubuntu 14.04]
16+ ```
17+ deb http://nginx.org/packages/ubuntu/ trusty nginx
18+ deb-src http://nginx.org/packages/ubuntu/ trusty nginx
19+ ```
20+ 其它系统参考这里:[ http://nginx.org/en/linux_packages.html ] ( http://nginx.org/en/linux_packages.html )
21+
22+ 2、安装
23+ ```
24+ $ sudo apt-get update
25+ $ sudo apt-get install nginx
26+ ```
27+
28+ 3、配置文件位置
29+
30+ /etc/nginx/nginx.conf
31+
32+ 这个配置文件会包含/etc/nginx/conf.d/* .conf
33+
34+ 默认主目录:/usr/share/nginx/html/
35+
36+ 4、管理nginx服务
37+ ```
38+ $ sudo service nginx start
39+ $ sudo service nginx stop
40+ $ sudo service nginx restart
41+ ```
42+
43+ 访问[ http://localhost ] ( http://localhost )
44+
45+ Welcome to nginx!
46+
47+ 安装成功
You can’t perform that action at this time.
0 commit comments