./configure: error: SSL modules require the OpenSSL library. You can either do not enable the modules, or install the OpenSSL library into the system, or build the OpenSSL library statically from the source with nginx by using --with-openssl= option
PCRE库已经安装,可是./configure nginx的时候仍然出现以上的错误,通过指定PCRE库的路径可以解决:
- openssl安装:
1.下载openssl(nginx-1.8.1版本对应的是openssl-1.0.1版本如果下载openssl-1.1.1版本会因为版本不匹配报错)
2.上传openssl至指定路径,此处为/usr/local/src下
3.cd /usr/local/src
4.tar -zxvf openssl-1.0.1.tar.gz
-重新安装nginx
1.tar -xvf nginx-1.8.1.tar.gz
2.cd /usr/nginx/nginx-1.8.1/(nginx的安装路径)
3./configure --prefix=/usr/nginx/nginx-1.8.1 --conf-path=/usr/nginx/nginx-1.8.1/sbin/nginx.conf --with-pcre=/usr/nginx/pcre-8.34 --with-zlib=/usr/nginx/zlib-1.2.8 --with-http_ssl_module --with-http_realip_module --with-openssl=/usr/local/src/openssl-1.0.1l(其中:/usr/local/src/openssl-1.0.1l为openssl的安装路径 conf-path=/usr/nginx/nginx-1.8.1/sbin/nginx.conf 指定nginx配置文件安装路径,防止出现“cp: "conf/koi-win" 与"/usr/nginx/nginx-1.8.1/conf/koi-win" 为同一文件”错误)
4.make
5.make install