Install redmine in RHEL6 and RH based distributions


Step 1: Install packages needed
yum install mysql-server ruby rubygems httpd ruby-devel mysql-devel gcc-c++ curl-devel httpd-devel apr-devel apr-util-devel

Step 2: Enable services at boot-time
apache server
chkconfig httpd on

mysql server
chkconfig mysqld on

Step 3: Open needed ports

open /etc/sysconfig/iptables in your config file and add these rules

-A INPUT -m state –state NEW -m tcp -p tcp –dport 80 -j ACCEPT

-A INPUT -m state –state NEW -m tcp -p tcp –dport 3000 -j ACCEPT

Step 4: Install ruby libs
gem install rails -v=2.3.5
gem install rack -v=1.0.1
gem install mysql
gem install -v=0.4.2 i18n
gem install passenger

Step 5: Download redmine

step 6: add redmine user

groupadd redmine
useradd -g redmine redmine
passwd redmine

step 7: decompress redmine
tar -xzvf redmine-1.1.2.tar.gz

step 8: move to destination dir
cd <dest_dir>

step 9: copy redmine
cp -R <redmine_uncompress_dir>/* ./

Step 10: create a new database and a new username in mysql

step 11: configure redmine
cd config/
mv database.yml.example database.yml
open database.yml #complete the data needed
cd ..

step 12: generate session store secret
rake generate_session_store

step 13: generate database structure
RAILS_ENV=production rake db:migrate

step 14: generate default configuration
RAILS_ENV=production rake redmine:load_default_data

step 15 Setting up permissions
mkdir tmp public/plugin_assets #in case of the dirs doesn’t exists
sudo chown -R redmine:redmine files log tmp public/plugin_assets # change redmine:redmine if you create a diferent user
sudo chmod -R 755 files log tmp public/plugin_assets

step 16 check redmine installation
ruby script/server webrick -e production
open in your browser :3000
login is admin pass is admin too

step 17 enable mod_cgi in apache
check in /etc/httpd/conf/httpd.conf if exist the line
LoadModule cgi_module modules/

step 18 create public/dispatch.cgi file
mv public/dispatch.cgi.example public/dispatch.cgi
edit the first line
#!/usr/bin/env ruby

step 19 grant execution rights
chmod 755 public/dispatch.cgi

step 20 grant apache permissions
chown -R apache:apache files log tmp vendor

step 21 set production state in file config/environment.rb
uncoment the line ENV[‘RAILS_ENV’] ||= ‘production’

step 22 configure passenger
passenger-install-apache2-module and follow instructions

if you get an error check this
In fact, just need to edit the ” /usr/lib/ruby/gems/1.8/gems/passenger-3.0.6/lib/phusion_passenger/platform_info/apache.rb” file, and replace “test_exe_outdir” with “tmpexedir”.

step 23 Enable cgi in SeLinux
setsebool -P httpd_enable_cgi 1

step 24 add virtual host in apache config file
DocumentRoot /live/redmine/public/
ErrorLog logs/redmine_error_log
Options Indexes ExecCGI FollowSymLinks
Order allow,deny
Allow from all
AllowOverride all

Step 25: close 3000 port editing /etc/sysconfig/iptables file

-A INPUT -m state –state NEW -m tcp -p tcp –dport 3000 -j ACCEPT

Step 26: reboot or restart services

Redmine Working

13 Replies to “Install redmine in RHEL6 and RH based distributions”

  1. Thanks for your manual, all allwright but,
    Step 24 is like this, no?

    DocumentRoot /opt/redmine/public/
    ErrorLog logs/redmine_error_log
    Options Indexes ExecCGI FollowSymLinks

    Order allow,deny
    Allow from all
    AllowOverride all

    What about https redirection between apache and redmine?

    1. when I created this tutorial I was installing redmine as internal service in a SME, https not was in my priority list.
      If I have some spare time I will add it.
      Anyway if you configure https in your host feel free to collaborate.

  2. And step 25: “”close 3000 port editing /etc/sysconfig/iptables file”:

    -A INPUT -m state –state NEW -m tcp -p tcp –dport 3000 -j ACCEPT

    iptables line accepts all to port 3000:

    -A INPUT -m state –state NEW -m tcp -p tcp –dport 3000 -j DROP

  3. Ok for rmagic compiling last source package.

    For https, I selected a redirection between apache https to redmine http in localhost using mod_rewrite to fore https conection.


  4. Excellent tutorial.
    I had to change the ownership of the config/environment.rb to the “redmine” user at the end as passenger changes it. Otherwise you may get directory write permission errors.

  5. I installed it on internal server where the redmine server will be accessed with IP address. added the virtual host like this:

    ServerName myprojects
    DocumentRoot /var/www/project/public/
    ErrorLog logs/redmine_error_log

    Options Indexes ExecCGI FollowSymLinks
    Order allow,deny
    Allow from all
    AllowOverride all

    but apache giving error:

    service httpd restart
    Stopping httpd: [ OK ]
    Starting httpd: Warning: DocumentRoot [/var/www/project/public/] does not exist
    [ OK ]

    any idea. I did a search, but couldn’t find any solution.

    By the way, your turorial is very helpful.. Thank you..

    1. permissions problem, can apache user (can be www-data, nobody, www or other) access to /var/www/project/public/

  6. I tried to install this on Centos 6.4 and get stuck at the rake generate_sessions_store

    i get an error related to rake\rdoctask I found something that talks about changing rake\rdoctask to rdoc\task but that jsut caused new issues.. what would I do to get this to work? ever tried it on centos 6.4 .. I think some of hte packages have updated to the point that they no longer work with this tutorial. maybe?

Leave a Reply to Luzem Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.