源码编译-nginx
安装所需工具包
[root@localhost ~]# yum install -y pcre-devel wget net-tools gcc zlib zlib-devel make openssl-devel
Loaded plugins: fastestmirror
base | 3.6 kB 00:00:00
docker | 2.9 kB 00:00:00
extras | 2.9 kB 00:00:00
updates | 2.9 kB 00:00:00
Loading mirror speeds from cached hostfile
- base: mirrors.nju.edu.cn
- extras: mirrors.aliyun.com
- updates: mirrors.aliyun.com
…
Complete!
[root@localhost ~]# wget http://nginx.org/download/nginx-1.8.0.tar.gz 下载nginx的配置文件
–2020-11-26 20:49:30-- http://nginx.org/download/nginx-1.8.0.tar.gz
Resolving nginx.org (nginx.org)… 52.58.199.22, 3.125.197.172, 2a05:d014:edb:5704::6, …
Connecting to nginx.org (nginx.org)|52.58.199.22|:80… connected.
HTTP request sent, awaiting response… 200 OK
Length: 832104 (813K) [application/octet-stream]
Saving to: ‘nginx-1.8.0.tar.gz’
100%[============================================================================================>] 832,104 137KB/s in 9.1s
2020-11-26 20:49:45 (89.5 KB/s) - ‘nginx-1.8.0.tar.gz’ saved [832104/832104]
[root@localhost ~]# tar -zxvf nginx-1.8.0.tar.gz
[root@localhost ~]# ll
total 3270344
-rw-------. 1 root root 1079 Nov 26 16:23 anaconda-ks.cfg
-rw-r–r--. 1 root root 3314069073 Nov 28 2019 Docker.tar.gz
drwxr-xr-x. 8 1001 1001 4096 Apr 21 2015 nginx-1.8.0
-rw-r–r--. 1 root root 832104 Apr 21 2015 nginx-1.8.0.tar.gz
-rw-r–r--. 1 root root 33918976 Dec 14 2019 registry_latest.tar
[root@localhost ~]# cd nginx-1.8.0
[root@localhost nginx-1.8.0]# ll
total 636
drwxr-xr-x. 6 1001 1001 4096 Nov 26 20:51 auto
-rw-r--r--. 1 1001 1001 249124 Apr 21 2015 CHANGES
-rw-r--r--. 1 1001 1001 379021 Apr 21 2015 CHANGES.ru
drwxr-xr-x. 2 1001 1001 4096 Nov 26 20:51 conf
-rwxr-xr-x. 1 1001 1001 2478 Apr 21 2015 configure
drwxr-xr-x. 4 1001 1001 68 Nov 26 20:51 contrib
drwxr-xr-x. 2 1001 1001 38 Nov 26 20:51 html
-rw-r--r--. 1 1001 1001 1397 Apr 21 2015 LICENSE
drwxr-xr-x. 2 1001 1001 20 Nov 26 20:51 man
-rw-r--r--. 1 1001 1001 49 Apr 21 2015 README
drwxr-xr-x. 8 1001 1001 71 Nov 26 20:51 src
[root@localhost nginx-1.8.0]# mkdir -p /usr/local/nginx 创建目录
- List item
[root@localhost nginx-1.8.0]# ./configure --prefix=/usr/local/nginx
[root@localhost ngi