Nginx编译时openssl not found问题及解决过程
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部分文件

解决方法

总结
以上为个人经验,希望能给大家一个参考,也希望大家多多支持脚本之家。
相关文章
Nginx+cpolar实现内网穿透多个Windows Web站点端口的步骤详解
这篇文章主要给大家介绍了Nginx+cpolar实现内网穿透多个Windows Web站点端口的详细步骤,文章通过图文介绍的非常详细,对大家的学习或工作有一定的帮助,需要的朋友可以参考下2023-10-10
Nginx 502 bad gateway和Nginx 504 Gateway Time-out错误解决方法 错误解决办
Nginx 502 Bad Gateway的含义是请求的PHP-CGI已经执行,但是由于某种原因(一般是读取资源的问题)没有执行完毕而导致PHP-CGI进程终止2012-09-09


最新评论