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

Installing on Ubuntu

mislav edited this page Aug 9, 2010 · 13 revisions

Juan Jaramillo wrote an excellent article about Installing Teambox on Ubuntu. This guide is based on his article.

This guide has been tested for Ubuntu 8.04.3 LTS.

Installing necessary software

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

sudo apt-get update
sudo apt-get install apache2 mysql-server imagemagick git \
  git-core ruby rake rubygems libdbd-mysql-ruby \
  libmysql-ruby liberuby-dev libopenssl-ruby1.8 \
  apache2-prefork-dev

Please note:

apache2 and mysql will likely already be on your server. I am assuming you have a mysql user account that can create databases.

If you already have some of these packages installed, executing the above will update them if there is a new version. This may cause unexpected results – so beware of that.

I did my first install on a 9.10 server on which I was able to install “ruby-dev” instead of “liberuby-dev”

Package names may be different in other versions of Ubuntu. I use Package Search for reference.

(Ubuntu 8.04 only) Upgrade to Ruby 1.8.7 [optional]

First, check with version of Ruby you have:

ruby -v

If you don’t have 1.8.7, then install it.

cd /usr/src
wget http://archive.ubuntu.com/ubuntu/pool/main/r/ruby1.8/ruby1.8_1.8.7.174-1_i386.deb
wget http://archive.ubuntu.com/ubuntu/pool/main/r/ruby1.8/libruby1.8_1.8.7.174-1_i386.deb
wget http://archive.ubuntu.com/ubuntu/pool/main/r/ruby1.8/ruby1.8-dev_1.8.7.174-1_i386.deb
wget http://mirrors.kernel.org/ubuntu/pool/universe/libx/libxml-ruby/libxml-ruby1.8_1.1.3-1_i386.deb
sudo dpkg -i libruby1.8_1.8.7.174-1_i386.deb ruby1.8_1.8.7.174-1_i386.deb ruby1.8-dev_1.8.7.174-1_i386.deb libxml-ruby1.8_1.1.3-1_i386.deb
sudo install ruby

Getting Teambox from the Git repository

I am installing Teambox in /websites/teambox.mydomain.com, so I will check out a copy of their stable branch:

git clone git://github.com/micho/teambox.git teambox.mydomain.com

Install required gems:

bundle install

If you have any problems of missing gems, simply run “gem install GEMNAME”.

Configure Teambox:

Edit config/teambox.yml to set your domain name and email information.

A good service for outgoing email is Sendgrid. You can also use GMail.

host: smtp.sendgrid.net
username: your@username.com
password: your_password
auth: plain
port: 25
enable_starttls_auto: false

Configure databases

Edit config/databases.yml, and set your database user and pass under production. (Others are optional, only used for development)

Build the database (replace the =production with =development if you want to build the development environment as well).

RAILS_ENV=production  rake db:create
RAILS_ENV=production  rake db:auto:migrate

Test your app if working

We will now run a basic server to test the installation. Inside the directory where you installed Teambox, type:

./script/server -p 3000 -e production

Now browse to http://yourserverip:3000, you should see a server with your Teambox copy.
If this is working, we’ll now install Passenger to get it running properly from Apache.

Install Passenger

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

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

Create or edit: /etc/apache2/mods-available/passenger.conf and enter this content:

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

Create or edit: /etc/apache2/mods-available/passenger.load with:

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
ln -s ../mods-available/passenger.* ./

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

Configure a vhost for your domain, so you can

<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
 #RailsEnv development
</VirtualHost>

Now you have your server running. Enjoy!
Clone this wiki locally