0

I am attempting to rebuild Apache from source and am encountering an issue I have not faced before.

I have built Apache version 2.4.57 from source many times in the past and have had no issues during the make stage.

I grabbed Apache:

wget https://archive.apache.org/dist/httpd/httpd-2.4.57.tar.gz

Configure it:

./configure --prefix=/path/to/server --with-ssl=/opt/openssl/bin

And attempt to build:

make

But then I receive this error:

/usr/share/apr-1.0/build/libtool --silent --mode=link x86_64-linux-gnu-gcc  -pthread    \
         -o ab  ab.lo       /usr/lib/x86_64-linux-gnu/libaprutil-1.la /usr/lib/x86_64-linux-gnu/libapr-1.la -lm -lssl -lcrypto
/usr/bin/ld: ab.o: in function `ssl_print_cert_info':
ab.c:(.text+0xa94): undefined reference to `EVP_PKEY_get_bits'
/usr/bin/ld: ab.o: in function `ssl_print_info':
ab.c:(.text+0xc6c): undefined reference to `SSL_get1_peer_certificate'
/usr/bin/ld: ab.o: in function `ssl_proceed_handshake':
ab.c:(.text+0xe0c): undefined reference to `SSL_get1_peer_certificate'
/usr/bin/ld: ab.c:(.text+0xe2b): undefined reference to `EVP_PKEY_get_bits'
/usr/bin/ld: ab.c:(.text+0xefc): undefined reference to `EVP_PKEY_get_id'
/usr/bin/ld: ab.c:(.text+0xf2d): undefined reference to `EVP_PKEY_get_bits'
/usr/bin/ld: ab.c:(.text+0xf62): undefined reference to `EVP_PKEY_get_bits'
/usr/bin/ld: ab.c:(.text+0xff5): undefined reference to `EVP_PKEY_get_bits'
/usr/bin/ld: ab.c:(.text+0x102f): undefined reference to `EVP_PKEY_get_bits'
/usr/bin/ld: ab.c:(.text+0x103d): undefined reference to `EVP_PKEY_get_id'
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:73: ab] Error 1
make[2]: Leaving directory '/srv/apache/httpd-2.4.57/support'
make[1]: *** [/srv/apache/httpd-2.4.57/build/rules.mk:75: all-recursive] Error 1
make[1]: Leaving directory '/srv/apache/httpd-2.4.57/support'
make: *** [/srv/apache/httpd-2.4.57/build/rules.mk:75: all-recursive] Error 1

Attempts at a solution

I have recently been playing with postfix, and encountered issues with an openssl version there. In attempting to solve that issue, I seem to have altered my systems openssl libraries and now apache won't build.

Attempting to fix Openssl, I suspected the issue could be my openssl version was too modern (3.2.1) for apache version 2.4.57, so, following this post: https://askubuntu.com/questions/1126893/how-to-install-openssl-1-1-1-and-libssl-package I downgraded to version 1.1.1. I configured apache to build with this version. Unfortunately, no luck.

Despite searching online, I cannot find any solution to this specific issue. I am also having difficulty finding reference to what version of OpenSSL apache requires, or if it is possible to configure apache to build without these libraries. Possibly by a ./configure flag ? I do not mind building without SSL support.

If anyone can shed light on this situation either with a specific solution, or possible hints regarding the versions httpd requires, I would be most grateful.

Update

I repeated the Openssl instructions listed in the stackoverflow post referenced above for openssl version 3.0.2, as suggested in the comments. When running make test, some tests are failed:

Test Summary Report
-------------------
25-test_verify.t                 (Wstat: 512 Tests: 160 Failed: 2)
  Failed tests:  157-158
  Non-zero exit status: 2
80-test_cms.t                    (Wstat: 1792 Tests: 12 Failed: 7)
  Failed tests:  2-6, 9, 12
  Non-zero exit status: 7
80-test_ssl_new.t                (Wstat: 256 Tests: 30 Failed: 1)
  Failed test:  12
  Non-zero exit status: 1
Files=242, Tests=3284, 433 wallclock secs ( 8.33 usr  0.51 sys + 391.95 cusr 46.46 csys = 447.25 CPU)
Result: FAIL

Despite these test errors, I continued installing Openssl. When I then configure apache with:

./configure --with-ssl=/opt/openssl

there is no error - problem solved.

I am not clear what the make test errors refer to - if anyone can shine light on this, I would be grateful.

Thanks to @steeldriver in the comments, and confirmation in practice, I know that httpd-2.4.57 works with openssl-3.0.2 - I am not clear how to go about finding the dependency requirements of httpd. If someone can point me in the right direction, again, I would be most thankful.

3
  • Dumb question, but should --with-openssl be pointing at /opt/openssl instead of /opt/openssl/bin? Commented Apr 2, 2024 at 20:21
  • The symbols mentioned all appear to be present in openssl 3.0.2, and httpd-2.4.57 builds on Ubuntu 22.04 with the default libssl-dev 3.0.2-0ubuntu1.15 Commented Apr 2, 2024 at 20:46
  • Thanks @larsks and @steeldriver - I tried configuring with /opt/openssl without luck. With openssl version 3.0.2, the problem is solved. Here, I again configured with /opt/openssl and building is successful. Commented Apr 3, 2024 at 15:09

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.