Solaris 10, When trying to run apache: ld.so.1: httpd: fatal relocation error

apache-http-serversolaris

I'm trying to replicate a production box in my lab, I have installed apache and I'm trying to use the configuration copied from the production environment, the results are the following error appearing:

[root@hnm]/usr/local/apache2/bin$./apachectl -k start -f /usr/local/apache2/conf/hdm
/httpd.conf
httpd: Syntax error on line 939 of /usr/local/apache2/conf/hdm/httpd.conf: Syntax error on
line 29 of /usr/local/apache2/conf/hdm/modules.conf: Cannot load /usr/local/apache2/modules
/mod_cwmp_22.so into server: ld.so.1: httpd: fatal: relocation error: file /usr/local/apache2
/modules/mod_cwmp_22.so: symbol curl_easy_init: referenced symbol not found

Best Answer

Lets break down your error message:

Cannot load /usr/local/apache2/modules /mod_cwmp_22.so into server:

Well, obvious.

ld.so.1: httpd: fatal: relocation error:

ld.so.1 is the runtime dynamic loader. When you start an app that is dynamically linked (and on Solaris EVERYthing is dynamically linked) the dynamic loader needs to bring in all the libraries. It also needs to ensure not only does it have all the files, but that it links up all the references, both code and data.

file /usr/local/apache2 /modules/mod_cwmp_22.so: symbol curl_easy_init: referenced symbol not found

Now, here we go. The dynamic loader brought in the cwmp module, which depends on curl (libcurl). It seems to have found libcurl.so (or else you would have seen a different error) but it can not find the specific symbol. That is: it knows the cwmp module needs the function call curl_easy_init, but it can not find it.

My guess, is you have a libcurl version mismatch. The webserver module was built against one version of libcurl, but now you're trying to run against a different version on your dev box.

Id check for versions of libcurl. maybe do a strings -a on libcurl on both dev and prod, make sure they match up. There are other tools like readelf that you can use to verify these, but my big guess is that you can copy the libcurl from prod and place it somewhere in dev where you can see it.

Related Question