2

After trying to upgrade apache 2.2.3 to 2.4.7 by compiling 2.4.7 from scratch. Im getting the following error,

[root@test httpd-2.4.7]# /etc/init.d/httpd start
Starting httpd: httpd: Syntax error on line 149 of /etc/httpd/conf/httpd.conf: Cannot load /etc/httpd/modules/mod_auth_basic.so into server: /etc/httpd/modules/mod_auth_basic.so: undefined symbol: ap_expr_str_exec
                                                           [FAILED]

However the file is there,

/etc/httpd/modules/mod_auth_basic.so: ELF 64-bit LSB shared object, AMD x86-64, version 1 (SYSV), not stripped

My original conf for 2.2.3 was in /etc/httpd and the commands I ran to compile were,

cd apr-1.5.0/
./configure --prefix=/usr/local/apr-httpd/
make
make install

cd ../apr-util-1.5.3/
./configure --prefix=/usr/local/apr-util-httpd/ --with-apr=/usr/local/apr-httpd/
make
make install

cd ../pcre-8.32/
./configure --prefix=/usr/local/pcre-8.32
make
make install


cd ../httpd-2.4.7/
./configure --with-apr=/usr/local/apr-httpd/ --with-apr-util=/usr/local/apr-util-httpd/ --with-pcre=/usr/local/pcre-8.32/ --prefix=/etc/httpd
make 
make install

Any Ideas ?

1
  • Are you sure that module is from the 2.4.7 compilation? Commented Dec 27, 2013 at 0:30

1 Answer 1

5

ap_expr_str_exec is an API function that was newly introduced in the Apache httpd 2.4 core. The error is your runtime linker complaining that the mod_auth_basic.so module needs to resolve the ap_expr_str_exec symbol, but that it wasn't found.

You can verify this with the output of the readelf command:

$ readelf -s modules/mod_auth_basic.so
   Num:    Value          Size Type    Bind   Vis      Ndx Name
   ...
     3: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT  UND ap_expr_str_exec
   ...

The UND value for the symbol index means that it is undefined and therefore must be resolved at runtime.

So, since your module is referencing a 2.4 symbol but your running executable doesn't have it, it looks like trying to load an httpd 2.4 module into an httpd 2.2 instance. Make sure you're definitely running the correct httpd binary.

1
  • 2
    FYI, another useful tool to debug these kind of symbol errors is the LD_DEBUG environment variable. Try running the command below, and the runtime linker will dump a ton of debug information about exactly what libraries it's loading and where it's getting (or not getting) its symbols: $ LD_DEBUG=all ./bin/httpd-2.4.7 -f conf/modauthbasic.conf 2>&1 | less
    – voetsjoeba
    Commented Dec 28, 2013 at 7:00

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .