Rohit Bhute

messages to nobody

Redmine + Thin + Nginx

Redmine, is by far, the best project management tool I have used. Earlier, I had deployed it using Apache and mod_passenger. This was on Debian 6. It was straight-forward, possible with just apt-get. Now I wanted to deploy it with Nginx, on Ubuntu 12.04.

There are two ways - use Phusion Passenger (similar to Apache’s mod_passenger) with Nginx or use an application server like Mongrel or Thin.

Phusion Passenger requires the user to recompile Nginx, since Nginx doesn’t have loadable modules.

Mongrel was the gold standard for Ruby on Rails deployment until Passenger came along. Development of Mongrel ceased in 2008. Those who still want to use application servers use Unicorn or Thin and put a reverse proxy/load balancer in front.

This is my take-away from four days (I am dumb - sue me!) of googling and reading. My requirements were clear - no compiling, no ruby gems, no installation outside of apt-get. Redmine + Thin met these criteria.

1. Get all the packages.

$ sudo apt-get install redmine redmine-mysql thin

2. dpkg will configure Redmine for us. We also have to configure the email delivery method. Redmine configuration is standard and well documented. We now have to configure Thin. This will create two servers on sequential ports, beginning with 3000.

$ sudo thin config -C /etc/thin1.8/redmine.yml \
    -c /usr/share/redmine/ \
    --servers 2 \
    -e production \
    -a 127.0.0.1 -p 3000

3. This will create the configuration file (redmine.yml) in the correct folder. The file looks like this:

---
timeout: 30
wait: 30
max_persistent_conns: 512
log: log/thin.log
chdir: /usr/share/redmine
servers: 2
require: []

daemonize: true
pid: tmp/pids/thin.pid
address: 127.0.0.1
environment: production
max_conns: 1024
port: 3000

4. Finally, use the Redmine template for Nginx, as explained on the Nginx wiki, to act as a proxy in front of the Thin servers.

Nginx Redmine Thin Ubuntu