Continuing on from our last post Redmine Project Management on Debian Lenny, here we will setup Ruby on Rails (and thus Redmine) to run through Apache2, using Passenger (aka mod_rails).
This is a fairly brief step by step guide and assumes you are familiar with Debian, the command line, and tools like apt-get and ruby gems.
- Install passenger:
sudo gem install passenger
- Setup passenger in Apache. Run this command and follow the instructions:
- When it asks you to edit the Apache config file, do it like so (using the contents given to you by the program):
Create /etc/apache2/mods-available/passenger.load with the contents:
LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-2.2.14/ext/apache2/mod_passenger.so
Create /etc/apache2/mods-available/passenger.conf with the contents:
Enable passenger module:
Note: Make sure you use the values provided by the program and do not simply copy & paste what is here!
- Edit the Virtual host file to something like this:
Note: The document root cannot be a softlink, because the dispatch script of rails will change directory using “../”
- Restart Apache and all should be good:
sudo /etc/init.d/apache2 restart
- Test by going to http://redmine.mydomain.com