Wednesday, October 6, 2010

Redmine, Apache and passenger

We've been running Redmine on Apache2 with mode-passenger for a while. Everything was running smooth until yesterday, when we installed PHP and PostgreSQL on the same server. Redmine started giving Connection refused messages upon installing these. I promptly restarted Apache, to see the following error message:

Invalid command 'RailsEnv', perhaps misspelled or defined by a module not included in the server configuration

Staring at Apache configuration files for half an hour didn't really help, as I hardly know anything about them. I resorted to Google as usual and it took a while to figure out the issue. Apparently, the passenger module somehow got disabled when PHP and PostgreSQL were installed. Thanks to this page in Redmine forums, I was able to fix it by enabling it back. Just in case anyone have the same issue, here's how to do it:

# install passenger (if you don't have it already). I'm sure I already had 
# it installed, but the apt-get downloaded and installed it again. 
# I say do it anyway.

sudo apt-get install libapache2-mod-passenger

#enable passenger explicitly

sudo a2enmod passenger

#restart apache

sudo /etc/init.d/apache2 restart

# Check redmine: 
# Still not working....? I'm sorry, the problem is somewhere else :(