wget https://www.openssl.org/source/openssl-1.1.0f.tar.gz
tar -zxvf openssl-1.1.0f.tar.gz
cd openssl-1.1.0f
./config make && make install
(3) rewrite 模块需要 pcre 库
wget https://ftp.pcre.org/pub/pcre/pcre-8.01.tar.gz
tar -zxvf pcre-8.01.tar.gz
cd pcre-8.01
./configure make && make install
(4) gzip 模块需要 zlib 库
wget https://nchc.dl.sourceforge.net/project/libpng/zlib/1.2.11/zlib-1.2.11.tar.gz
tar -zxvf zlib-1.2.11.tar.gz
cd zlib-1.2.11
./configure make && make install
(4) nginx安装
wget http://nginx.org/download/nginx-1.12.1.tar.gz
tar -zxvf nginx-1.12.1.tar.gz
cd nginx-1.12.1
./configure --prefix=/usr/local/nginx make && make install
二、设置依赖库连接
如果输入语句:./usr/local/nginx/sbin/nginx出现错误:
error while loading shared libraries: libpcre.so.0: cannot open shared object file: No such file or directory
可输入:
whereis libpcre.so.1
结果:libpcre.so: /lib64/libpcre.so.1 /usr/local/lib/libpcre.so /usr/local/lib/libpcre.so.0
再使用ln命令,将libpcre.so.0,libpcre.so和libpcre.so.1连接到lib64目录下: