Skip to content

Commit b72ae2f

Browse files
committed
update readme
1 parent 81f21e4 commit b72ae2f

File tree

1 file changed

+26
-19
lines changed

1 file changed

+26
-19
lines changed

Nginx/nginx-install.md

+26-19
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,16 @@
1818
+ 更新系统:`sudo apt update && sudo apt upgrade -y`
1919
#### 从源代码构建NGINX
2020
+ 1、NGINX是用C编写的程序,所以我们需要安装C编译器(GCC)。
21-
```bash
21+
2222
sudo apt install build-essential -y
23-
```
23+
2424
+ 2、下载最新版本的NGINX源代码并解压缩:
25-
```bash
25+
2626
wget https://nginx.org/download/nginx-1.13.1.tar.gz && tar zxvf nginx-1.13.1.tar.gz
27-
```
27+
2828
+ 3、下载NGINX依赖项的源代码并解压缩
2929
> NGINX依赖于3个库:PCRE,zlib和OpenSSL:
30-
```bash
30+
3131
# PCRE version 4.4 - 8.40
3232
wget https://ftp.pcre.org/pub/pcre/pcre-8.40.tar.gz && tar xzvf pcre-8.40.tar.gz
3333

@@ -36,21 +36,21 @@
3636

3737
# OpenSSL version 1.0.2 - 1.1.0
3838
wget https://www.openssl.org/source/openssl-1.1.0f.tar.gz && tar xzvf openssl-1.1.0f.tar.gz
39-
```
39+
4040
+ 4、删除所有.tar.gz文件。我们不再需要了
41-
```bash
41+
4242
wget https://nginx.org/download/nginx-1.13.1.tar.gz && tar zxvf nginx-1.13.1.tar.gz
43-
```
43+
4444
+ 5、转到NGINX源目录:``
45-
```bash
45+
4646
cd ~/nginx-1.13.1
47-
```
47+
4848
+ 6、有关帮助,您可以通过运行以下列出可用的配置开关
49-
```bash
49+
5050
./configure --help
51-
```
51+
5252
+ 7、配置,编译和安装NGINX:
53-
```bash
53+
5454
./configure --prefix=/usr/share/nginx \
5555
--sbin-path=/usr/sbin/nginx \
5656
--modules-path=/usr/lib/nginx/modules \
@@ -105,12 +105,12 @@
105105
--with-ld-opt='-Wl,-Bsymbolic-functions -fPIE -pie -Wl,-z,relro -Wl,-z,now'
106106
make
107107
sudo make install
108-
```
108+
109109
+ 8、从主目录中删除所有下载的文件,在这种情况下/home/username:
110-
```bash
110+
111111
cd ~
112112
rm -r nginx-1.13.1/ openssl-1.1.0f/ pcre-8.40/ zlib-1.2.11/
113-
```
113+
114114
+ 9、检查NGINX版本和编译时间选项:
115115
```bash
116116
sudo nginx -v && sudo nginx -V
@@ -173,11 +173,11 @@
173173
```bash
174174
sudo shutdown -r now
175175
```
176-
+ 17、创建UFW NGINX应用程序配置文件:
176+
+ 17、创建UFW NGINX应用程序配置文件:
177177
```bash
178178
sudo vim /etc/ufw/applications.d/nginx
179179
```
180-
+ 18、复制/粘贴以下内容:
180+
+ 18、复制/粘贴以下内容:
181181
```bash
182182
[Nginx HTTP]
183183
title=Web Server (Nginx, HTTP)
@@ -203,4 +203,11 @@
203203
# Nginx HTTP
204204
# Nginx HTTPS
205205
# OpenSSH
206-
```
206+
```
207+
### Build
208+
209+
cd to NGINX source directory & run this:
210+
211+
./configure --add-module=/path/to/nginx-rtmp-module
212+
make
213+
make install

0 commit comments

Comments
 (0)