openssl源码安装后,编译nginx-1.9.7或者openresty找不到OpenSSL的解决办法

在源码安装openssl后,编译nginx-1.9.7或openresty时遇到找不到openssl库的错误。问题在于nginx没有在正确路径下找到openssl。解决方案是将/usr/local/ssl/lib/目录下的文件复制到系统默认的lib目录,或者通过配置选项--with-openssl指定openssl源码目录进行编译。
部署运行你感兴趣的模型镜像

问题:nginx编译找不到openssl

现象:源码安装openssl的目录是/usr/local/ssl/

就算把/usr/local/ssl/lib 添加到 /etc/ld.so.conf内,并且ldconfig -v,发现nginx编译时依然报找不到openssl的错误,如下

#./configure --with-http_ssl_modul

--------------------------------------------------------------

checking for OpenSSL library ... not found
checking for OpenSSL library in /usr/local/ ... not found
checking for OpenSSL library in /usr/pkg/ ... not found
checking for OpenSSL library in /opt/local/ ... not found


./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库文件。

上面红色字体的部分就是问题的原因所在,nginx会去红色字体的几个目录下找openssl库,而默认安装的路径是/usr/local/ssl

解决办法:

把/usr/local/ssl/lib/目录下的文件拷贝一份到以上红色路径的lib目录下即可,如cp /usr/local/ssl/lib/* /usr/local/lib/


之后再编译nginx或者openresty就正常了。


附:

或者可以使用./configure --with-openssl=your_openssl_source_dir编译。

您可能感兴趣的与本文相关的镜像

Stable-Diffusion-3.5

Stable-Diffusion-3.5

图片生成
Stable-Diffusion

Stable Diffusion 3.5 (SD 3.5) 是由 Stability AI 推出的新一代文本到图像生成模型,相比 3.0 版本,它提升了图像质量、运行速度和硬件效率

评论 2
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值