mod_ssl.so not loading

JammuPapa picture JammuPapa · Aug 10, 2014 · Viewed 17.8k times · Source

I am trying to run Apache with SSL for my website. But when I start the Apache it throws the error saying:

httpd: Syntax error on line 127 of /usr/local/custom/apache/conf/httpd.conf:
  Cannot load modules/mod_ssl.so into server: /usr/local/custom/apache/modules/mod_ssl.so:
  undefined symbol: apr_global_mutex_lockfile

Answer

RvK picture RvK · Dec 16, 2014

I also encountered the same issue. The root cause of the issue is a version mismatch in the apr version

In order to fix it, download the following: apr-util-1.5.4.tar.gz and apr-1.5.1.tar.gz. These can be downloaded at : https://apr.apache.org/download.cgi

Assuming that you have http src untarred in /src/httpd, you untar the apr-1.5.1 and apr-util in the opt/src/httpd/srclib

So the unzipped structure would be opt/src/httpd/srclib/apr and opt/src/httpd/srclib/apr-util

After this is done, you can run the configure with the following command

./configure --prefix=/opt/httpd-2.4.10 --with-included-apr

make

make install

This will install httpd in

/opt/httpd-2.4.10

You can check if the correct version of APR is referenced using the following command

/opt/httpd-2.4.10/bin/httpd -V

You should see output as below.

Server version: Apache/2.4.10 (Unix)
Server built:   Dec 16 2014 11:46:58
Server's Module Magic Number: 20120211:36
Server loaded:  APR 1.5.1, APR-UTIL 1.5.4
Compiled using: APR 1.5.1, APR-UTIL 1.5.4
Architecture:   64-bit
Server MPM:     worker
  threaded:     yes (fixed thread count)
    forked:     yes (variable process count)
Server compiled with....
 -D APR_HAS_SENDFILE
 -D APR_HAS_MMAP
 -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
 -D APR_USE_SYSVSEM_SERIALIZE
 -D APR_USE_PTHREAD_SERIALIZE
 -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
 -D APR_HAS_OTHER_CHILD
 -D AP_HAVE_RELIABLE_PIPED_LOGS
 -D DYNAMIC_MODULE_LIMIT=256
 -D HTTPD_ROOT="/opt/httpd-2.4.10"
 -D SUEXEC_BIN="/opt/httpd-2.4.10/bin/suexec"
 -D DEFAULT_PIDLOG="logs/httpd.pid"
 -D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
 -D DEFAULT_ERRORLOG="logs/error_log"
 -D AP_TYPES_CONFIG_FILE="conf/mime.types"
 -D SERVER_CONFIG_FILE="conf/httpd.conf"