Phusion Passenger on Apache 2.4: ‘undefined symbol: unixd_config’

If you or your company has come across this error while trying to start Apache 2.4 with Passenger, don’t worry there’s an easy fix. Your Passenger module is compiled for the wrong version of Apache, usually 2.2. Apache 2.4 has many changes and unixd_config has been renamed to ap_unixd_config in version 2.4. The fix is to recompile the Passenger module against your correct Apache version.


Verify your APXS2 Environment Variable location
First you need to make sure your APXS2 Environment Variable is pointing to the correct Apache version path.

Usually located at


cd /etc/sbin
ls | less

apxs_f

Verify the apxs location with what’s set as APXS2 in your environment variables.


env

If the path is not correct, update it (only will be for this shell)

Update for your shell session


export APXS2=/location/to/apxs



Next locate where your Apache 2.2 mod_passenger.so module is located.

Usually located at


/usr/lib/ruby/gems/1.x/gems/passenger-4.0.x/buildout/apache2/mod_passenger.so

You can also verify where Apache is loading it from by checking your PuppetMaster Vhost configuration file.

Usually located in Apache’s conf.d directory


vim /etc/httpd/conf.d/puppetmaster.conf

After you have located it, rename your Apache 2.2 mod_passenger.so module to something else. You don’t want it to get overwritten in case you still want to use Passenger with your old Apache version.

Rename Apache 2.2 mod_passenger.so


cd /usr/lib/ruby/gems/1.x/gems/passenger-4.0.x/buildout/apache2
mv ./mod_passenger.so ./mod_passenger_httpd22.so



Now all that’s left is recompiling mod_passenger.so against Apache.2.4.

Recompile Passenger


passenger-install-apache2-module

passenger-install_f

Now follow the directions for the recompile.

After the recompile, verify the LoadModule path is correct in your PuppetMaster.conf VHost config file.

If it is, just start Apache and you should be good to go.

Have fun! 🙂