ChiliProject is not maintained anymore. Please be advised that there will be no more updates.

We do not recommend that you setup new ChiliProject instances and we urge all existing users to migrate their data to a maintained system, e.g. Redmine. We will provide a migration script later. In the meantime, you can use the instructions by Christian Daehn.

Installation on Ubuntu 10.10 (Maverick Meerkat)

This guide is written for ChiliProject versions 1.1.0 — Bell to 1.4.0. Other versions might need different dependencies and installation steps.

Contents

This guide is going to lead you through a standard installation of ChiliProject on Ubuntu 10.10 (Maverick Meerkat). For many of the installation steps exist various alternatives. These are mentioned at the respective places. Sometimes it makes sense to follow the the alternative routes depending on your environment and special needs.

This guide requires packages from the Universe package repository. Make sure you enabled it before continuing.

All commands mentioned here are assumed to be run as root. Many of them will not work when run as a normal user. You can get a root shell by running sudo -i.

Global dependencies and basic system setup

mkdir -p /var/www/chiliproject
adduser --system --home /var/www/chiliproject --group --shell /bin/sh --disabled-login chiliproject

Install Ruby and basic dependencies

Currently ChiliProject requires either Ruby 1.8.6 or 1.8.7. Since support for 1.8.6 is probably going away soon, we will install 1.8.7. As of this writing, the official Ubuntu repositories contain the 1.8.7 version of Ruby and sufficiently up-to-date auxiliary packages so we can rather safely use those.

Another alternative would we to use the Ruby Version Manager and install Ruby and all dependent components from source. It brings you much more more flexibility while being equally simple to manage than the Ubuntu package based setup.

Variant 1: Use Ubuntu packages

apt-get update
apt-get install ruby rubygems

Under ubuntu 10.04 you should also need libopenssl-ruby1.8

Variant 2: Use the Ruby Version Manager (RVM)

For RVM we basically need a compiler and some library dependencies and development headers.

aptitude install build-essential curl libssl-dev zlib1g-dev libreadline5-dev libxml2-dev git

Now install RVM. This script will install RVM into /usr/local/rvm. All users which are members of the newly created rvm group can subsequently modify the installed rubies and gems. By default only root is going to be in this group.

