Anyone who is working in IT company has to have some tool for tracking issues and project management capability. There are many different solutions. Some of them are open source and some are not. In our case we decide that redmine will be enough for our needs. Aim of this content is to show you how easy and without much trouble to install Redmine (this time on Centos6).

Ensure, that you have Epel and RPMForge enabled on your system. Once you are sure that you have enabled those repos, you have to install some packages to start with installation process of Redmine

[root@redmine ~]# yum -y groupinstall "Development Tools"
[root@redmine ~]# yum -y install zlib-devel curl-devel openssl-devel httpd-devel apr-devel apr-util-devel mysql-devel ftp mysql-server ImageMagick-devel

Once you are done with installing necessary packages download and compile ruby. On next link you cn find different versions of ruby ftp://ftp.ruby-lang.org/pub/ruby/ . In this moment newest version is ruby-2.2.3 so I have to download it. Unpack archive and install ruby on next way:

[root@redmine ~]# tar zxvf ruby-2.2.3.tar.gz
[root@redmine ~]# cd ruby-2.2.3/
[root@redmine ruby-2.2.3]# ./configure
[root@redmine ruby-2.2.3]# make
[root@redmine ruby-2.2.3]# make install

After this, you will see that ruby is installed on your system

[root@redmine ruby-2.2.3]# ruby -v
ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-linux]

When you are finished with installation of ruby, you have to install some gem modules.

[root@redmine ~]# gem update --system
[root@redmine ~]# gem install rubygems-update
[root@redmine ~]# update_rubygems
[root@redmine ~]# gem install passenger
[root@redmine ~]# gem install bundler
[root@redmine ~]# gem install mysql2

We need mod_passenger module for Apache. Now is time to install it…

[root@redmine ~]# passenger-install-apache2-module

Follow the instructions in installation process. Once it is installed you have to change /etc/httpd/conf/httpd.conf file. At the end of mentioned file add what you got in previous command.

Now it Is time to download and install Redmine. On this link: http://www.redmine.org/projects/redmine/wiki/Download you can find last version of Redmine. In my case it will be redmine-3.1.1.tar.gz. Download it and unpack archive.

[root@redmine ~]# tar zxvf redmine-3.1.1.tar.gz
[root@redmine ~]# mv redmine-3.1.1/ /opt/redmine

Once you are don with this you have to configure apache for redmine. Here is configuration file /etc/httpd/conf.d/redmine.conf

<VirtualHost *:80>
     ServerAdmin kotahila@gmail.com
     ServerName redmine.setenforce.com
     DocumentRoot /opt/redmine
     PassengerMinInstances 6
     PassengerMaxPoolSize 20
     RailsBaseURI /
     PassengerAppRoot /opt/redmine
     RailsSpawnMethod smart
     PassengerPoolIdleTime 1000
     RailsAppSpawnerIdleTime 3600
     PassengerMaxPreloaderIdleTime 0
     PassengerMaxRequests 5000
     PassengerStatThrottleRate 5
     PassengerUser apache
     PassengerGroup apache
     PassengerPreStart https://localhost
     <Directory /opt/redmine/public/>
         Options +Indexes +FollowSymLinks -MultiViews
         AllowOverride All
         Order allow,deny
         allow from all
     </Directory>
     ErrorLog /opt/redmine/redmine.error.log
     LogLevel warn
     CustomLog /opt/redmine/redmine.access.log combined
     ServerSignature Off
</VirtualHost>

Go to /opt/redmine and run next command:

[root@redmine redmine]# bundle install

Now it is time to configure mysql server. You have to create database and user for redmine project. In our case it was:

mysql> create database redmine;
mysql> use redmine;
mysql> source /var/lib/mysql/redmine.sql redmine.sql is backup of my previous Redmine instance
mysql> create user 'redmine'@'localhost' identified by 'pillow';
mysql> grant all privileges on redmine.* to 'redmine'@'localhost' identified by 'pillow';
mysql> flush privileges;

In this moment I want to mention that I have redmine.sql dump from my previous Redmine instance, so in this case I ‘ve just import it. Go to /opt/redmine/config dir and copy database.yml.example to database.yml. According to database setup database.yml file should have those lines:

production:
   adapter: mysql2
   database: redmine
   host: localhost
   username: redmine
   password: "pillow"
   encoding: utf8

Stay in same directory and generate the secret token

[root@redmine config]# RAILS_ENV=production bundle exec rake generate_secret_token

Than you have to migrate the database models

[root@redmine config]# RAILS_ENV=production bundle exec rake db:migrate

If you are running fresh installation you have to run next to load default data

[root@redmine config]# RAILS_ENV=production bundle exec rake redmine:load_default_data

Just few more things for apache privileges:

[root@redmine config]# cd /opt/redmine/
[root@redmine config]# chown -R apache:apache files log tmp vendor

Restart Apache and go to http://redmine.<YOUR-DOMAIN>.com/ It should work.