User Tools

Site Tools


project_management:redmine

This is an old revision of the document!


Redmine project management

Redmine is a bug tracking, source code and project management web application. Similar to Trac.

Install dependencies

aptitude

# aptitude install build-essential rake ruby1.8 ruby1.8-dev irb1.8 rdoc1.8 zlib1g-dev libopenssl-ruby1.8 libzlib-ruby libssl-dev rubygems1.8

Download ruby gems

Problems I faced:

  • DNS is screwed up for rubyforge.org and rubygems.org.
  • rubyforge.org has old versions of some gems (rails!)

You SHOULD be able to gem install the modules, but I downloaded them all manually and installed manually. It turns out it was a DNS issue, and I had to add some entries to the machine's /etc/hosts file:

216.137.39.169  production.cf.rubygems.org d2chzxaqi4y7f8.cloudfront.net
72.21.202.165   production.s3.rubygems.org

Don't ask. I guess they are using the "cloud" and Amazon to host the files. I found these IPs from doing DNS queries outside ILRI.

$ wget http://rubygems.org/downloads/rack-1.0.1.gem
$ wget http://rubygems.org/downloads/rails-2.3.5.gem
$ wget http://rubygems.org/downloads/mysql-2.8.1.gem
$ wget http://rubygems.org/downloads/sqlite3-ruby-1.3.0.gem
$ wget http://rubygems.org/downloads/rake-0.8.7.gem
$ wget http://rubygems.org/downloads/fastthread-1.0.7.gem

Install gems

Rake, for building gems:

# gem install rake-0.8.3.gem

Make sure you can execute the rake binary:

# cd /usr/local/bin/
# ln -s /var/lib/gems/1.8/bin/rake

Continue installing gems:

# gem install rack-1.0.1.gem
# gem install fastthread-1.0.7.gem
# gem install mysql-2.8.1.gem
# gem install sqlite3-ruby-1.3.0.gem
# gem install rails-2.3.5.gem

Configure Redmine

Download and unzip the latest stable tarball:

$ wget http://rubyforge.org/frs/download.php/70486/redmine-0.9.4.tar.gz
$ tar zxf redmine-0.9.4.tar.gz

Move redmine

Move redmine somewhere universal, outside of your home folder. We will configure Apache to serve redmine from this location:

$ sudo mv redmine-0.9.4 /opt/
$ cd /opt/redmine-0.9.4

Configure the database

We can either use MySQL or SQLite. SQLite has less overhead, and I'm not sure if it's any slower so we'll use that.

Edit config/database.yml:

 production:
   adapter: sqlite3
   dbfile: db/redmine.db

Initialize the database

$ chmod 600 config/database.yml
$ rake rake generate_session_store
$ RAILS_ENV=production rake db:migrate
$ RAILS_ENV=production rake redmine:load_default_data

Test the server

Before we can use Redmine with Apache, we have to make sure the installation worked fine. Use the built-in webserver to test first:

$ script/server -e production

If you get an error about not finding ruby, make sure the ruby version in the script/server script is correct.

Navigate to http://ip:3000 to see Redmine working. The default username and password are "admin"

Configure Apache

Install Phusion Passenger

Phusion Passenger ("mod_rails") is an Apache module which allows Apache to run ruby code (like mod_perl, mod_php, etc).

Install the gem

# gem install passenger

Install the Apache module

Edit the invocation line of the passenger installer program to point to ruby1.8:

#!/usr/bin/env ruby1.8

Run the installer:

# /var/lib/gems/1.8/gems/passenger-2.2.14/bin/passenger-install-apache2-module

Configure Apache settings

Apache will serve Redmine via FastCGI using the included dispatch.fcgi script. This is much faster than using Webrick or regular CGI.

Configure mod_rail.conf

/etc/apache2/conf.d/mod_rails.conf:

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

Configure redmine.conf

/etc/apache2/conf.d/redmine.conf:

RailsBaseURI /redmine
RailsEnv production

<Directory "/var/www/redmine">
        AllowOverride all
        Options -MultiViews
        #Options Indexes ExecCGI FollowSymLinks
        Order allow,deny
        Allow from all
</Directory>

Link the Redmine installation to the web document root; make sure to use the same name as in your Apache configuration:

# ln -s /opt/redmine-0.9.4/public/ /var/www/redmine

Fix dispatch.fcgi

Rename it and make sure its executable:

$ mv public/dispatch.fcgi.example public/dispatch.fcgi
$ chmod 755 public/dispatch.fcgi

Edit the invocation line in the FastCGI script to make sure it points to your ruby version (ruby1.8), and that the dispatcher line is correct:

#!/usr/bin/env ruby1.8
...
require "/var/lib/gems/1.8/gems/rails-2.3.5/lib/dispatcher.rb"
...

Fix permissions

Change permissions so the web server can read/write important files/folders:

$ chown -R www-data:www-data /opt/redmine-0.9.4

Restart Apache

# apache2ctl graceful

Test the install

Migrate Trac projects

Install sqlite3-ruby

My Trac 11.x databases were in sqlite3 format, so I needed the sqlite3-ruby gem:

# gem install sqlite3-ruby

Migrate project

From the Redmine directory:

# rake redmine:migrate_from_trac RAILS_ENV="production"
(in /opt/redmine-0.9.4)

WARNING: a new project will be added to Redmine during this process.
Are you sure you want to continue ? [y/N] y

Trac directory []: /var/lib/trac/sampler
Trac database adapter (sqlite, sqlite3, mysql, postgresql) [sqlite]: sqlite3
Trac database encoding [UTF-8]: 
Target project identifier []: sampler

Migrating components..
Migrating milestones....
Migrating custom fields
Migrating tickets
Migrating wiki........

Components:      2/2
Milestones:      4/4
Tickets:         0/0
Ticket files:    0/0
Custom values:   0/0
Wiki edits:      8/8
Wiki files:      0/0

Make sure you don't use spaces in the project identifier; this is part of the URL path for the Redmine interface.

Active Directory Authentication

Patch

http://www.redmine.org/issues/4283

# cd /opt/redmine-0.9.4
# patch -p1 < /home/aorth/src/lookup_LDAP_attributes_as_user.patch

Updating Redmine from SVN

See the the official instructions on upgrading via SVN. Also done below on a real instance, 1.0.0 → 1.0.1:

# cd /opt
# tar cjf redmine_before_1.0.1.tar.bz2 redmine/
# cd redmine
# svn update
# rake db:migrate RAILS_ENV=production
# rake db:migrate_plugins RAILS_ENV=production
# rake tmp:cache:clear
# rake tmp:sessions:clear
# apache2ctl graceful
project_management/redmine.1287511046.txt.gz · Last modified: 2010/10/19 17:57 by aorth