Adjective: Comparative form of nerdy: more nerdy.

Installing Redmine on cPanel.

This guide shows how you to install Redmine with RoR on a cPanel server.

Install ruby using the cPanel installer.


Install passenger.

gem install passenger

Once the passenger 2 apache module is installed, add the bits it tells you to the following file.

nano /usr/local/apache/conf/includes/pre_virtualhost_2.conf

It should look like this;

LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-3.0.19/ext/apache2/
PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-3.0.19
PassengerRuby /usr/bin/ruby

Once it’s added, rebuild the httpd config.

/usr/local/cpanel/bin/apache_conf_distiller --update
service httpd restart

Download/extract redmine.

cd /usr/src
tar -xvf redmine-1.3.1.tar.gz
mv redmine-1.3.1 redmine

Prepare the redmine directory.

mv redmine/config/database.yml.example redmine/config/database.yml
mv redmine/public/dispatch.cgi.example redmine/public/dispatch.cgi
mv redmine/public/dispatch.fcgi.example redmine/public/dispatch.fcgi
mv redmine/public/dispatch.rb.example redmine/public/dispatch.rb
mv redmine/public/htaccess.fcgi.example redmine/public/.htaccess

Create a database in cPanel and edit the config file.

nano redmine/config/database.yml

It should look like this;

 adapter: mysql
 database: user_redmine
 host: localhost
 username: user_redmine
 password: strongpassword

Install an older version of rubygems.

cd /usr/src
tar -xvf rubygems-1.4.2.tgz
cd rubygems-1.4.2
ruby setup.rb

Install bundler.

gem install bundler

Move the redmine directory to the users public_html (or doc root if it’s a subdomain).

cd /usr/src
mv redmine /home/user/public_html

Edit the environment file and uncomment “ENV[‘RAILS_ENV’] ||= ‘production'”

nano /home/user/public_html/config/environment.rb

Run the following;

RAS_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

Create the include directory tree.

mkdir -p /usr/local/apache/conf/userdata/std/2/<user>/<domain>/

Create the include file.

nano /usr/local/apache/conf/userdata/std/2/<user>/<domain>/redmine.conf

Enter the following;

RailsEnv production
RailsBaseURI /
PassengerAppRoot /home/<user>/public_html
DocumentRoot /home/<user>/public_html/public

Rebuild the httpd to include the custom include.

/usr/local/cpanel/bin/apache_conf_distiller --update
service httpd restart

Fix the permissions.

chown -R user:user /home/<user>/public_html
chown user:nobody /home/<user>/public_html
chmod -R 755 /home/<user>/public_html

If it’s all gone well you will be able to access redmine at the domain/subdomain. If you want to install it in a directory, you just need to edit the relevant config files and set the ‘RailsBaseURI’ to /<directory>.



Leave a Reply

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