Installing Redmine on cPanel

Installing Redmine on cPanel will be bit harder, because it needs some modifications on server configuration. And custom modifications will be lost on regeneration of configuration files by cPanel. According instruction at http://www.redmine.org/projects/redmine/wiki/HowTo_install_Redmine_on_CentOS_5 you will need change Apache configuration manually. It’s not okay on cPanel. Also it will be conflicts with the Ruby, Rack, RoR versions which comes with cPanel.

Let’s deal with it.

First of all be sure that you have root access to your server, and Ruby on Rails is uninstalled.

Get the rubygems (1.4.2 version):

wget http://production.cf.rubygems.org/rubygems/rubygems-1.4.2.tgz
tar zxvf rubygems-1.4.2.tgz
cd rubygems-1.4.2
ruby setup.rb

Then install passenger:

gem install passenger

Download and extract redmine:

wget http://rubyforge.org/frs/download.php/75518/redmine-1.2.2.tar.gz  # GET LATEST VERSION ON RUBYFORGE
tar zxvf redmine-1.2.2.tar.gz

Install bundler:

gem install bundler

Go to redmine directory and create Gemfile and install bundle:

vi /<redmine_dir>/Gemfile
source "http://rubygems.org" 
gem "rake", "0.8.3" 
gem "rack", "1.1.0" 
gem "i18n", "0.4.2" 
gem "rubytree", "0.5.2", :require => "tree" 
gem "RedCloth", "~>4.2.3", :require => "redcloth" # for CodeRay
gem "mysql" 
gem "coderay", "~>0.9.7" 
bundle install

Create database and user for it, go to redmine directory:

cd config
mv database.yml.example database.yml

Edit database.yml file and write database credentials in production section.

Now edit the config/environment.rb file.

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

Type in the shell:

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

Make sure there were no any error messages.

Go to public/ directory:

cd public/
mv dispatch.cgi.example dispatch.cgi
mv dispatch.fcgi.example dispatch.fcgi
mv dispatch.rb.example dispatch.rb
mv htaccess.fcgi.example .htaccess

Half of the work is done.

Now we must make it available to cPanel. So cPanel uses different version of rack and RoR there will be conflicts.

Install rubyonrails for cPanel.

/scripts/installruby

It will install RoR, RubyGems, Rack etc. which not compatible with redmine. Otherwise you’ll not be able to start ruby application from cPanel. So, create application named redmine and show the path(e.x. /home/redmine/ruby_apps/redmine – but it’s not real redmine directory with you just configured, it’s better show the non-existing directory). Once application is created. You can start it.

Start by clicking Run button on cPanel.

Test it http://yoursite.com:12001. If everything is okay, so we can continue for tricks.

Now stop it.

Go to directory which you created with RoR application on cPanel. Remove all files, copy everything from configured redmine directory. Then go to rubygems directory where you downloaded 1.4.2 version.

ruby setup.rb

Go to redmine directory

gem install passenger
bundle install

Change permissions for redmine directory.

cd ..
chown -R apache:apache redmine_dir
chmod -R 755 redmine_dir

Now go to cPanel, Ruby on Rails section. Run the application. Now it’s ready on http://yoursite.com:12001. You can make it available on port 80 with htaccess.

Enjoy!

Facebook comments:

Leave a Comment


NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">