Install Tracks on Ubuntu or Debian
This time we are going to learn how to install Tracks, a Getting Things Done™ implementation, that I use it and like a lot. We are going to install it on an Apache2 web server with FastCGI, using MySQL as the database engine, and of course we also have to install Ruby On Rails because it is a requirement of Tracks. I think the best thing would be use Subversion to get the sources of Tracks because doing it so would make upgrading the installation a snap.
Note: If at any time it asks for something and I don’t specify something is because default option is the safe bet.
Step 1: Add the needed apt-get sources
- I’m going to use VIM text editor to edit files, you can use any other you want(in case you don’t know how to use vim) by replacing the word vim on the commands that appears.
sudo vim /etc/apt/source.list
Make sure that the lines that contain universe are uncommented, that means without any # in front of it. Once you uncommented them exit the editor.
- Update the available packages list by running the following command.
sudo apt-get update
That will check the /etc/apt/source.list file and update the package list accordingly.
- Move to the next step.
Step 2: Install Apache2
- To install Apache2 we simply run:
sudo apt-get install apache2
- Move to the next step.
Step 3: Install MySQL
- To install MySQL we simply run:
sudo apt-get install mysql-server-5.0
- Now you probably want to change the root password for the server, to do that we first need to log into mysql.
mysql -u root
- Now that we select a password and we change it executing the following commands:
SET PASSWORD FOR 'root'@'localhost' = PASSWORD('newPassword');and
SET PASSWORD FOR 'root'@'%' = PASSWORD('newPassword'); - Now we need to create the database that Tracks is going to use, I suppose you are still logged into MySQL
CREATE DATABASE tracks;
- Create the user for that database.
CREATE USER 'tracks'@'%' IDENTIFIED BY 'aPassword';
- And finally grant the permission for that user
GRANT ALL ON tracks.* TO 'tracks'@'%';
- Move to the next step.
Step 4: Install Ruby
- We are going to install Ruby with apt-get too, but this time we need a lot more packages than before.
sudo apt-get install ruby rdoc ri ruby1.8
and some needed libraries
sudo apt-get install libzlib-ruby libyaml-ruby
- Move to the next step.
Step 5: Install Gems
- Now the first thing that we are going to install without apt-get install. Go to the Ruby Gems download page and find the latest *.tgz and right click the link and copy the link location, the latest at the moment I wrote this post was RubyGems-0.9. After you copied the link, you need to tell the shell to download it. For that you do:
wget http://rubyforge.org/frs/download.php/11289/rubygems-0.9.0.tgz
- Now we need to untar it.
tar xzvf rubygems-0.9.0.tgz
- Enter the extracted directory
cd rubygems-0.9.0
- Install it.
sudo ruby setup.rb
- Move to the next step.
Step 6: Install Ruby On Rails and Ruby-MySQL
- We are going to start with Rails.
sudo gem install rails --include-dependencies
- And now we install mysql.
sudo gem install mysql
and we need to choose the newest package available.
- Move to the next step.
-
- We are going to use an alternative mod_fastcgi that happened to work better to me, to install that one we do.
sudo apt-get install libapache2-mod-fcgid
- Now we need to configure the module. It’s a matter of personal choice actually, but this settings are what I recommend. First open up the configuration file.
sudo vim /etc/apache2/mods-enabled/fcgid.conf
and replace all the configuration with this one instead
<IfModule mod_fcgid.c> AddHandler fcgid-script .fcgi SocketPath /var/lib/apache2/fcgid/sock IPCConnectTimeout 20 DefaultInitEnv RAILS_ENV production IdleTimeout 60 ProcessLifeTime 6000 MaxProcessCount 32 DefaultMaxClassProcessCount 2 IPCConnectTimeout 6 IPCCommTimeout 6 </IfModule>
- Move to the next step.
- Firstly we need to get the sources, if you don’t have subversion installed, this is the moment to install it with
sudo apt-get install subversion
- Now we can get the sources, be sure to grab the newest SVN URL from the Tracks Download Page and use the latest SVN URL replacing the red part.
sudo svn checkout http://www.rousette.org.uk/svn/tracks-repos/tags/tracks-1.043 /var/www/tracks
- Now we change the current dir to where the Tracks sources are.
cd /var/www/tracks
- There we need to copy some files and then we need to edit them
-
sudo cp config/database.yml.tmpl config/database.yml
-
sudo cp config/environment.rb.tmpl config/environment.rb
-
sudo cp -R log.tmpl/ log
-
- Lets edit config/database.yml now.
sudo vim config/database.yml
There we are going to change the red parts.
development: adapter: mysql database: tracks host: localhost username: tracks password: aPassword socket: /var/run/mysqld/mysqld.sock test: adapter: mysql database: tracks_test host: localhost username: root password: production: adapter: mysql database: tracks host: localhost username: tracks password: aPassword socket: /var/run/mysqld/mysqld.sock
- Now we edit config/environment.rb.
sudo vim config/environment.rb
and we change there the line that starts with SALT =(line 54) to something random, for example:
SALT = "somethingRandom"
- Finally we run the command that adds the needed MySQL content.
sudo rake db_schema_import
- Move to the next step.
- Now the only thing that keeps you away from using your tracks is a simple configuration on Apache2, so lets jump off. We need to create a new file for this configuration, so let’s do it so.
sudo vim /etc/apache2/sites-available/tracks
- There you should put something like this and change the red parts.
<VirtualHost *> ServerName tracks.domain.tld DocumentRoot /var/www/tracks/public/ ErrorLog /var/www/tracks/log/apache.log <Directory /var/www/tracks/public> Options ExecCGI FollowSymLinks AllowOverride all Allow from all Order allow,deny </Directory> </VirtualHost> - Lets enable the site.
sudo a2ensite tracks
This will create a symlink in /etc/apache2/sites-enabled
- Finally we have to restart the web server.
sudo apache2 force-reload
- Enjoy!
- We are going to use an alternative mod_fastcgi that happened to work better to me, to install that one we do.
Step 7: Install FastCGI for Apache2
Step 8: Get Tracks and configure it
Step 9: The Last Mile. Configure VirtualHosts
-



Can you tell me how to make it so that tracks appears here:
http://localhost/tracks?
I don’t have a top level domain for this computer. Is there a way to go to tracks and have it work if I did it as you suggested (i.e. http://tracks.localhost doesn’t work)? Thanks.
Stephen