MDLog:/sysadmin

The Journal Of A Linux Sysadmin

HowTo Install Tracks on Debian

| Comments

Tracks is a web-based application to help you implement David Allen’s Getting Things Done™ methodology. It was built using Ruby on Rails, and comes with a built-in webserver (WEBrick), so that you can run it on your own computer if you like. It can be run on any platform on which Ruby can be installed, including Mac OS X, Windows XP and Linux. Tracks is Open Source, free and licensed under the GNU GPL.

I have been using tracks for some time now, as it was the best choice I could find for a ToDo software that was simple but also good looking, like some of the commercial applications that are out there. Since recently I had to move my installation to another server, I thought to document it and hopefully this might be useful for other peoples also. The official project docs are a little outdated and don’t take advantage that now debian etch has full support for all the needed dependencies and they can be easily installed from debian repositories (except tracks itself ;–) ).

The instructions will show how you can install and run tracks using MySQL and the built-in WEBrick server. You can run trakcs with SQLite/SQLite3 or Postgresql if you prefer, and for this look into the installation.html file that comes with the source.

1. Install Ruby on Rails

First we need to install the tracks dependencies. I will assume that you have already a mysql server installed and running (if not just aptitude mysql-server). To install ruby, rails and the needed ruby packages just run:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
**aptitude install ruby rdoc rake rails rubygems libmysql-ruby libzlib-ruby liberb-ruby**
Reading package lists... Done
Building dependency tree... Done
Reading extended state information
Initializing package states... Done
Reading task descriptions... Done
Building tag database... Done
The following NEW packages will be automatically installed:
irb irb1.8 libgems-ruby1.8 libmysql-ruby1.8 libopenssl-ruby1.8 libreadline-ruby1.8 libredcloth-ruby1.8 libruby1.8 rdoc1.8 ruby1.8
ruby1.8-dev
The following NEW packages will be installed:
irb irb1.8 liberb-ruby libgems-ruby1.8 libmysql-ruby libmysql-ruby1.8 libopenssl-ruby1.8 libreadline-ruby1.8 libredcloth-ruby1.8
libruby1.8 libzlib-ruby rails rake rdoc rdoc1.8 ruby ruby1.8 ruby1.8-dev rubygems
0 packages upgraded, 19 newly installed, 0 to remove and 0 not upgraded.
Need to get 5736kB of archives. After unpacking 26.0MB will be used.
Do you want to continue? [Y/n/?] y

As you can see this will install some dependencies, but after this finishes we are done…

2. Tracks installation

Just follow the steps outlined in the installation documentation: – download the source – unzip it somewhere on your system (let’s say /var/www/tracks) – prepare the mysql database and user:

1
2
3
4
mysql -uroot -p
mysql> CREATE DATABASE tracks;
mysql> GRANT ALL PRIVILEGES ON tracks.* TO tracksuser@localhost \
IDENTIFIED BY 'tracks-password' WITH GRANT OPTION;
  • open tracks/config/database.yml and comment out the SQLite3 lines and configure the production and development sections for mysql. This should look like (don’t use TABS in any of the *.yml files. Just use spaces to indent):
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# MySQL settings
development:
  adapter: mysql
  database: tracks
  host: localhost
  username: tracksuser
  password: tracks-password

production:
  adapter: mysql
  database: tracks
  host: localhost
  username: tracksuser
  password: tracks-password
  • open tracks/config/environment.rb and edit the line SALT = “change-me” to something of your choosing.
  • Run ‘rake migrate’, which will create the necessary tables in your database, including some required contents:
1
2
cd /var/www/tracks
rake migrate

NOTE: for MySQL you will need to have innodb support enabled in your server since most tracks tables are innodb. If you don’t have this the rake migrate command will fail. So be sure to have this enabled.

3. Tracks usage

We are now ready to run tracks. We will use for this the build in WEBrick server (if you have other ruby application running on the system you will want to change the default 3000 port). Also will not run it as root but as a normal user (www-data the apache user):

1
2
cd /var/www/tracks
su www-data -c "ruby script/server -e production" &

In a browser go to _http://yourhost:3000/signup_ and you will have to choose a username and password for the admin user. Thereafter, anyone else trying to access /signup will get a message that they are not allowed to sign up, and are given your email address to contact for permission.

Now you can login and start using tracks. Add some contexts, some projects and you are ready to tracks… Have fun!

Comments