Introduction

Redmine is an open source, web-based project management and bug-tracking tool. It includes calendar and gantt charts to aid visual representation of projects and their deadlines. It supports multiple projects. Redmine is a FOSS solution which provides integrated project management features, issue tracking, and support for multiple version control options. Projects investigating commercial tools like IBM Rational Team Concert but wanting to stick with a FOSS solution may find this tool to be a good starting point though without the full depth and breadth of commercial SCRUMM and AGILE tools.

The design of Redmine is significantly influenced by Trac, a software package with some similar features.

Redmine is written using the Ruby on Rails framework. It is cross-platform and cross-database. (Source: Wikipedia)

 

Prerequisites:

  • Ruby

  • Gem

  • Rails

  • Ruby Development Libraries

  • Ruby Sqlite support

  • Thin

  • Apache webserver with proxy modules

  • MySQL

 

To install the prerequisites, you can issue theses following commands at the terminal as a root user:

bash# yum -y groupinstall "Web Server" "Ruby"
bash# yum -y install rubygem-rails rubygem-sqlite3-ruby ruby-devel mysql mysql-libs mysql-server ruby-mysql ImageMagick ImageMagick-devel

 

Obtaining Redmine

Redmine is a free software and you can obtain redmine from this link: http://rubyforge.org/frs/?group_id=1850. Please, select the recent bundle to download.

 

 

Pre-Installation tasks

Updating the gem system

bash# gem update --system

 

Setup Thin

bash# gem install rack rmagick thin
bash# thin install

 

Configure Thin for your server

bash# /sbin/chkconfig --level 345 thin on

 

Configuring Apache as a load balance and proxy

Edit /etc/httpd/conf/httpd.conf file and put these lines if they are already not there:

LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
LoadModule proxy_http_module modules/mod_proxy_http.so
LoadModule proxy_connect_module modules/mod_proxy_connect.so
<IfModule mod_proxy.c>
#turning ProxyRequests on and allowing proxying from all may allow
#spammers to use your proxy to send email.
ProxyRequests On
<Proxy *>
AddDefaultCharset off
Order deny,allow
Allow from 127.0.0.0/255.0.0.0
</Proxy>
# Enable/disable the handling of HTTP/1.1 "Via:" headers.
# ("Full" adds the server version; "Block" removes all outgoing Via: headers)
# Set to one of: Off | On | Full | Block
ProxyVia On
</IfModule>

Configure Thin for your application

Create a thin configuration file for your application:

bash# thin config -C /etc/thin/<config-name>.yml -c <rails-app-root-path> --servers <number-of-threads> -e <environment>

 

Replace <config-name> with the name of the configuration file, <rails-app-root-path> with the path to the root of your application, <number-of-threads> with the number of Thin processes to be started and <environment> with the environment in which to run the code. For example:

 

Since our example setting contains:

<application-name> = myredmineapp
<rails-app-root-path> = /var/redmine
<number-of-threads> = 3
<environment> = production

the following code will set that for us:

bash# thin config -C /etc/thin/myredmineapp.yml -c /var/redmine --servers 3 -e production

 

Adding a virtual host for Redmine

Now you can create a virtual host to host your Redmine application. Add a configuration file in the conf.d directory of your httpd base (i.e. /etc/httpd/conf.d):

bash# touch /etc/httpd/conf.d/redmine

Edit the file

bash# vim /etc/httpd/conf.d/redmine

 

Paste the following content inside the file

<VirtualHost *>
ServerName redmine.yourdomain.com
DocumentRoot /var/redmine
<Proxy balancer://mycluster>
BalancerMember http://127.0.0.1:3000
BalancerMember http://127.0.0.1:3001
BalancerMember http://127.0.0.1:3002
</Proxy>
ProxyPass / balancer://mycluster/
ProxyPassReverse / balancer://mycluster/
# ProxyPass / http://localhost:3000/
# ProxyPassReverse / http://localhost:3000/
ErrorLog /var/log/httpd/error.log
CustomLog /var/log/httpd/access.log vcombined
CustomLog /var/log/httpd/redmine-access.log combined
</VirtualHost>

 

Change “redmine.yourdomain.com” with a virtual host of your setting. Save the file and exit.

 

Redmine Installation

Setting the Redmine Installation Base

  • Move to the directory containing Redmine tarball.

  • Extract the tarball to the parent directory of Redmine installation (i.e. in our case /var/)

bash# tar -xvf redmine-*.tar -C /var/
bash# mv /var/redmine-* /var/redmine/

  • set permission to read and execute to the public directory.

bash# chmod -R a+rx /var/redmine/public/

 

Database Configuration

  • Create the database configuration file

bash# cd /var/redmine/config/
bash# cp database.yml-example cp database.yml

  • Edit the database.yml file and delete all the lines expect for the production section. Tweak the parameters of the production section to fit your settings:

production:
adapter: mysql
database: redmine
host: localhost
username: redmine
password: <redmine_mysql_password>
socket: /var/lib/mysql/mysql.sock

 

Change <redmine_mysql_password> with a valid password string and remember the same password will be used which configuring the database.

 

  • Start services

bash# service httpd start
bash# service mysqld start
bash# /etc/init.d/thin start

 

  • Create the database and user for Redmine

mysql> mysql -u root -p<root_password>
mysql> create database redmine character set utf8;
mysql> create user 'redmine'@'localhost' identified by '<redmine_mysql_password>'
mysql> grant all on redmine.* to 'redmine'@'localhost' identified by '<redmine_mysql_password>'

 

  • Run Database object creation script:

bash# cd /var/redmine/
bash# rake db:migrate RAILS_ENV="production"

 

Final Touch

  • Restart thin service

bash# /etc/init.d/thin restart

 

  • Set apache and MySQL to run at startup

bash# chkconfig mysqld on bash# chkconfig httpd on

 

Now you can browse you site at either at http://localhost:3000 or at http://redmine.youdomain.com.