Updating redmine and changing from mongrel to passenger

| No Comments | No TrackBacks

The support server at the office has been using redmine for a few years. When I set it up way back in the days it was configured to use a mongrel cluster behind an apache server. This setup has been great, lately it has started to show it's age. Sometimes a mongrel would get stuck, eventually the others would suffer the same fate, and the server wouldn't process anymore requests. So now that the holiday season is in effect I'm taking advantage of the lighter traffic to update the server.

Since this isn't a brand new install I'm taking a different track than most other redmine installs. And I've found upgrading to be more fraught with problems than a clean install. This is a production machine so in addition to normal backups I have to be cautious of breaking shit irreparably.

So let's get to work:
After logging in the update your gems

gem update --system

Depending on the version of redmine you are using you will need to update your rails accordingly.

bash#: rails --version
Rails 2.2.2

According to the redmine News page 0.9 uses Rails 2.3.5 so now is a good time to update the rest of your gems
gems update

Then download the redmine updates
cd /var/redmine/
svn update

In my case I've made some customization to the code and this sometimes conflicts with the update. You can monitor this by looking for 'C' in the left column while svn update is running.

If it isn't done so you should install passenger

gem install passenger

As I mentioned before, redmine was running through a rails mongrel cluster. Now I'm moving it to passenger and apache. After passenger is installed it is time to build it into apache

bash: redmine# passenger-install-apache2-module
Welcome to the Phusion Passenger Apache 2 module insaller, v2.2.8.
This installer will guide you through the entire installation process. It shouldn't take
more than 3 minutes in total.
...

At the end it will ask you to add the module to the apache configuration file. We won't be doing that. Instead we will make a module file and use the a2enmod.

bash:redmine# nano /etc/apache2/mods-available/passenger.load

LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-2.2.8/ext/apache2/mod_passenger.so
PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-2.2.8
PassengerRuby /usr/bin/ruby1.8


Ctrl-O and Ctrl-X to save and quite. Then
bash: redmine# a2enmod passenger
Module passenger installed; run /etc/init.d/apache force-reload to enable.

Finally, update your redmine database:

bash: redmine# RAILS_ENV=production rake db:migrate
bash: redmine# RAILS_ENV=production rake db:migrate_plugins

Modify your vhost.conf file to point the DocumentRoot to the redmine/public folder (mine was just pointing to the redmine root) and then run the apache force-reload command.

If you have anything like webrick or mongrels running it is alright to terminate them now. Point your browser to your redmine site and bask in your awesomeness :-)

No TrackBacks

TrackBack URL: http://www.joechin.com/cgi-bin/movabletype/mt-tb.cgi/87

Leave a comment

About this Entry

This page contains a single entry by Joe Chin published on December 29, 2009 1:34 PM.

Things I've discovered today was the previous entry in this blog.

Happy New Year is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.

Pages

OpenID accepted here Learn more about OpenID
Powered by Movable Type 5.02