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

  • Install packages
    yum install ruby-devel gcc-c++ openssl-devel httpd httpd-devel mysql-server  mysql-devel make ruby-rdoc libcurl-devel rubygem-rake ImageMagick ImageMagick-devel wget
  • Rubygems
    cd /tmp
    wget http://production.cf.rubygems.org/rubygems/rubygems-1.8.24.tgz
    tar xvfz rubygems-1.8.24.tgz
    cd rubygems-1.8.24
    ruby setup.rb
  • Passenger
    gem install passenger
    passenger-install-apache2-module


  • Load the passenger apache module. Add the following config in /etc/httpd/conf/httpd.conf
    LoadModule passenger_module /usr/lib64/ruby/gems/1.8/gems/passenger-3.0.12/ext/apache2/mod_passenger.so
    PassengerRoot /usr/lib64/ruby/gems/1.8/gems/passenger-3.0.12
    PassengerRuby /usr/bin/ruby
  • Setup apache vhost
    cat <<'EOF' > /etc/httpd/conf.d/redmine.conf
    Header always unset "X-Powered-By"
    Header always unset "X-Rack-Cache"
    Header always unset "X-Content-Digest"
    Header always unset "X-Runtime"
    
    PassengerMaxPoolSize 20
    PassengerMaxInstancesPerApp 4
    PassengerPoolIdleTime 3600
    PassengerUseGlobalQueue on
    PassengerHighPerformance on
    PassengerStatThrottleRate 10
    RailsSpawnMethod smart
    RailsAppSpawnerIdleTime 86400
    RailsFrameworkSpawnerIdleTime 0
    
    <VirtualHost *:80>
     ServerName redmine.local
     DocumentRoot /var/www/redmine/public/
     
     <Directory "/var/www/redmine/public/">
      Options Indexes ExecCGI FollowSymLinks
      AllowOverride all
      Order allow,deny
      Allow from all
     </Directory>
    </VirtualHost>
    EOF
    Note that redmine.local is a local domain and is a manual entry in my workstation's /etc/hosts file. This is done for testing purposes only. For production systems, this may very well be a subdomain under you company's domain name e.g. redmine.acme.com
  • Download and extract redmine
    cd /tmp
    wget http://rubyforge.org/frs/download.php/76134/redmine-2.0.0.tar.gz
    tar xvfz redmine-2.0.0.tar.gz
    mkdir /var/www/redmine
    cp -a redmine-2.0.0/* /var/www/redmine
    chown -R apache.apache /var/www/redmine && chmod -R 755 /var/www/redmine
     
    touch /var/www/redmine/log/production.log
    chown root.apache /var/www/redmine/log/production.log
    chmod 664 /var/www/redmine/log/production.log
  • Bundle
    gem install bundler
    cd /var/www/redmine/
    bundle install --without development test postgresql sqlite
  • Setup MySQL DB
    service mysqld start
    chkconfig mysqld on
    /usr/bin/mysql_secure_installation
    mysql -uroot -p -e 'create database redmine character set utf8; grant all on redmine.* to [email protected] identified by "my_passwd";flush privileges';
  • Setup redmine database connection
    mv /var/www/redmine/config/database.yml.example /var/www/redmine/config/database.yml
    vi /var/www/redmine/config/database.yml
     
    # In the production section, update username, password and other parameters accordingly like so:
     
    production:
      adapter: mysql
      database: redmine
      host: localhost
      username: redmine
      password: my_passwd
      encoding: utf8
  • Generate token key for connections
    rake generate_secret_token
  • Migrate database models
    RAILS_ENV=production rake db:migrate
  • Load MySQL database schema and default data
    RAILS_ENV=production rake redmine:load_default_data
  • Fix plugin directory permissions
    cd /var/www/redmine
    mkdir public/plugin_assets
    chown -R apache:apache files log tmp public/plugin_assets
    chmod -R 755 files log tmp public/plugin_assets
  • and finally, start Apache
    service httpd start
    chkconfig httpd on 
  • You may now open and point your browser to http://redmine.local and login as admin/admin