ChiliProject

From ParabolaWiki
Jump to: navigation, search


Warning: ChiliProject was deprecated. See https://www.chiliproject.org/

This article will cover the steps needed to install Chili the project manager. Chili was used at Labs. Chili is a Ruby on Rails application so the steps included here could also be helpful to deploy any other Rails application.

We'll use: nginx, ruby, rails, git, and sqlite (you can also use posgresql or mysql).

Note: On terminal, # represents "run as root" and $, "run as user"

1 Create a user for the project manager

We'll create a user called chili and associate it to the http group. We also add it to the git group so it can access git repos, in the case you have a git user to manager your git repos.

 # useradd --home /srv/http/chili --create-home --gid http --groups git chili
 # passwd chili

2 Get the dependencies

 # pacman -S nginx ruby git postgresql
 # gem install bundler thin

3 Get the code

Later on, we get the code into a public dir and continue with the installation instructions:

 # su - chili
 $ git clone git://github.com/chiliproject/chiliproject.git public
 $ git checkout stable
 # bundle install --without test development mysql mysql2

We remove mysql and mysql2 support because we won't use it. The build also fails because the libmysqlclient headers are placed elsewhere on the package. You can install mysql2 using gem install mysql2, passing an extra flag to it (try to install it once, check the flag that points to mysql_config and change it to /usr/bin/mysql_config).

Configure the database:

 # su - chili
 $ $EDITOR config/database.yml
   production:
     adapter: sqlite3
     database: db/production.db

Migrate the data:

 $ export RAILS_ENV=production
 $ bundle exec rake generate_session_store
 $ bundle exec rake db:migrate

Create a temp dir:

 $ mkdir tmp

Optional step, load the default data (roles, users, etc.):

 $ bundle exec rake redmine:load_default_data

Test the install, you should be able to see your site by browsing to http://localhost:3000/ default credentials are admin:admin:

 $ bundle exec script/server -e production

4 Configure email delivery

Chili can send email notifications, but you must configure it first. Copy config/configuration.yml.example and edit it to suit your needs. The configuration file has lots of examples.

 $ cp config/configuration.yml{.example,}
 $ $EDITOR config/configuration.yml
   production:
     email_delivery:
       delivery_method: "smtp"
       address: "localhost"
       port: 25
       domain: "your.domain"

The domain option should be set if your SMTP server expects it, it represents the "@domain" part of an email address. You can debug errors on log/production.log.

5 Configure Thin and Nginx

Run three thin servers on sockets (absolute path is required):

 $ bundle exec thin start -s3 --socket /srv/http/chili/public/thin.socket

If the files aren't created, check log/thin.X.log to see what failed (YAML syntax errors, etc.)

Configuration snippet for Nginx follows, you may want to add some other instructions.

 # Chili upstreams are thin sockets
 upstream chili {
   server unix:/srv/http/chili/public/thin.0.socket;
   server unix:/srv/http/chili/public/thin.1.socket;
   server unix:/srv/http/chili/public/thin.2.socket;
 }
 
 server {
   listen 80;
   server_name labs.parabola.nu;
   root /srv/http/chili/public;
 
 # Pass any request to the chili upstream
   location / {
     proxy_pass http://chili;
   }

Restart/Reload Nginx and visit your domain: http://labs.parabola.nu :D

Note: Nginx must have read access to /srv/http/chili/public so make sure the http group (or whatever group Nginx belongs to) has read access to it. chmod 750 /srv/http/chili /srv/http/chili/public should be enough. Do not use chmod -R or you'll give read access to anything on chili home.