当前位置: 代码网 > 服务器>网络>SSL > Nginx编译时openssl not found问题及解决过程

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

2026年04月07日 SSL 我要评论
nginx编译时openssl not found有时候因为nginx升级之后使用了高版本的openssl,本地需要添加新模块重新编译nginx时候要升级openssl至指定版本。源码安装openss

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)

相关文章:

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

发表评论

验证码:
Copyright © 2017-2026  代码网 保留所有权利. 粤ICP备2024248653号
站长QQ:2386932994 | 联系邮箱:2386932994@qq.com