From SME Server
Jump to: navigation, search

Redmine is a flexible project management web application. Written using the Ruby on Rails framework, it is cross-platform and cross-database.

This is a Howto of how I went about getting a basic installation of Redmine going on my SME server. I have now been using it for a number of months and am quite happy with it. As a matter of fact, I converted my existing Trac project environments to Redmine and have been using Redmine exclusively since.


Ruby On Rails

Redmine is a Ruby On Rails application. Install it using the Howto RubyOnRails.

Redmine User

The Redmine webservice needs a user to operate under and it needs an ability to access email for some of its services. The easiest thing to do is to create a new user 'redmine' using your server-manager panel. This users also needs access to a login shell.

Redmine Installation

The installation instructions for redmine are listed at

I chose the checkout option and installed from a shell as follows:

Become root:

 su -

Switch to user redmine:

 su - redmine
 cd /opt
 svn checkout redmine

Create the Redmine database

Again the installation instructions are on I found it easiest to create the database using PHPMyAdmin. The database is a called 'redmine' with an appropriate password and accessible by the user you created above.

Connecting Redmine to the database

To setup Redmine to use the database you just created, goto:

 cd /opt/redmine/config

then copy the database example config file:

 cp config/database.yml.example config/database.yml

and edit new database.yml file to list your database name, username and database password.

Create the database structure

Setup the database as per the installation instructions as:

rake db:migrate RAILS_ENV="production"
rake redmine:load_default_data RAILS_ENV="production"

Start the server

You can now test start your server with the command:

 ruby script/server -e production

and you should be able to browse your Redmine environment on:


Accessing Redmine through your main webserver

To access Redmine through the main webserver, I created the following custom template in

 mkdir -p /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf
 cd /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf
 vim 95redmine
  # Redmine proxy to connect to mongrel process on port 2555

  ProxyPass        /redmine http://localhost:2555
  ProxyPassReverse /redmine http://localhost:2555

  <Location /redmine>
    Order Deny,Allow
    Deny from All
    Allow from

Expand the template and restart the http server:

expand-template /etc/httpd/conf/httpd.conf
/etc/rc.d/init.d/httpd-e-smith restart

Now Redmine can be accessed through http://servername/redmine

As you can see from the above, I only allowed access from the local network.

Then Redmine itself needs to be reconfigured as follows to allow this path prefix for the application:

 su - redmine
 cd  /opt/redmine/config
 vim environment.rb

And as the last line in the file add:

ActionController::AbstractRequest.relative_url_root = "/redmine"

Note that the port number used for the Redmine proxy above (2555) is configured in the start/stop script below.

Starting and stopping the Redmine server

In /etc/init.d, create the following script 'redmine':

#!/usr/bin/env ruby

require "fileutils"
include FileUtils

require "rubygems"

  gem 'mongrel'
rescue => e
  puts "Error: daemon mode of redmine requires mongrel installed"
  exit 1

def redmine_path

def redmine_user

command = ARGV.shift

case command
when 'start'
  system "su - #{redmine_user} -c 'cd #{redmine_path}; mongrel_rails start -d -e production -p 2555'"
  exit 0
when 'stop'
  system "cd #{redmine_path}; mongrel_rails stop"
  system "rm -f #{redmine_path}/log/"

  exit 0
  p "Usage: /etc/init.d/redmine start|stop"
  exit 1

Then create the links to start and stop automatically:

 cd /etc/rc7.d
 ln -s ../init.d/redmine S99redmine 
 TODO: the link to stop the server at shutdown

Upgrading Redmine

If you used the checkout method of installing, you can upgrade your Redmine installation with the following commands:

As root:

 su -
 /etc/init.d/redmine stop
 su - redmine

As redmine:

 cd /opt/redmine
 svn update
 rake db:migrate RAILS_ENV="production"

As root:

 /etc/init.d/redmine start

Importing Trac into Redmine

I has some success in importing existing Trac environments into Redmine as per the instructions on

The biggest trouble in that process was getting hold of the right sqlite-ruby library for the migration script to access the Trac database (unfortunately I don't remember how I fixed that).

Additional information

More information about Redmine can be found on

More information on the SME Subversion Web Panel can be found in

Personal tools
Koozali SME Server wiki