bash < <(curl -s https://rvm.beginrescueend.com/install/rvm)

To load RVM into the shell session you can either logout and login again or simply run source /etc/profile.d/rvm.sh your current shell session.

Now as we have installed RVM, we can download and compile a Ruby 1.8.7. You can also use Ruby Enterprise Edition here. Just replace 1.8.7 with ree in the following 3 commands.

rvm install 1.8.7
rvm use 1.8.7
rvm --default 1.8.7

For more information and options refer to the official RVM installation guide.

Install Rails and required packages for ChiliProject

Now we install the libraries that Chiliproject depends upon, while forcing specific versions. Unfortunately we cannot use the rails package from the official repository as it requires an old version of i18n. Installing rails should also install v0.8.7 of rake and v1.0.1 of rack.

gem install rake -v=0.8.7
gem install rails -v=2.3.5
gem install i18n -v=0.4.2

Note: if you try to run rake on the console and get command not found, you'll need to add the rake executable to your PATH:

export PATH=$PATH:$HOME/bin:/var/lib/gems/1.8/bin

Install database adapter

Setup and configure a database. ChiliProject supports MySQL, PostgreSQL and SQLite3. For a production environment, you should go with either MySQL or PostgreSQL to prevent scaling and issues and problems from parallel access to the SQLite database. Please chose one of the databases and install it.

Variant 1: PostgreSQL

First install the actual database.

apt-get install postgresql

Now setup and perform the basic configuration of your database server. For a single-system setup, the basic Ubuntu configuration is sufficient. A special ChiliProject user and the actual database is created later.

Variant 1.1: Install adapter as Ubuntu package

If you've installed Ruby from Ubuntu packages follow that route and also install the database adapter via apt-get.

apt-get install libpgsql-ruby

Variant 1.2: Install adapter as gem

If you've gone the RVM route install the gem.

apt-get install libpq-dev
gem install pg

Later in this guide we are going to configure ChiliProject to find and connect to the database. Make sure to use the PostgreSQL configuration variants throughout the rest of the guide.

Variant 2: MySQL

First install the actual database.

apt-get install mysql-server

Now setup and perform the basic configuration of your database server. For a single-system setup, the basic Ubuntu configuration is sufficient. For a real production setup you might want to tune your MySQL server a bit. The default configuration is targeted at very small systems. Query handling times can be improved by properly tuning your MySQL depending on your hardware

A special ChiliProject user and the actual database is created later.

Variant 2.1: Install adapter as Ubuntu package

If you've installed Ruby from Ubuntu packages follow that route and also install the database adapter via apt-get.

apt-get install libmysql-ruby

Variant 2.2: Install adapter as gem

If you've gone the RVM route install the gem.

apt-get install libmysqlclient-dev
gem install mysql

Later in this guide we are going to configure ChiliProject to find and connect to the database. Make sure to use the MySQL configuration variants throughout the rest of the guide.

Variant 3: SQLite3

First install the actual database followed by the ruby adapter.

apt-get install sqlite3

Variant 3.1: Install adapter as Ubuntu package

If you've installed Ruby from Ubuntu packages follow that route and also install the database adapter via apt-get.

apt-get install libsqlite3-ruby

Variant 3.2: Install adapter as gem

If you've gone the RVM route install the gem.

apt-get install libsqlite3-dev
gem install sqlite3

Later in this guide we are going to configured ChiliProject to use a configure SQLite database file. Make sure to use the SQLite3 configuration variants throughout the rest of the guide.

Install ChiliProject

Follow the standard Installation guide. In this guide, we are going to

  • get the ChiliProject code,
  • put it in the correct place,
  • connect it to the chosen database, and
  • perform a basic configuration

Once you are finished, return back here. Make sure to follow the already chosen options:

  • Installation Root is /var/www/chiliproject
  • Use the chosen database variant during database configuration

Install and setup Apache2 with Passenger (mod_rails)

In this guide we are going to install Apache with Passenger as an application server. There are various other application servers available which might better suit your use-case. Examples are Passenger with nginx or one of Thin, Unicorn, or Mongrel which all need a loadbalancer / webserver like Apache or nginx in front. Most people are served very well by Apache+Passenger and it is generally very simple to install and maintain, so it is the preferred deployment option for ChiliProject.

At first, we need Apache and the passenger module. This module is going to connect Apache with your Rails processes. The complete passenger documentation is available from modrails.com. For more configuration options and examples, please refer to this guide.

apt-get install apache2-mpm-prefork

Variant 1: Installed using Ubuntu Packages

If you have installed Ruby from packages, install the packaged passenger module.

apt-get install libapache2-mod-passenger

Now edit /etc/apache2/mods-enabled/passenger.conf to force it to use our chiliproject user. We add the PassengerDefaultUser chiliproject directive. In the end, the file should look like this:

<IfModule mod_passenger.c>
  PassengerRoot /usr
  PassengerRuby /usr/bin/ruby

  PassengerDefaultUser chiliproject
</IfModule>

Variant 2: Installed via RVM

If you installed Ruby via RVM, install the gem instead:

apt-get install apache2-prefork-dev libcurl4-openssl-dev
gem install passenger
passenger-install-apache2-module

At the end the script outputs some configuration values. Put the single line with the LoadModule directive into the file /etc/apache2/mods-available/passenger.load. The rest of the configuration values have to go into /etc/apache2/mods-available/passenger.conf. At the end of the file add PassengerDefaultUser chiliproject to force it to use our newly created chiliproject user.

The /etc/apache2/mods-available/passenger.conf file should look something like this:

<IfModule mod_passenger.c>
 PassengerRoot /usr/local/rvm/gems/ruby-1.8.7-p334/gems/passenger-3.0.3
 PassengerRuby /usr/local/rvm/wrappers/ruby-1.8.7-p334/ruby

  PassengerDefaultUser chiliproject
</IfModule>

Finally enable the module and reload Apache.

a2enmod passenger
/etc/init.d/apache2 reload

Setup the Apache virtual host

Variant 1: Install ChiliProject at a virtual host's root

cat > /etc/apache2/sites-available/chiliproject <<EOF
<VirtualHost *:80>
  # TODO: Adapt the servername
  ServerName chiliproject.domain.com

  DocumentRoot /var/www/chiliproject/public
  <Directory /var/www/chiliproject/public>
    Options None
    AllowOverride None

    Order deny,allow
    Allow from all
  </Directory>
</VirtualHost>
EOF

Now activate the new virtual host and reload Apache. ChiliProject will be started at the first request to http://chiliproject.domain.com/.

a2ensite chiliproject
/etc/init.d/apache2 reload

Variant 2: Install ChiliProject in a sub URL

You can also install ChiliProject into a sub URL of an existing virtual host. In the following steps, we are going to setup Apache so that it serves ChiliProject from /chiliproject of an existing virtual host, so the root URL will look something like http://www.domain.com/chiliproject

At first you need to identify the existing virtual host where you want to host ChiliProject under. Normally, you find those in /etc/apache2/sites-enabled/. Choose the desired virtual host and find where its DocumentRoot is pointing to. Remember the path directly after the DocumentRoot directive (normally rather at the top of the virtual host).

In the following steps, the document root of the existing virtual host is going to be named DOCUMENTROOT. Always remember to replace this place holder with the actual path.

You need to hint Passenger a bit here so that it correctly finds your ChiliProject. So we create a symlink from the existing DocumentRoot directory to out ChiliProject installation.

ln -s /var/www/chiliproject/public DOCUMENTROOT/chiliproject

Now add the following directives into your existing virtual host:

# TODO: Remember to replace DOCUMENTROOT with your actual path
<Directory DOCUMENTROOT>
  Options +SymLinksIfOwnerMatch
</Directory>

RailsBaseURI /chiliproject
# TODO: Remember to replace DOCUMENTROOT with your actual path
<Directory DOCUMENTROOT/chiliproject>
  Options -MultiViews

  Order deny,allow
  Allow from all
</Directory>

Now reload Apache to enable the new configuration. ChiliProject will be started at the first request to http://www.domain.com/chiliproject.

/etc/init.d/apache2 reload