Passenger Phusion/mod_rails and Server-Status

Man. What a waste of 2 hours.

Server Status and Server Info are two pretty useful Apache modules you can use to debug performance & configuration issues on your Apache server. You can easily enable them with the command

a2enmod status
a2enmod info
Don’t forget to edit the relevant conf files (which are in etc/apache2/mods-available/status.conf and info.conf on my Debian server running Apache2) to allow access from the appropriate domains.

The problem I had was running it with Passenger Phusion aka mod_rails aka mod_passenger. Mod_rails intercepts requests which speeds up your Ruby on Rails apps but interferes with stuff like mod_info and mod_status.

So I RTFMd and Googled like crazy but couldn’t find how to make it work. I did all kinds of stuff with mod_rewrite and RailsAllowModRewrite but nothing would make server-status work. Server-info worked fine but server-status didn’t unless I disabled mod_passenger.

The answer is pretty dumb: it’s down to the alphabetical sort order of the module names in /etc/apache2/mods-enabled:

info
passenger
status
So I renamed passenger to zpassenger:

info
status
zpassenger
And it just worked fine…. didn’t even need RailsAllowModRewrite… doh!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s