Score:0

Undefined reference to OPENSSL_sk_num ERR for Apache 2.4.54

nl flag

I am unable to compile Apache HTTPd-2.4.54 on Linux platform.

My system config:

  • OS: 3.10.0-1160.76.1.el7.x86_64
  • Openssl: OpenSSL 1.1.1q 5 Jul 2022

I am getting the following error, even when I try with OpenSSL 3x, I am getting the same error.

Please kindly help me.

Commands I used:

[[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

Regards, Rose.

pt flag
Can you tell us more about what distribution and version you're using? It looks like you're using a RHEL variant (like RHEL 7 or CentOS 7), but on these platforms the service is named `httpd`.
Rose Wood avatar
nl flag
RHEL 7, Thank you so much for your help.
Score:0
nl flag

Thanks a lot, Alexander, I followed your steps, but I am still getting the same errors, My OS is RHEL 7. please help me.

  1. "Development Tools" is already installed.

  2. [[email protected] httpd-2.4.54]# yum install wget tar unzip zip pcre pcre-devel expat expat-devel -y Package wget-1.14-18.el7_6.1.x86_64 already installed and latest version Package 2:tar-1.26-35.el7.x86_64 already installed and latest version Package unzip-6.0-24.el7_9.x86_64 already installed and latest version Package zip-3.0-11.el7.x86_64 already installed and latest version Package pcre-8.32-17.el7.x86_64 already installed and latest version Package pcre-devel-8.32-17.el7.x86_64 already installed and latest version Package expat-2.1.0-15.el7_9.x86_64 already installed and latest version Package expat-devel-2.1.0-15.el7_9.x86_64 already installed and latest version Nothing to do

  3. The apr and apr-util are installed. [[email protected] srclib]# ls apr apr-1.7.0.tar.gz apr-util apr-util-1.6.1.tar.gz Makefile Makefile.in

  4. After that still I am getting the same error

/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 make[2]: *** [ab] Error 1 make[2]: Leaving directory /httpd-2.4.54/support' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory ` /httpd-2.4.54/support' make: *** [all-recursive] Error 1

Score:0
jp flag

so I did tried to do it myself

Install dev tools

yum groupinstall "Development tools"

Install required dependencies

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

Download it

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

Extract

tar -xzvf httpd-2.4.54.tar.gz

Get the extras

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

Build

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

Hopefully it's working for you.

Also the error you are having is because you ran ./configure ... before installing expat-devel

In my opinion the safest choice for you is to use the already existent package provided by CentOS

Rose Wood avatar
nl flag
Thanks a lot, Alexander, I followed your steps, but I am still getting the same errors, please help me.
Alexander Br. avatar
jp flag
run JUST `./configure --prefix=/usr/local/bin`, without specifying those arguments, that you mentioned above. why are you trying to install apache on /app/ ? that most likely doesn't exist or it may not be in your $PATH ?
Rose Wood avatar
nl flag
Thanks Alexander, I used ./configure --prefix=/app/Apache2.4 parameter only. That is where "/app/Apache2.4" my current version is 2.4.43 installed
Alexander Br. avatar
jp flag
are you using a docker container ?
Rose Wood avatar
nl flag
No, It's straightforward Linux RHEL 7 system. Thank you.
Alexander Br. avatar
jp flag
have you fixed it ? follow my steps again
Rose Wood avatar
nl flag
I followed and I am getting the same error.
Alexander Br. avatar
jp flag
I never said you should use configure with this path - /app/Apache2.4 - follow my exact steps
Rose Wood avatar
nl flag
Sure, I will try one more time and let you know, Thank you.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.