服务器 > 网络 > SSL

Nginx编译时openssl not found问题及解决过程

44人参与 2026-04-07 SSL

nginx编译时openssl not found

有时候因为nginx升级之后使用了高版本的openssl,本地需要添加新模块重新编译nginx时候要升级openssl至指定版本。

源码安装openssl之后重新编译nginx会报如下错误:

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

其实是openssl的库没有找到。 nginx查找的路径为:/usr/local/ ; /usr/pkg/; /opt/local;

只要把刚刚源码编译生成的库放到对应目录就可以了。

以我的机器centos7 64位系统为例。openssl源码编译安装后,库的位置为

/usr/local/lib64

于是我把此目录下的库移动到/usr/local下。

再次编译的时候还是报错:

openssl library not found.

重新看了下配置的脚本发现。

原来nginx是在 /usr/local/lib; /usr/pkg/lib; /opt/local/lib; 这三个路径下去查找;

把库拷贝到 /usr/local/lib下即可编译。

注上面是别人写的:

我为了偷懒,使用ln -s命令创建链接,发现不行。最后还是老老实实直接cp过去比较好。

下面是源码编译时找不到openssl部分文件

解决方法


 

总结

以上为个人经验,希望能给大家一个参考,也希望大家多多支持代码网。

(0)

您想发表意见!!点此发布评论

推荐阅读

Nginx安装免费SSL证书开启Https请求实现步骤

04-12

Centos7中搭建Nginx环境全过程

04-12

Nginx安装后添加ssl模块方式实践

04-12

Nginx服务器上安装SSL证书方式

04-13

Nginx 中 ssl_buffer_size 参数调优的具体实现

04-19

Nginx proxy_ssl_server_name 解决后端多域名证书匹配失败的方法

04-20

猜你喜欢

版权声明:本文内容由互联网用户贡献,该文观点仅代表作者本人。本站仅提供信息存储服务,不拥有所有权,不承担相关法律责任。 如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至 2386932994@qq.com 举报,一经查实将立刻删除。

发表评论