How to Install & Configure Redmine on RHEL/Centos 6x


Install & Configure Redmine on RHEL/Centos 6x

What is Redmine ?

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

Features :

1. Multiple projects support
2. Flexible role based access control
3. Flexible issue tracking system etc.

Step: 1. Stop Iptables :

# service iptables stop
# chkconfig iptables off

Step: 2. Disable Selinux :

# vi /etc/sysconfig/selinux

SELINUX=disabled

-- Save & Quit (:wq)

Step: 3. Restart the Server :

# init 6

Step: 4. Install Prerequisites :

# yum install -y ruby-devel gcc-c++ openssl-devel httpd httpd-devel make ruby-rdoc libcurl-devel rubygem-rake zlib-devel curl-devel apr-devel apr-util-devel wget

Step: 5. Install Ruby :

# cd /tmp
# wget http://cache.ruby-lang.org/pub/ruby/2.1/ruby-2.1.2.tar.gz
# tar -zxvf ruby-2.1.2.tar.gz
# cd ruby-2.1.2
# ./configure
# make install
# cd ..
# rm -rf ruby-2.1.2.tar.gz ruby-2.1.2

Step: 6. To Check Ruby Version :

# ruby -v

Step: 7. Install Rubygems :

# cd /tmp
# wget http://production.cf.rubygems.org/rubygems/rubygems-2.2.2.tgz
# tar zxvf rubygems-2.2.2.tgz
# cd rubygems-2.2.2
# ruby setup.rb
# cd ..
# rm -rf rubygems-2.2.2.tgz rubygems-2.2.2

Step: 8. To Check Gems Version :

# gem -v

Step: 9. Install Passenger :

# gem install passenger
# passenger-install-apache2-module

Press Enter and press " ! " and make sure you select only the ruby one.

***LOOK CAREFULLY *after successfully installing it give codes .we must edit in our apache. FOR ME .It may be other for you. ==============================================================================================================
LoadModule passenger_module /usr/local/lib/ruby/gems/2.1.0/gems/passenger-4.0.50/buildout/apache2/mod_passenger.so
<IfModule mod_passenger.c>
PassengerRoot /usr/local/lib/ruby/gems/2.1.0/gems/passenger-4.0.50
PassengerDefaultRuby /usr/local/bin/ruby
</IfModule>
==============================================================================================================

Step: 10. To Load the Passenger Module into Apache :

# vi /etc/httpd/conf/httpd.conf

Go, to the load module section and paste it.
Add the below line. In the module section. Line num 202.

LoadModule passenger_module /usr/local/lib/ruby/gems/2.1.0/gems/passenger-4.0.50/buildout/apache2/mod_passenger.so

Add the following line on line number 377.

<IfModule mod_passenger.c>
PassengerRoot /usr/local/lib/ruby/gems/2.1.0/gems/passenger-4.0.50
PassengerDefaultRuby /usr/local/bin/ruby
</IfModule>

-- Save & Quit (:wq)

Step: 11. Now, you can download the latest version of Redmine :

# cd /var/www/html
# wget http://www.redmine.org/releases/redmine-2.5.2.tar.gz
# tar -zxvf redmine-2.5.2.tar.gz
# mv redmine-2.5.2 redmine
# rm -rf redmine-2.5.2.tar.gz
# chown -R apache.apache /var/www/html/redmine
# chmod -R 755 /var/www/html/redmine
# touch /var/www/html/redmine/log/production.log
# chown root.apache /var/www/html/redmine/log/production.log
# chmod 664 /var/www/html/redmine/log/production.log


Step: 12. Start the Apache Server :

# service httpd restart
# chkconfig httpd on

Step: 13. Install Mysql Server :

# yum -y install mysql mysql-server mysql-devel

Step: 14. Start Mysql Service :

# service mysqld restart
# chkconfig mysqld on

Step: 15. Set Mysql Root Password :

# mysql_secure_installation

Step: 16. Create Database for Redmine :

# mysql -u root -predhat

mysql> create database redminedb character set utf8;
mysql> grant all privileges on redminedb.* to redmine@'localhost' identified by 'password';
mysql> grant all privileges on redminedb.* to redmine@'%' identified by 'password';
mysql> flush privileges;
mysql> exit

Step: 17. Now, Install the Gem file and the bundler :

# gem install rake rack i18n rubytree RedCloth mysql coderay rails jquery-rails fastercsv builder mime-types awesome_nested_set activerecord-jdbc-adapter selenium-webdriver shoulda mysql2

# cd /var/www/html/redmine
# gem install bundler
# bundle install --without development test rmagick

Note: If you see any of the gem is not installing then go to.

# cd /var/www/html/redmine
# vi Gemfile

Commented the following line, Line no. 29

# gem "rmagick", ">= 2.0.0"

-- Save & Quit (:wq)

Step: 18. Setup the Database Connection for Redmine :

# cd /var/www/html/redmine/config
# mv database.yml.example database.yml
# vi database.yml

In the production section, update username, password and other parameters accordingly like so :

production:

adapter: mysql2
database: redmine
host: localhost
username: redmine
password: redhat
encoding: utf8

-- Save & Quit (:wq)

Step: 19. Create the Virtual host files for running Redmine :

# vi /etc/httpd/conf.d/redmine.conf

<VirtualHost *:80>
ServerName redmine

DocumentRoot /var/www/html
Alias /redmine /var/www//html/redmine/public

<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/html/redmine>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
<Directory /var/www/html/redmine/public>
PassengerEnabled on
SetHandler none
PassengerAppRoot /var/www/html/redmine
RailsBaseURI /redmine
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
</VirtualHost>

-- Save & Quit (:wq)

Step: 20. Restart Apache Server :

# service httpd restart

Step: 21. Set Environment to "production" Environment :

# cd /var/www/html/redmine/config
# vi environment.rb

If there is line uncomment it if not just proceed ahead.

ENV['RAILS_ENV'] ||= 'production'


Step: 22. In terminal, use following command.

# RAILS_ENV=production bundle exec rake generate_session_store
# RAILS_ENV=production bundle exec rake db:migrate
# RAILS_ENV=production bundle exec rake redmine:load_default_data

Type en when asked.

Step: 23. Rename dispatch CGI files in /redmine/public/ :

# cd /var/www/html/redmine/public
# mv dispatch.fcgi.example dispatch.fcgi
# cp htaccess.fcgi.example .htaccess

Step: 24. Fix rights for the apache user :

# cd /var/www/html
# chown -R apache:apache redmine
# chmod -Rf 777 redmine

Step: 25. Also,for configuration of email :

# cd /var/www/html/redmine/config
# cp configuration.yml.example configuration.yml
# vi configuration.yml

Just close.
You can configured the email as per your need.

Step: 26. Restart the Apache Server :

# service httpd restart

Step: 27. Point Your Web Browser & Type :

http://192.168.20.140/redmine
User: admin
Pass: admin

---- DONE,Thanks ----