Maxime Pelletier home

Installing Redmine on Nginx

At work we were looking for something to manage our projects, our bugs and that had a wiki, svn/git integration and some time tracking features. Trac what my first choice, but it needed lots of plugins to have the features we wanted. I then looked at InDefero. This would have been perfect because it’s in php, but the project lacks a lot of features we wanted and just isn’t mature enough yet. Then I remembered Redmine. The only problem is that I had to learn how to install rails, mongrel and how to configure nginx to make it work. It took me hours and that’s why I wanted to blog about it.

The first step is to get Redmine working using WEBrick. I’m using gentoo so installing rails was as simple as running emerge rails:2.1 (i’m using Redmine 0.8 which works only with rails 2.1.x). Then I followed the steps on the install wiki of redmine at http://www.redmine.org/wiki/redmine/RedmineInstall. One step I forgot at the beginning was making sure that my database is really set to UTF-8. Redmine seemed to work in ISO-8859-1, but I couldn’t import the data from our old Mantis installation until I set everything to UTF-8. After all this, Redmine worked perfectly at http://localhost:3000.

Next is configuring mongrel and nginx. I’m sure setting up mongrel is different on every distro, but here are the commands I did on Gentoo :

- emerge mongrel_cluster
- mkdir /etc/mongrel_cluster
- ln -s /server/root/redmine/config/mongrel_cluster.yml /etc/mongrel_cluster/redmine.yml
- cp /usr/lib/ruby/gems/1.8/gems/mongrel_cluster-1.0.5/resources/mongrel_cluster /etc/init.d
- chmod +x /etc/init.d/mongrel_cluster
- modified /etc/mongrel_cluster/redmine.yml

Then, the hard part : configuring nginx. This took me hours to figure out. The problem is that redmine doesn’t like to be in a subdirectory. For exemple, http://trima.ca/redmine won’t work. What I learned just before writing this is that theres solutions around this problem :