VPS Linux Guides - CentOS

Installing and configuring Redmine on CentOS


CentOS 6 Redmine Setup


  • SSH access to a minimum installed CentOS 6.* server

Server Prep

Install packages:

yum install git vim gcc gcc-c++ make zlib-devel zlib openssh openssh-devel ImageMagick ImageMagick-devel  curl curl-devel httpd httpd-devel apr-devel apr apr-util-devel mysql-devel mysql-server

Add a new system user for the application to run under:

useradd redmine
passwd redmine
su redmine -l

Ruby Prep

Install rbenv

git clone git://github.com/sstephenson/rbenv.git .rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile
echo 'eval "$(rbenv init -)"' >> ~/.bash_profile
git clone git://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
source ~/.bash_profile

Install lastest supported version of Ruby through rbenv:

rbenv install 2.1.0-rc1
rbenv local 2.1.0-rc1
rbenv global 2.1.0-rc1
rbenv rehash

Update all Gems and install bundler, passenger, mysql

gem update
gem update --system
gem install bundler
gem install passenger
gem install mysql2
rbenv rehash

Redmine Installation

Install source code

Clone Git Repository
git clone https://github.com/redmine/redmine.git
cd redmine

Install all app gems locally to the app using bundler

bundle install --without development test --path vendor

MySQL and DB initilise

cp config/database.yml.example config/database.yml
cp configuration.yml.example configuration.yml
cp additional_environment.rb.example additional_environment.rb
service mysqld start
mysql -u root
create database redmine;
RAILS_ENV=production bundle exec rake db:migrate
RAILS_ENV=production bundle exec rake generate_secret_token
RAILS_ENV=production bundle exec rake redmine:load_default_data

App assets install

mkdir -p tmp tmp/pdf public/plugin_assets
sudo chown -R redmine:redmine files log tmp public/plugin_assets
sudo chmod -R 755 files log tmp public/plugin_assets

Passenger With Apache Proxy

sudo chmod o+x "/home/redmine"
   LoadModule passenger_module /home/redmine/.rbenv/versions/2.1.0-rc1/lib/ruby/gems/2.1.0/gems/passenger-4.0.37/buildout/apache2/mod_passenger.so
   <IfModule mod_passenger.c>
     PassengerRoot /home/redmine/.rbenv/versions/2.1.0-rc1/lib/ruby/gems/2.1.0/gems/passenger-4.0.37
     PassengerDefaultRuby /home/redmine/.rbenv/versions/2.1.0-rc1/bin/ruby
<VirtualHost *:80>
    ServerName www.yourhost.com
    # !!! Be sure to point DocumentRoot to 'public'!
    DocumentRoot /somewhere/public    
    <Directory /somewhere/public>
        # This relaxes Apache security settings.
        AllowOverride all
        # MultiViews must be turned off.
        Options -MultiViews