Setting up Tracks on TextDrive
A few tips about getting Tracks, BSAG's GTD application, up and running on TextDrive.
Posted on 2005-12-02 23:53 by Jørn Støylen [permalink]
Updated 2005-12-04: Fixed a few things pointed out by BSAG. Thanks!
Updated 2006-06-15: This article has been revised to be more generic and timeless.
Setting up Tracks on TextDrive isn’t exactly straightforward. I’ve spent several hours figuring out how to do it and I’ve written this article in the hope that it might save others a few patches of hair.
Set up Lighttpd
Get Lighttpd going if you haven’t already. There are already good instructions for doing that over at TextDrive. This took me an hour or two (Tip: Start by filing a ticket for a port number for Lighttpd!), but wasn’t really hard, and heaven knows Lighttpd is much less daunting than Apache! (I did end up having to get some help from TxD staff, because my attempt at configuring it all didn’t quite work. Unfortunately, I’m not sure what they did — if I were, I would have included that here too.)
Get Tracks
Of course, you need to get and install Tracks, which is documented well enough on the Tracks project site.
Change the shebang line in dispatch.fcgi (and permissions)
By default, the “shebang” line (the first line, which tells the server where it can find a program for running the script) in public/dispatch.fcgi says:
#!/usr/bin/env ruby
This doesn’t work on TextDrive unless you set up that environment variable. So you can either do that or change the shebang line to:
#!/usr/local/bin/ruby
Also, give dispatch.fcgi execute permissions:
chmod 744 dispatch.fcgi
Set the bin-environment variable in lighttpd.conf
Or else, apparently, Tracks won’t find your database.yml file and will instead try to connect to the database as root.
Actually, I might as well give you the whole, working $HTTP[“host”] section of my lighttpd.conf file. Of course, you should replace paths/usernames with your own.
Personally, I set up Tracks on my default textdriven.com subdomain (the one I got as I signed up witih TextDrive), since I wasn’t using that for anything else. I put Tracks in the “public” directory, which makes the path look a bit odd (”...public/tracks/public/”). It’s a good idea to put it somewhere outside your “public” directory, to keep your database.yml file safe from, well, the public.
I haven’t tried setting up a Rails application on just a subdomain, having the rest of the domain run on Apache, so I’m not sure if that’s more complicated. (For example, having domain.com running Apache, but tracks.domain.com on Lighttpd.) So if this is what you want, you’re a bit more on your own. (But please feel free to write about your endeavors in the comments if you do!)
I wish I could tell you what everything means (especially the fastcgi.server part of it), but at least it works.
$HTTP["host"] =~ "DOMAIN\.COM" {
server.document-root = "/PATH/TO/tracks/public/"
server.errorlog = "/users/home/USERNAME/web/lighttpd/log/lighttpd-error.log"
accesslog.filename = "/users/home/USEDRNAME/logs/access_log"
server.indexfiles = ("dispatch.fcgi", "index.html")
server.error-handler-404 = "/dispatch.fcgi"
fastcgi.server = (".fcgi" => ( "tracks" => (
"min-procs" => 1,
"max-procs" => 5,
"socket" => "/tmp/ruby-tracks.fastcgi",
"bin-path" => "/PATH/TO/tracks/public/dispatch.fcgi",
"bin-environment" => ( "RAILS_ENV" => "production" )
) ) )
}
Comments
Comments closed
Commenting is closed for this article.


Nice write up, but here’s a couple of points:
1. You shouldn’t run Rails apps under ‘development’ on Textdrive, so make sure that you change the bin-environment line to ‘production’ in your lighty config.
2. It’s a good idea to keep your Tracks directory outside your web/public directory because of potential security worries about having your database details in database.yml. I would put it in another directory under your home (say ~/sites), and then just change server.document-root and bin-path appropriately.
Hope that helps, and have fun with Tracks!
BSAG: Hi, and thanks for your comments! I updated the article to reflect your remarks.
Right now I’m struggling a bit with Tracks, though. It doesn’t want to delete projects, or change status from “done” back to “not done” for actions. And there seems to be some caching issues, too—or maybe it’s all related …
Tracks 1.03 has a bug when used with Rails 0.14.x (which is installed at Textdrive), in which items (also projects and contexts) can’t be deleted from the application. It’s fixed in the development version, but in the mean time, you might have to try to use a previous version of rails.
You should be able to check out the 0.13.1 version of rails into the ‘vendor’ directory of the Tracks distribution. I can’t put the code here because the comment gets caught by mod_security, but email me if you want the full instructions.
There’s some discussion of doing something similar with the ‘Edge’ version of Rails here
Hopefully, the next version of Tracks will be out soon, and you won’t have to deal with this hassle!
Jørn:
thanks – this is exactly what I needed. Getting this up and running on TextDrive (as opposed to localhosting) is not exactly straightforward, and you’ve laid it all out here pretty well.
cheers
Alan
Alan: Glad to help! Did you get anywhere on the deletion bug, did you for example manage to install Rails 0.13.1 in the vendor directory?
I wondered about that – I tested it and found no problems.
It seems that getting a copy of Tracks by svn – even specifically using bsag’s instructions to get 1.03 – appears to have given me the latest rev 168 instead.
Which means I’ve got a fixed version of Tracks. I think.