SUSE nginx编译配置SSL时提示找不到SSL库(已装OPENSSL)

本文解决Nginx编译时找不到SSL库的问题,通过调整库路径或使用静态编译方式,确保Nginx能正确链接到OpenSSL库。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

一:查看服务器版本

smp-upload-01:~ # lsb_release -a
LSB Version:    core-2.0-noarch:core-3.2-noarch:core-4.0-noarch:core-2.0-x86_64:core-3.2-x86_64:core-4.0-x86_64:desktop-4.0-amd64:desktop-4.0-noarch:graphics-2.0-amd64:graphics-2.0-noarch:graphics-3.2-amd64:graphics-3.2-noarch:graphics-4.0-amd64:graphics-4.0-noarch
Distributor ID: SUSE LINUX
Description:    SUSE Linux Enterprise Server 11 (x86_64)
Release:        11
Codename:       n/a

二:编译nginx

#./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.

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
提示找不到SSL库

上面红色字体的部分就是问题的原因所在,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编译。
 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值