How to install Redmine?
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:
yum -y groupinstall "Web Server" "Ruby" 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
gem update --system
Setup Thin
gem install rack rmagick thin thin install
Configure Thin for your server
chkconfig --add thin chkconfig --level 345 thin on
Configuring Apache as a load balancer 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:
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:
thin config -C /etc/thin/myredmineapp.yml -c /var/redmine --servers 3 -e production
Adding an Apache 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):
touch /etc/httpd/conf.d/redmine
- Open the file to add content.
vim /etc/httpd/conf.d/redmine
- Add the virtual host configuration to 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/
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 the editor.
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/).
tar -xvf redmine-*.tar -C /var/ mv /var/redmine-* /var/redmine/
- Set permission to read and execute to the public directory.
chmod -R a+rx /var/redmine/public/ cd /var/redmine/ chmod -R 755 files log tmp public/plugin_assets
Database Configuration
- Create the database configuration file.
cd /var/redmine/config/ cp database.yml-example 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:
vim /var/redmine/config/database.yml
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.
service httpd start service mysqld start service thin start
- Create the database and user for Redmine.
mysql -u root -p
When asked, provide the password for the MySQL's root user.
create database redmine default character set utf8; grant all on redmine.* to redmine@localhost identified by '<redmine_mysql_password>'; flush privileges;
- Generate a session store secret.
cd /var/redmine/ RAILS_ENV=production rake config/initializers/session_store.rb
- Run Database object creation script:
cd /var/redmine/ RAILS_ENV=production rake db:migrate
Final Touch
- Restart thin service.
service thin restart
- Set Apache and MySQL to run at startup.
chkconfig mysqld on chkconfig httpd on
Now you can browse you site at either at http://localhost:3000 or at http://redmine.yourdomain.com .
