1

We run Apache HTTPD as a production load balancer using mod_ssl with OpenSSL. I'm trying to recompile Apache HTTPD on the latest version (2.4.41) and am encountering the following error when running make. I'll include the error, but if more of the stack trace would be helpful then I'm happy to post.

Note that OpenSSL is currently on version 1.1.1c, and I'm encountering the same issue when trying to build Apache HTTPD versions 2.4.38 and 2.4.39.

Originally I thought this was a compatibility issue between OpenSSL and Apache based on posts elsewhere, but I cannot reproduce the error on a fresh VM - it all compiles without issue. So it must be something environmental that's broken.

/etc/puppetlabs/tmp/httpd/httpd-2.4.41/srclib/apr/libtool --silent --mode=compile gcc -std=gnu99   -g -O2 -pthread      -DLINUX -D_REENTRANT -D_GNU_SOURCE   \
      -I. -I/etc/puppetlabs/tmp/httpd/httpd-2.4.41/os/unix -I/etc/puppetlabs/tmp/httpd/httpd-2.4.41/include -I/etc/puppetlabs/tmp/httpd/httpd-2.4.41/srclib/apr/include -I/etc/puppetlabs/tmp/httpd/httpd-2.4.41/srclib/apr-util/include -I/etc/puppetlabs/tmp/httpd/httpd-2.4.41/modules/aaa -I/etc/puppetlabs/tmp/httpd/httpd-2.4.41/modules/cache -I/etc/puppetlabs/tmp/httpd/httpd-2.4.41/modules/core -I/etc/puppetlabs/tmp/httpd/httpd-2.4.41/modules/database -I/etc/puppetlabs/tmp/httpd/httpd-2.4.41/modules/filters -I/etc/puppetlabs/tmp/httpd/httpd-2.4.41/modules/ldap -I/etc/puppetlabs/tmp/httpd/httpd-2.4.41/modules/loggers -I/etc/puppetlabs/tmp/httpd/httpd-2.4.41/modules/lua -I/etc/puppetlabs/tmp/httpd/httpd-2.4.41/modules/proxy -I/etc/puppetlabs/tmp/httpd/httpd-2.4.41/modules/http2 -I/etc/puppetlabs/tmp/httpd/httpd-2.4.41/modules/session -I/etc/puppetlabs/tmp/httpd/httpd-2.4.41/modules/ssl -I/etc/puppetlabs/tmp/httpd/httpd-2.4.41/modules/test -I/etc/puppetlabs/tmp/httpd/httpd-2.4.41/server -I/etc/puppetlabs/tmp/httpd/httpd-2.4.41/modules/md -I/etc/puppetlabs/tmp/httpd/httpd-2.4.41/modules/arch/unix -I/etc/puppetlabs/tmp/httpd/httpd-2.4.41/modules/dav/main -I/etc/puppetlabs/tmp/httpd/httpd-2.4.41/modules/generators -I/etc/puppetlabs/tmp/httpd/httpd-2.4.41/modules/mappers  -prefer-non-pic -static -c ab.c && touch ab.lo
/etc/puppetlabs/tmp/httpd/httpd-2.4.41/srclib/apr/libtool --silent --mode=link gcc -std=gnu99  -g -O2 -pthread    \
         -o ab  ab.lo       /etc/puppetlabs/tmp/httpd/httpd-2.4.41/srclib/apr-util/libaprutil-1.la -lexpat /etc/puppetlabs/tmp/httpd/httpd-2.4.41/srclib/apr/libapr-1.la -lrt -lcrypt -lpthread -ldl -lm -lssl -lcrypto -lrt -lcrypt -lpthread -ldl
ab.o: In function `ssl_state_cb':
/etc/puppetlabs/tmp/httpd/httpd-2.4.41/support/ab.c:575: undefined reference to `SSL_in_init'
ab.o: In function `ssl_print_cert_info':
/etc/puppetlabs/tmp/httpd/httpd-2.4.41/support/ab.c:653: undefined reference to `X509_get_version'
/etc/puppetlabs/tmp/httpd/httpd-2.4.41/support/ab.c:655: undefined reference to `X509_getm_notBefore'
/etc/puppetlabs/tmp/httpd/httpd-2.4.41/support/ab.c:659: undefined reference to `X509_getm_notAfter'
ab.o: In function `sk_X509_num':
/usr/local/include/openssl/x509.h:99: undefined reference to `OPENSSL_sk_num'
ab.o: In function `sk_X509_value':
/usr/local/include/openssl/x509.h:99: undefined reference to `OPENSSL_sk_value'
ab.o: In function `main':
/etc/puppetlabs/tmp/httpd/httpd-2.4.41/support/ab.c:2305: undefined reference to `TLS_client_method'
/etc/puppetlabs/tmp/httpd/httpd-2.4.41/support/ab.c:2560: undefined reference to `TLS_client_method'
/etc/puppetlabs/tmp/httpd/httpd-2.4.41/support/ab.c:2637: undefined reference to `OPENSSL_init_ssl'
/etc/puppetlabs/tmp/httpd/httpd-2.4.41/support/ab.c:2638: undefined reference to `OPENSSL_init_ssl'
/etc/puppetlabs/tmp/httpd/httpd-2.4.41/support/ab.c:2647: undefined reference to `SSL_CTX_set_options'
ab.o: In function `test':
/etc/puppetlabs/tmp/httpd/httpd-2.4.41/support/ab.c:1990: undefined reference to `SSL_in_init'
collect2: error: ld returned 1 exit status
make[2]: *** [ab] Error 1
make[2]: Leaving directory `/etc/puppetlabs/tmp/httpd/httpd-2.4.41/support'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/etc/puppetlabs/tmp/httpd/httpd-2.4.41/support'
make: *** [all-recursive] Error 1

Note that the 'puppetlabs' directory is purely because we have Puppet handle the compilation, though all it does is run configure, make and make install as usual.

DGoodman
  • 33
  • 1
  • 5

1 Answers1

1

This looks like the openssl header files can be found for configure and compile but not the biggest nary/compiled libraries at like link time.
Possibly You possible pointet to the headers of openssl and configure or make was able to detect them in that non default location, but You never compiled binaries or do not have them in a path the linker is going through by default. So Your full configure and if applicable installation commands can be helpful to give You complete answer in addition to configure and make commands and output used to compile the openssl belonging to the header files in /usr/local/include/openssl.

You probably need to specify the Openssl Libdir in configure (using LDFLAGS env var for example) if You want to include libraries installed in non default path at link time.

EOhm
  • 795
  • 2
  • 7