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 Debian 5.0 (Lenny)¶
This guide is written for ChiliProject versions 1.1.0 — Bell to 1.4.0. Other versions might need different dependencies and installation steps.
This guide is specific to installing ChiliProject on Debian 5.0 (Lenny). There are also guides for Debian 6.0 (Squeeze) and other Linux distributions.
This guide is going to lead you through a standard installation of ChiliProject on Debian 5.0 (Lenny). 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.
If you use one of the alternatives mentioned here, you can always return to follow the installation to the end.
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 /srv/www/chiliproject adduser --system --home /srv/www/chiliproject --group --shell /bin/sh --disabled-login chiliproject
Install Ruby and basic dependencies¶
Ruby packages on Debian Lenny are a bit outdated. So you need to use the lenny-backports repository and packages from Debian Squeeze for some components. If you decide to upgrade to Debian Squeeze the package based installation is going to be much simpler as its packages are rather up-to-date.
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 Debian package based setup.
If in doubt, we strongly suggest you go with the RVM route on Debian Lenny.
Variant 1: Use Debian packages¶
First setup the official lenny-backports and the squeeze repositories and setup package pinning to generally prefer packages from lenny but to use newer version of some special packages.
echo "deb http://backports.debian.org/debian-backports lenny-backports main" > /etc/apt/sources.list.d/lenny-backports.list cat > /etc/apt/sources.list.d/squeeze.list <<EOF deb http://ftp.debian.org/debian/ squeeze main deb http://security.debian.org/ squeeze/updates main EOF cat > /etc/apt/preferences <<EOF Package: * Pin: release o=Debian,a=oldstable Pin-Priority: 900 Package: * Pin: release o=Debian,a=stable Pin-Priority: 200 Package: * Pin: release a=lenny-backports Pin-Priority: 201 Package: rubygems Pin: release o=Debian,a=stable Pin-Priority: 999 Package: rubygems1.8 Pin: release o=Debian,a=stable Pin-Priority: 999 Package: passenger-common Pin: release a=lenny-backports Pin-Priority: 999 Package: libapache2-mod-passenger Pin: release a=lenny-backports Pin-Priority: 999 EOF
Then install the basic ruby packages.
aptitude update aptitude install ruby1.8 libopenssl-ruby1.8 aptitude install --without-recommends rubygems
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-core
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¶
gem install rake gem install rails -v=2.3.5 gem install i18n -v=0.4.2
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.
aptitude install postgresql
Now setup and perform the basic configuration of your database server. For a single-system setup, the basic Debian configuration is sufficient. A special ChiliProject user and the actual database is created later.
Variant 1.1: Install adapter as Debian package¶
If you've installed Ruby from Debian packages follow that route and also install the database adapter via aptitude.
aptitude install libpgsql-ruby
Variant 1.2: Install adapter as gem¶
If you've gone the RVM route install the gem.
aptitude 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.
aptitude install mysql-server
Now setup and perform the basic configuration of your database server. For a single-system setup, the basic Debian 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 Debian package¶
If you've installed Ruby from Debian packages follow that route and also install the database adapter via aptitude.
aptitude install libmysql-ruby
Variant 2.2: Install adapter as gem¶
If you've gone the RVM route install the gem.
aptitude 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.
aptitude install sqlite3
Variant 3.1: Install adapter as Debian package¶
If you've installed Ruby from Debian packages follow that route and also install the database adapter via aptitude.
aptitude install libsqlite3-ruby
Variant 3.2: Install adapter as gem¶
If you've gone the RVM route install the gem. As the most recent version of the sqlite-ruby
gem is not compatible with the SQLite version from Debian Lenny we are going to install an older version.
aptitude install libsqlite3-dev gem install sqlite3-ruby -v=1.2.5
Later in this guide we are going to configure ChiliProject to use a configured 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
/srv/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.
aptitude install apache2-mpm-prefork
Variant 1: Installed using Debian Packages¶
If you have installed Ruby from packages, install the packaged passenger module.
aptitude 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:
aptitude 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>
The versions and locations might differ. Please use the actual configuration values from the passenger-install-apache2-module
script.
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 /srv/www/chiliproject/public <Directory /srv/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 /srv/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