已经安装了openssl,但是执行 ./configure时还是一直报:./configure: error: SSL modules require the OpenSSL library.

安装openresty时,执行 ./configure时一直报:./configure: error: SSL modules require the OpenSSL library.

 

./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=<path> option.

 

 

我以为是openssl没安装成功,再次yum install  openssl,但是发现明明已经是有openssl存在的了。。。

看错误提示:

or build the OpenSSL library statically from the source
with nginx by using --with-openssl=<path> option.

很开心,按上面的指示,应该是要指定openssl的位置,于是which openssl找到openssl的安装位置, ./configure时增加参数,--with-openssl=/usr/local/bin/openssl,(然而这一步也是错误的!!!)

./configure是通过了,但是,在执行gmake时就出现了新问题,
gmake[2]: *** [/usr/local/ssl/.openssl/include/openssl/ssl.h] Error 127
gmake[2]: Leaving directory `/root/openresty-1.11.2.2/build/nginx-1.11.2'
gmake[1]: *** [build] Error 2
gmake[1]: Leaving directory `/root/openresty-1.11.2.2/build/nginx-1.11.2'
gmake: *** [all] Error 2

 

究其原因,上面提示的应该是一个source的位置,而不应该是openssl的安装位置。。。
参考博客:https://www.phpsong.com/2930.html

但是openssl是通过yum install安装的,没有存到它的源码包(还是说我没找到?)
只能再到官网下载一个,https://www.openssl.org/source/openssl-1.1.1d.tar.gz
找到不你需要的版本没关系,找到一个版本相近的包,复制其下载链接,将后面的openssl版本替换成你需要的即可
(可以通过openssl vesion查看已经安装了的openssl的版本信息)

最后解压openssl源码包到一个位置
最终的 ./configure的参数形式为
./configure --prefix=/opt/openresty \
            --with-luajit \
            --without-http_redis2_module \
            --with-http_iconv_module \
            --with-http_postgres_module \
            --with-openssl=/OpenResty/package/openssl-1.1.0e

 

 

问题解决,希望可以帮到你

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值