Skip to content

Commit ceea09b

Browse files
committed
新增Nginx安装过程
1 parent 0e9eff4 commit ceea09b

1 file changed

Lines changed: 47 additions & 0 deletions

File tree

Nginx.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
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+
安装成功

0 commit comments

Comments
 (0)