Nginx配置ssl模块报错:OpenSSL library ... not found

安装配置ssl模块前执行环境预检测时报错:

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库,一种解决方案:根据提示我们可以根据提示从源代码静态地构建OpenSSL库。
从OpenSSL官网下载OPENSSL,下载地址:https://www.openssl.org/source/。
将资源文件下载上传至服务器/otp/下并解压。
解压完成后,重新使用–with-openssl=参数指定检查配置时使用的openssl库,配置检测:

./configure --prefix=/usr/local/nginx  --with-http_ssl_module --with-http_stub_status_module --with-openssl=/otp/openssl-1.1.0k

然后编译安装即可

make && make install

最后,进入nginx源码目录下的objs目录,将’nginx’文件复制到nginx的安装目录sbin下,并执行命令检查是否成功安装ssl模块:

./nginx -V

在这里插入图片描述

重启nginx完成!

  • 16
    点赞
  • 11
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
这个问题的原因是在进行配置时,出现了SSL模块需要OpenSSL库的错误。要解决这个问题,你可以按照以下步骤进行操作: 1. 安装OpenSSL库。你可以使用以下命令在Ubuntu上安装libssl-dev库:sudo aptitude install libssl-dev。 2. 如果已经安装了OpenSSL库但仍然出现错误,那可能是因为库路径没有正确设置。你可以尝试使用--with-openssl=<path>选项来指定OpenSSL库的路径,其中<path>是OpenSSL库的安装路径。 引用中提供了一个例子供你参考,你可以按照类似的方式来解决这个问题。另外,你还可以参考引用中提供的步骤来安装其他所需的库,比如PCRE库。 希望这些信息对你有帮助! [2123 #### 引用[.reference_title] - *1* [ubuntu 编译nginx时出错解决办法](https://blog.csdn.net/PER_son/article/details/52488562)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}} ] [.reference_item] - *2* *3* [Ubuntu20.04 nginx 编译、配置错误处理](https://blog.csdn.net/ITxiaozhang7/article/details/120739312)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}} ] [.reference_item] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值