I finally done it. I’m reporting here all the steps necessary in case someone wants to do it. It does not however install it on subdir (if someone knows how to, please add it here. I tried for hours and couldn’t do it)
These instructions work fine for a fresh install of Ubuntu 10.04 Desktop edition. they include installing Apache and MySQL too.
I’ve rewrote these instructions with tighten permissions and using subdir on the Tracks wiki and Ubuntu forums.
1 - Install all the dependencies
$ sudo tasksel install lamp-server
$ sudo aptitude install ruby libdbd-mysql-ruby rake libopenssl-ruby libapache2-mod-passenger libapache2-mod-fcgid
2 - Download and set permissions for tracks
$ wget http://download.github.com/bsag-tracks-1.7.1-0-g13db454.zip
$ unzip ./bsag-tracks-1.7.1-0-g13db454.zip
$ sudo mv bsag-tracks-6aff172 /var/www/tracks
$ sudo chown -R www-data:root /var/www/tracks
$ sudo chmod -R 664 /var/www/tracks/
$ sudo chmod 755 /var/www/tracks
$ cd /var/www/tracks/
$ sudo find -type d -exec chmod a+x '{}' \;
$ sudo chmod -R a+x script/*
3 - Create MySQL database
$ sudo mysql -u root -p
mysql> CREATE DATABASE tracks;
Query OK, 1 row affected (0.03 sec)
mysql> GRANT ALL PRIVILEGES ON tracks.* TO 'trackuser'@'localhost' IDENTIFIED BY 'tracks' WITH GRANT OPTION;
Query OK, 0 rows affected (0.08 sec)
mysql> quit;
Bye
4 - Configure tracks
$ sudo cp config/database.yml.tmpl config/database.yml
$ sudo cp config/site.yml.tmpl config/site.yml
edit only the production section on the “database.yml” file (of course, use the password and username that you decided when creating the database on the previous step)
production:
adapter: mysql
database: tracks
host: localhost
username: tracksuser
password: tracks
on the file “site.yml” edit the following lines:
Choose a new salt word
salt: "change-me"
get the right time.
time_zone: "UTC"
You can see a list of right ones with the command
$ rake time:zones:local
5 - Populate database
$ sudo rake db:migrate RAILS_ENV=production
6 - Configure and restart apache
Edit “/etc/apache2/sites-available/default” to change the DocumentRoot
DocumenRoot /var/www/tracks/public/
Finally restart apache
$ sudo /etc/init.d/apache2 restart
Open the URL http://localhost/ to start tracks.
This will make it wok. The permission could probably be a bit more tight. It also makes apache serving only Tracks which is definitely not-optimal.


