Skip to content
This repository has been archived by the owner on Jan 30, 2018. It is now read-only.

Installing on Ubuntu

antot edited this page Feb 7, 2013 · 13 revisions

Necessary packages

The following packages are required at some point during the installation:

sudo apt-get update
sudo apt-get install \
  build-essential ruby ruby-dev irb libmysqlclient15-dev sqlite3 libsqlite3-dev \
  libcurl4-openssl-dev libopenssl-ruby libpcre3-dev libxml2-dev libxslt-dev \
  libreadline5-dev apache2 apache2-prefork-dev libapr1-dev imagemagick libpq-dev \
  libmysql-ruby libmysqlclient-dev

Some comments for Ubuntu 12.04. libreadline5-dev is named libreadline-gplv2-dev. Some additional packages are needed, otherwise “bundle install” fails.

sudo apt-get install libreadline-gplv2-dev sqlite3 libsqlite3-dev libpq-dev libmysqlclient-dev

After this, you need to install RubyGems and Bundler.

Upgrade to Ruby Enterprise Edition [optional]

Ruby Enterprise Edition is a version of Ruby optimized for a smaller memory footprints of deployments. It works especially well with Passenger module for Apache/nginx. It is available as an Ubuntu package from the official site.

Get and bootstrap the Teambox app.

Follow the Installing locally instructions. Move the fetched code somewhere where you will keep websites, like “/websites/teambox.mydomain.com”.

Install Passenger

Passenger will allow Apache to run our Rails application. Install it:

sudo gem install passenger
sudo passenger-install-apache2-module

Pay attention to Apache directives given to you in the output when installation finishes. Create “/etc/apache2/mods-available/passenger.conf” and paste that info. It should look something like:

PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-2.2.11
PassengerRuby /usr/bin/ruby1.8

Create "/etc/apache2/mods-available/passenger.load* with something like:

LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-2.2.11/ext/apache2/mod_passenger.so

Enable mod_passenger:

cd /etc/apache2/mods-enabled
sudo ln -s ../mods-available/passenger.* ./

Restart apache: sudo /etc/init.d/apache2 restart

Configure the virtual host for your domain

<VirtualHost *:80>
 Options +Indexes
 ServerAdmin me@mydomain.com
 ServerName teambox.mydomain.com

 DocumentRoot /websites/teambox.mydomain.com/public

 <Directory /websites/teambox.mydomain.com/public>
 Options Indexes FollowSymLinks
 AllowOverride All
 Order allow,deny
 Allow from all
 Options -MultiViews
 </Directory>

 RailsEnv production
</VirtualHost>

You should now have your own instance running.

Troubleshooting: files not being downloaded

With this configuration Teambox will work almost perfectly, with the exception of file downloads. Teambox doesn’t handle file downloads, since this would be very resource-consuming! Instead, it let’s the server handle the download. For this, we need to enable the XSendFile mod in Apache:

sudo apt-get install libapache2-mod-xsendfile
sudo /etc/init.d/apache2 restart

and finally add the following two directives to the virtualhost file we created in a previous step:

XSendFile On
XSendFileAllowAbove on

And now file downloads should work!