This tutorial explains how to install Redmine 2.1.x for one of your clients in an ISPConfig 3 server setup running on Ubuntu 12.04 Precise Pangolin. It does not explain how to install ISPConfig 3 on Ubuntu 12.04 Precise Pangolin. An excellent tutorial on the steps involved to do that can be found here.

1. Create the Client account in ISPConfig and a new Site

Once you get ISPConfig running correctly you should log in and setup your “Client” account in ISPConfig and then create a new “Site” to run the Redmine installation for this client.

2. Install the .deb packages to support Redmine 2.1.x

Next we start by installing the required ruby / rails and apache2 modules needed to run Redmine 2.1.x. These instructions assume you have root ssh access to the server but they could easily be run by a user with the correct sudo privileges.

# apt-get install ruby-full libmysqlclient-dev libmagickwand-dev libapache2-mod-passenger

3. Download Redmine 2.1.x

Navigate to the directory for the new “Site” that was setup. You should of course change client1 and web1 for the appropriate client number in your ISPConfig 3 setup.

# cd /var/www/clients/client1/web1/

At the the time of this writing the latest Redmine 2.1.x release was at 2.1.2 so we download the tar/gz from the ruby forge website, unzip it and make it the “web” directory of your new Site.

# wget http://rubyforge.org/frs/download.php/76495/redmine-2.1.2.tar.gz
# gunzip redmine-2.1.2.tar.gz
# tar -xf redmine-2.1.2.tar
# mv web web_orig
# mv redmine-2.1.2 web

4. Create the Database for the Redmine installation

Now you should create a new mysql database for your client’s Redmine installation in ISPConfig 3. Remember the username and password you setup for this database as you will need this for the next step when you change the Redmine database configuration.

5. Copy the database configuration example file to a new configuration file

# cp ./web/config/database.yml.example config/database.yml

6. Edit the new database configuration file and change the following values for production: to the database you have setup in ISPConfig 3.

production:
adapter: mysql
database: c1_redmine
host: localhost
username: c1_redmine
password: <enter-the-password>

6. Now we need to ensure that we have installed rake and the ruby bundler package.

# apt-get install rake ruby-bundler

7. Now go to the config directory and run the following..

# cd /var/www/clients/client1/web1/web/config/
# bundle install --without development test postgresql sqlite

This should out put something similar to the following…

Fetching source index for http://rubygems.org/
Installing rake (0.9.2.2)
Installing i18n (0.6.1)
Installing multi_json (1.3.6)
Installing activesupport (3.2.8)
Installing builder (3.0.0)
Installing activemodel (3.2.8)
Installing erubis (2.7.0)
Installing journey (1.0.4)
Installing rack (1.4.1)
Installing rack-cache (1.2)
Installing rack-test (0.6.2)
Installing hike (1.2.1)
Installing tilt (1.3.3)
Installing sprockets (2.1.3)
Installing actionpack (3.2.8)
Installing mime-types (1.19)
Installing polyglot (0.3.3)
Installing treetop (1.4.10)
Installing mail (2.4.4)
Installing actionmailer (3.2.8)
Installing arel (3.0.2)
Installing tzinfo (0.3.33)
Installing activerecord (3.2.8)
Installing activeresource (3.2.8)
Using bundler (1.0.15)
Installing coderay (1.0.7)
Installing fastercsv (1.5.5)
Installing rack-ssl (1.3.2)
Installing json (1.7.5) with native extensions
Installing rdoc (3.12)
Installing thor (0.16.0)
Installing railties (3.2.8)
Installing jquery-rails (2.0.3)
Installing mysql (2.8.1) with native extensions
Installing net-ldap (0.3.1)
Installing ruby-openid (2.1.8)
Installing rack-openid (1.3.1)
Installing rails (3.2.8)
Installing rmagick (2.13.1) with native extensions
Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.

Make sure the above line is show before continuing…

8. Create the secret token.

# rake generate_secret_token

9. Initialise the Redmine Installation

# RAILS_ENV=production rake db:migrate
# RAILS_ENV=production rake redmine:load_default_data

You should see the output from creating the database and also a message stating that the default data has been loaded.

10. Make sure that passenger is enabled for apache2

# a2enmod passenger

11. Create the appropriate permissions for some directories in the Redmine setup.

# chown web1:client /var/www/clients/client1/web1/web/ -R
# chmod 755 /var/www/clients/client1/web1/web/
# mkdir /var/www/clients/client1/web1/web/public/plugin_assets
# chmod -R 777 /var/www/clients/client1/web1/web/public/plugin_assets
# chmod -R 777 redmine/files

12. Override the default DocumentRooT for your Site

You do this by adding the following to the Apache Directives section of your ISPConfig Site configuration.

DocumentRoot /var/www/clients/client1/web1/web/public/

When ISPConfig’s cron update runs and apache2 restarts you should be able to go to the URL for the Site you have setup and you should see your Redmine installation.

Hope this helps those wanting to run Redmine for their ISPConfig clients 😀 Of course keeping this up to date is another story 😉


This tutorial uses the following articles as as a references…