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
gems update
cd /var/redmine/
svn update
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.loadLoadModule 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
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 :-)
Posted by yardie at December 29, 2009 1:34 PM | TrackBack