HOWTO: Tracks + Debian + Apache 2 + SSL + FastCGI

I recently got the Tracks personal task management software and installed it and started using it. It currently contains 41 actions for me to execute. When I am done with this blog entry, there will be just 40. Everything must go in there.

One of the crucial things about software like this is that it must be easily accessible from where I am. I am trying to get to where I can use a Palm and my cellphone's voice recorder as intermediate storage for when I am completely disconnected. The rest of the time I am taking advantage of Tracks' web-app nature. I previously reported some troubles getting this strategy to work. I have now largely solved them…


For Tracks to be most useful, it needs to integrate with my existing home webserver, which is Apache 2 (on Debian Linux). For my comfort, I want my Tracks accesses to be SSL-encrypted, so that my super-secret tasks stay secret.

Part of the puzzle is just getting Apache 2 to do sensible name-based virtual hosting; I solved that one.

Unfortunately, Apache 2 is also hard to configure for Tracks. Once you've done so, you'll find that it is so piggishly slow that it actually breaks the "AJAX" JavaScript that makes the thing work properly—you'll need to put up "FastCGI" support to get this to work.

Note that my solution is currently working with my Debian stable Apache server, which means Apache 2.0. There are reports that FastCGI is somewhat broken in Apache 2.2.

Here's how to get it all going:

  1. You'll need to install a bunch of Debian packages. I'm assuming you've already installed Apache 2. You'll also want (if my notes are correct):

    Maybe there's more I've forgotten; my notes are horrible.

  2. Here is my Apache 2 configuration for all of this.
    FastCgiServer /var/www/tracks/public/dispatch.fcgi -idle-timeout 120 \
      -initial-env RAILS_ENV=production -processes 2
    <VirtualHost *:443>
      SSLEngine On
      SSLCertificateFile /etc/apache2/ssl/apache.pem
      ServerName tracks.po8.org
      DocumentRoot /var/www/tracks/public
      ErrorLog /var/log/apache2/tracks.po8.org-error.log
      CustomLog /var/log/apache2/tracks.po8.org-access.log common
      <FilesMatch "\.(cgi|fcgi)$">
        SSLOptions +StdEnvVars
      </FilesMatch>
      <Directory "/var/www/tracks/public">
        Options +ExecCGI +FollowSymlinks +MultiViews
        SSLOptions +StdEnvVars
        SSLRequireSSL
        AllowOverride all
        Allow from all
        Order allow,deny
      </Directory>
    </VirtualHost>
    
  3. I'm assuming you've already got a working Tracks under WeBrick installed in /var/www/tracks. If not, please go do this now, following the Tracks instructions.
  4. Make sure that everything in /var/www/tracks is www-data.www-data and that public/dispatch.fcgi is executable.
  5. As far as I can remember, it should just work now. Please let me know if I have dropped a step.

I should credit the several web HOWTOs I got much of this information from. Unfortunately, I lost my list in a browser crash. I can at least point at some things by re-Googling.