Apache 2.4.54 中对 OPENSSL_sk_num ERR 的未定义引用

Apache 2.4.54 中对 OPENSSL_sk_num ERR 的未定义引用

我无法在 Linux 平台上编译 Apache HTTPd-2.4.54。

我的系统配置:

  • 操作系统:3.10.0-1160.76.1.el7.x86_64
  • Openssl:OpenSSL 1.1.1q 2022 年 7 月 5 日

我收到以下错误,即使我尝试使用 OpenSSL 3x,我仍然收到相同的错误。

请帮助我。

我使用的命令:

[[email protected]]# export LD_LIBRARY_PATH=/usr/local/lib:/usr/local/lib64:$LD_LIBRARY_PATH
[[email protected]]# systemctl stop apache2.service
[[email protected]]# ./configure --prefix=/app/Apache2.4 --enable-mods-shared=all --enable-ssl --with-ssl=/usr/local/bin/openssl --enable-so --with-openssl=/usr/local/bin/openssl
[[email protected]]# Make & make test


httpd-2.4.54/modules/mappers -prefer-non-pic -static -c ab.c && touch ab.lo
/usr/lib64/apr-1/build/libtool --silent --mode=link gcc -std=gnu99 -pthread \
-o ab ab.lo /usr/lib64/libaprutil-1.la -ldb-5.3 -lexpat -ldb-5.3 /usr/lib64/libapr-1.la -lpthread -ldl -lm -lssl -lcrypto -lpthread -ldl
ab.o: In function `sk_X509_num':
ab.c:(.text+0x14): undefined reference to `OPENSSL_sk_num'
ab.o: In function `sk_X509_value':
ab.c:(.text+0x36): undefined reference to `OPENSSL_sk_value'
ab.o: In function `ssl_state_cb':
ab.c:(.text+0x5cd): undefined reference to `SSL_in_init'
ab.o: In function `ssl_print_cert_info':
ab.c:(.text+0x890): undefined reference to `X509_get_version'
ab.c:(.text+0x8d5): undefined reference to `X509_getm_notBefore'
ab.c:(.text+0x92b): undefined reference to `X509_getm_notAfter'
ab.o: In function `test':
ab.c:(.text+0x4fae): undefined reference to `SSL_in_init'
ab.o: In function `main':
ab.c:(.text+0x5c24): undefined reference to `TLS_client_method'
ab.c:(.text+0x644c): undefined reference to `TLS_client_method'
ab.c:(.text+0x674e): undefined reference to `OPENSSL_init_ssl'
ab.c:(.text+0x675d): undefined reference to `OPENSSL_init_ssl'
ab.c:(.text+0x67f8): undefined reference to `SSL_CTX_set_options'
ab.c:(.text+0x6886): undefined reference to `SSL_CTX_set_ciphersuites'
collect2: error: ld returned 1 exit status

此致敬礼,罗斯。

答案1

所以我确实尝试自己做

安装开发工具

yum groupinstall "Development tools"

安装所需的依赖项

yum install wget tar unzip zip pcre pcre-devel expat expat-devel -y

下载它

wget https://dlcdn.apache.org/httpd/httpd-2.4.54.tar.gz

提炼

tar -xzvf httpd-2.4.54.tar.gz

获取额外内容

cd httpd-2.4.54/srclib
wget https://dlcdn.apache.org//apr/apr-1.7.0.tar.gz && wget https://dlcdn.apache.org//apr/apr-util-1.6.1.tar.gz
tar -xzvf apr-1.7.0.tar.gz && tar -xzvf apr-util-1.6.1.tar.gz
mv apr-1.7.0 apr && mv apr-util-1.6.1 apr-util

建造

./configure --prefix=/usr/local/bin
make && make install

希望它对你有用。

另外,您遇到的错误是因为您./configure ...在安装之前运行expat-devel

我认为最安全的选择是使用 CentOS 提供的现有软件包

相关内容