nginx与openSSL版本不兼容问题

本人先前使用的nginx-version为1.18.0,openSSL-version为3.0.2;

在源码的安装configure过程中,出现以下报错

复制代码
error: 'ENGINE_free' is deprecated: Since OpenSSL 3.0 [-Werror=deprecated-declarations]
  734 |             ENGINE_free(engine);
      |             ^~~~~~~~~~~
In file included from src/event/ngx_event_openssl.h:22,
                 from src/core/ngx_core.h:84,
                 from src/event/ngx_event_openssl.c:9:
/usr/include/openssl/engine.h:493:27: note: declared here
  493 | OSSL_DEPRECATEDIN_3_0 int ENGINE_free(ENGINE *e);
      |                           ^~~~~~~~~~~
src/event/ngx_event_openssl.c:738:9: error: 'ENGINE_free' is deprecated: Since OpenSSL 3.0 [-Werror=deprecated-declarations]
  738 |         ENGINE_free(engine);
      |         ^~~~~~~~~~~
In file included from src/event/ngx_event_openssl.h:22,
                 from src/core/ngx_core.h:84,
                 from src/event/ngx_event_openssl.c:9:
/usr/include/openssl/engine.h:493:27: note: declared here

查阅资料得知nginx1.18.0与openSSL 3.0不兼容,我将nginx升级到1.22.0-version解决了此问题。

安装步骤

1. 更新系统包

首先,更新系统包以确保所有软件都是最新版本:

复制代码
sudo apt-get update
sudo apt-get upgrade -y

2. 安装编译工具和依赖

安装编译 Nginx 所需的工具和库:

复制代码
sudo apt-get install -y build-essential libpcre3 libpcre3-dev libssl-dev zlib1g-dev

3. 下载并编译 Nginx

3.1下载 Nginx 源码

复制代码
mkdir ~/nginx-build && cd ~/nginx-build
wget http://nginx.org/download/nginx-1.22.0.tar.gz 
tar -zxvf nginx-1.22.0.tar.gz

3.2编译 Nginx 并添加想要安装的模块,例如RTMP 模块

复制代码
cd nginx-1.22.0
./configure --with-http_ssl_module --add-module=../nginx-rtmp-module
make
sudo make install

4.启动nginx

复制代码
sudo /usr/local/nginx/sbin/nginx

5.验证配置

5.1检查 Nginx 是否运行

复制代码
sudo /usr/local/nginx/sbin/nginx -t

5.2检查 RTMP 模块是否加载

复制代码
sudo /usr/local/nginx/sbin/nginx -V

如果配置正确,你应该在输出中看到 --add-module=...nginx-rtmp-module

相关推荐
石像鬼₧魂石3 小时前
内网渗透靶场实操清单(基于 Vulhub+Metasploitable 2)
linux·windows·学习·ubuntu
Danileaf_Guo3 小时前
256台H100服务器算力中心的带外管理网络建设方案
运维·服务器
橘子真甜~4 小时前
C/C++ Linux网络编程15 - 网络层IP协议
linux·网络·c++·网络协议·tcp/ip·计算机网络·网络层
拾贰_C5 小时前
【Linux | Windows | Terminal Command】 Linux---grep | Windows--- findstr
linux·运维·服务器
阿华hhh6 小时前
Linux系统编程(标准io)
linux·开发语言·c++
石像鬼₧魂石6 小时前
Kali Linux 网络端口深度扫描
linux·运维·网络
alengan6 小时前
linux上面写python3日志服务器
linux·运维·服务器
Evan芙7 小时前
搭建nexus服务,实现本地仓库、代理仓库
java·nginx·tomcat
Rose sait7 小时前
【环境配置】Linux配置虚拟环境pytorch
linux·人工智能·python
小卒过河01048 小时前
使用apache nifi 从数据库文件表路径拉取远程文件至远程服务器目的地址
运维·服务器·数据库