Censorship banner.png

Help:Redmine

From Wiki - Hipatia
Jump to: navigation, search
The help pages are provided by Hipatia volunteers to help wiki contributors.
Help index: Mediawiki Server configuration LaTeX Streaming Templates

Search for help:


This document covers the installation of Redmine in a sub URI of a Debian GNU/Linux "Lenny" system (currently oldstable).

Preparing the system

Redmine requires the following dependencies, in addition to a running web server:

ruby rake rubygems libapache2-mod-passenger

plus the proper drivers for your database:

libpgsql-ruby for PostgreSQL
libmysql-ruby
libsqlite3-ruby

Unfortunately Debian Lenny doesn't provide all the required packages. If you can't upgrade at least to Squeeze, all you have to do is to enable the Debian backports repository. First, edit /etc/apt/sources.list and add the following line:

deb http://backports.debian.org/debian-backports lenny-backports main

then, you should set proper pin priority in /etc/apt/preferences

Package: *
Pin: release a=lenny-backports
Pin-Priority: 200

this setting is recommended by the Debian backports maintainers, in order to get security updates.

To improve performance you should install the Ruby C bindings:

gem install mysql

Installing Redmine

To install redmine you just have to apt-get it:

apt-get install redmine

then it's time to create an empty database:

create database redmine character set utf8;
create user 'redmine'@'localhost' identified by 'my_password';
grant all privileges on redmine.* to 'redmine'@'localhost';

Copy config/database.yml.example to config/database.yml and configure your database settings.

Generate a session store secret.

rake generate_session_store

Create the database structure, by running the following command under the application root directory:

RAILS_ENV=production rake db:migrate

If you want to set default configuration data in the database, do:

RAILS_ENV=production rake redmine:load_default_data

Now we have to set up permission for the user who accesses redmine (www-data). The user must have write permission in the directories files, log and tmp.

mkdir tmp public/plugin_assets
chown -R www-data:www-data files log tmp public/plugin_assets
chmod -R 755 files log tmp public/plugin_assets

Finally we have to test the installation by running:

ruby script/server webrick -e production

After webrick has started, just go to localhost:3000 with your browser and you should see the welcome page of redmine.

Basic Apache configuration

Before using redmine, we need to set up our webserver. First we have to create a symlink to our redmine source code:

 ln -s /usr/share/redmine/public /var/www/redmine

Then configure Apache passenger; add the line below to /etc/apache2/mods-available/passenger.conf:

PassengerDefaultUser www-data

Now add the following directive to you apache website configuration:

 <Directory /var/www/redmine>
       RailsBaseURI /redmine
       PassengerResolveSymlinksInDocumentRoot on
   </Directory>

load the passenger module:

a2enmod passenger

and then restart apache:

/etc/init.d/apache2 restart

Additional server tuning

The redmine installation assumes that you are installing the software in the top directory of your domain (i.e. redmine.hipatia.net/). If you want to install it in a sub URI (i.e. hipatia.net/redmine), you need to tweak things a bit.

There are many ways to do this:

Using Redmine::Utils

Add the following line at the bottom of your config/environment.rb

Redmine::Utils::relative_url_root = "/redmine" 
Using Rails features

Add the following line at the end of your config/environment.rb :

ActionController::AbstractRequest.relative_url_root = "/redmine" 

Rails will then prefix all links with "/redmine". It can be considered as the simplest, cleanest and most flexible solution. Then restart your application. In more recent versions of Rails the class hierarchy has changed slightly and you will need to use

ActionController::Base.relative_url_root = "/redmine" 

for the class name.

With a reverse proxy

If you have apache with mod_proxy enabled you can configure a proxy directive to listen to a redmine on its port (usually 3000)

ProxyPass /redmine http://redmine.localdomain:3000/
ProxyPassReverse /redmine http://redmine.localdomain:3000/

Email configuration

Subversion integration

To integrate subversion with redmine we are using apache with mod_dav_svn

Backupping