使用自定义 OpenSSL 编译 Apache 后,“此版本的 mod_ssl 是针对较新的库进行编译的”

问题描述 投票:0回答:1

我已经编译并安装了较新版本的 OpenSSL,然后执行了 Apache 的全新安装,但它无法启动,日志中显示以下消息:

[Mon Mar 30 15:20:13.302086 2020] [ssl:warn] [pid 25350:tid 139644483991296] AH01882: Init: this version of mod_ssl was compiled against a newer library (Ope
nSSL 1.0.1e 11 Feb 2013, version currently loaded is OpenSSL 0.9.8j-fips 07 Jan 2009) - may result in undefined or erroneous behavior
[Mon Mar 30 15:20:13.302348 2020] [ssl:info] [pid 25350:tid 139644483991296] AH01887: Init: Initializing (virtual) servers for SSL

我使用的指南:如何在 Apache 2.2.9 中使用 mod_ssl 将 openssl 0.9.8 升级到 1.0.2

环境

$ ldd /opt/apache2/modules/mod_ssl.so
        linux-vdso.so.1 =>  (0x00007ffc2bd43000)
        libssl.so.1.0.0 => /opt/openssl/lib/libssl.so.1.0.0 (0x00007f4943eb6000)
        libcrypto.so.1.0.0 => /opt/openssl/lib/libcrypto.so.1.0.0 (0x00007f4943ae0000)
        librt.so.1 => /lib64/librt.so.1 (0x00007f49438d7000)
        libcrypt.so.1 => /lib64/libcrypt.so.1 (0x00007f494369c000)
        libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f494347f000)
        libdl.so.2 => /lib64/libdl.so.2 (0x00007f494327b000)
        libc.so.6 => /lib64/libc.so.6 (0x00007f4942eff000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f4944373000)

$ openssl version
OpenSSL 0.9.8j-fips 07 Jan 2009
$ /opt/openssl/bin/openssl version
OpenSSL 1.0.1e 11 Feb 2013
$ sudo /opt/apache2/bin/httpd -v
Server version: Apache/2.4.41 (Unix)
Server built:   Mar 30 2020 14:54:51

操作系统:SLES 11 SP4(这就是我决定编译OpenSSL的原因)

我该如何修复它?

apache openssl mod-ssl
1个回答
0
投票

您需要启动 httpd 服务,并将 LD_LIBRARY_PATH 设置为较新 openssl 版本的 lib 目录。

像这样(用您的特定路径替换 openssl 和 apache 的路径):

sudo LD_LIBRARY_PATH=/opt/openssl-3.1.2/lib/64 /usr/local/apache24/bin/apachectl start
© www.soinside.com 2019 - 2024. All rights reserved.