? 1, 安装依赖环境
- yum -y install gcc automake autoconf libtool make
- yum -y install gcc gcc-c++ pcre-devel openssl openssl-devel
? 2, 安装 pcre,zlib, 前者为了重写 rewrite, 后者为了 gzip 压缩.
安装 pcre (Apache 中已经下载安装过的可以跳过)
- [root@localhost ~]# wget https://netix
- .dl
- .sourceforge
- .net/project/pcre/pcre/8.40/pcre-8.41.tar.gz
- [root@localhost ~]# tar -zxvf pcre-8.41.tar.gz
安装 zlib
- [root@localhost ~]# wget http://www.zlib.net/zlib-1.2.8.tar.gz
- [root@localhost zlib-1.2.8]# cd zlib-1.2.8
- [root@localhost zlib-1.2.8]# ./configure --prefix=/usr/local/zlib
- [root@localhost zlib-1.2.8]# make && make install
Nginx 安装
? 3, 安装 openssl
- [root@localhost ~]# wget https://www.openssl.org/source/openssl-1.0.1t.tar.gz
- [root@localhost ~]# tar -zxvf openssl-1.0.1t.tar.gz
? 4,Nginx 安装
下载地址: http://nginx.org/en/download.html
- [root@localhost ~]# tar -xvf nginx-1.13.8.tar
- [root@localhost nginx-1.13.8]#./configure --sbin-path=/usr/local/nginx/nginx --
- conf-path=/usr/local/nginx/nginx.conf --pid-path=/usr/local/nginx/nginx.pid --with-
- http_ssl_module --with-pcre=/root/pcre-8.41 --with-zlib=/usr/local/zlib --with-
- openssl=/root/openssl
- [root@localhost nginx-1.13.8]#make && make install
来源: http://www.bubuko.com/infodetail-2651449.html