Getting Lighttpd and RequestTracker working together

I had been fighting for a while to get my lighttpd server to serve up Request Tracker via FastCGI, but I was always having minor configuration issues with it. I finally dug up a handy recipe for a Mason (which is what Request Tracker uses) FastCGI script for use with lighttpd. After incorporating the changes necessary to deal with lighttpd's quirks, I managed to get things working as well as I would like. The following is the diff generated from the stock mason_handler.fcgi script that comes with Request Tracker:

--- mason_handler.fcgi.orig     2006-09-30 16:45:18.000000000 -0400
+++ mason_handler.fcgi  2006-09-01 18:05:16.000000000 -0400
@@ -65,6 +65,16 @@
     $ENV{'ENV'}    = '' if defined $ENV{'ENV'};
     $ENV{'IFS'}    = '' if defined $ENV{'IFS'};

+    my $uri = $ENV{REQUEST_URI};
+    if ($uri =~ /\?/) {
+      $uri =~ /^(.*?)\?(.*)/;
+      $ENV{PATH_INFO} = $1;
+      $ENV{QUERY_STRING} = $2;
+    } else {
+      $ENV{PATH_INFO} = $uri;
+      $ENV{QUERY_STRING} = "";
+    }
+
     Module::Refresh->refresh if $RT::DevelMode;
     RT::ConnectToDatabase();

And the portion of my lighttpd configuration file handling Request Tracker:

  server.document-root = "/usr/local/share/html"
  fastcgi.map-extensions        = ( ".css" => ".html", ".js" => ".html", "/" => ".html" )
  index-file.names              = ( "index.html" )
  url.access-deny               = ( ".mhtml" )
  fastcgi.server                = ( ".html" =>
                                        ((
                                                "socket"        => "/tmp/rt-fcgi.socket",
                                                "bin-path"      => "/usr/local/bin/mason_handler.fcgi",
                                                "check-local"   => "disable",
                                                "min-procs"     => 2,
                                                "max-procs"     => 2
                                        ))
                                )

Leave a comment

About Me

I am a software developer for Six Apart living outside of Baltimore, MD. I have written a number of plugins for Movable Type, including the award winning MultiBlog, which has (as of MT 4) been integrated into the base application....
More...

Recent Entries

  • The Olympics Make Me Want To Complete Again

    Every time the Olympics come around (most the summer ones) I always start to delude myself into thinking I could complete once again in the...

  • Minimalist plugins are fun!

    Last night I whipped up one of the smallest plugins I’ve ever written. It is so small in fact that I was able to stuff...

  • Feedburner Widget on MT News

    Movable Type News A WordPress 2.5 Upgrade Guide: And of course there are lots of third-party plugins for the MT dashboard, to integrate statistics and...

  • AD&D Monster Stats for the Presidential Canditates

    Charles Stross (scifi author, D&D nerd, and former perl columnist) posted Politics as she is Played with 3d6: The recent death of Gary Gygax, who...

  • Feedburner Widget 0.3

    At this point, I am really tempted to drop the ‘Widget’ from the name of the plugin, since it is doing so much more...

Close