How to have FootPrints 4.3 running with Apache 1.3.12 under Windows NT

Abstract

This article describes how to configure the Apache web server running on a Win32/Intel platform and how to adapt the FootPrints 4.3 (by UniPress) Software to have this helpdesk and issue-tracking tool running nicely without the recommended IIS.

The problem

My organization is using the Apache server using a virtual hosts (multiple logical webs served by one machine) configuration as a corporate web server. A few days ago, we purchased the FootPrints (version 4.3) bug tracking and helpdesk software. Officially, FootPrints in a Win32/Intel environment runs under Microsoft's IIS. Apache is not mentioned. I have set up an IIS machine and, in fact, FootPrints runs nicely the associated Perl scripts.
Since I'm a rather lazy guy, I was wondering whether it was possible to run FootPrints on my existing Apache web server, as one additional host...
So I installed the FootPrints software on my Apache server along with Perl 522, and it did not work so well...
So I started to investigate...
And found some solutions...!

Web Server Configuration (basic items only)

Platform: Intel
OS: Windows NT Server, Service Pack 6
HTTP Server: Apache 1.3.12 for Win32 (running as an NT Service)
Software: Perl 522 located in c:\perl\bin, FootPrints located in d:\footprints

Important NOTE: I have associated the ".pl" file extension with "c:\perl\bin\perl.exe %1 %*"

Apache Server Setup

Since we are running virtual hosts here, I have added a virtual host like this (httpd.conf file):

<VirtualHost 10.1.1.14>
    ServerName KMOFP
    ServerAdmin mohnhaup@mscgva.ch
    # The next (magic!) line is one part of the secret. See NOTE!!!
    ScriptInterpreterSource registry
    # The next aliases are those required by FootPrints 4.3
    Alias /MRcgi D:/footprints/CGI
    Alias /MRimg D:/footprints/HTML/MRimg
    Alias /help D:/footprints/HTML/help
    Alias /footprints D:/footprints/HTML
    Alias /tmp D:/footprints/HTML/tmp
    DocumentRoot /footprints 
    DirectoryIndex index.htm 
    ErrorLog logs/footprints-e.log
    CustomLog logs/footprints-a.log common
</VirtualHost>


In this configuration, you see the path aliases as they are set up for IIS.

NOTE: The Apache ScriptInterpreterSource directive can have two values: 'script' (the default) and 'registry'. When 'script' is set, Apache reads the 'shebang' string at the beginning of a script (the "#!/usr/local/bin/perl" line) to run the program that executes the script (the perl interpreter in this case). In the case of 'registry', Apache searches for the executable associated with the file extension. This simple trick makes that Apache nicely executes the scripts without any modification of the source code.

FootPrints bug(?) in MRLib.pl

At his point, everything seemed to work nicely, except that 'search my ticket number' was generating an "Internal FootPrints Error". After some debugging, I saw that no parameters were passed to the MRDetails.pl script. Tracing back, I did a slight modification in MRLib.pl, routine ReadParse:

....
    if ( $in_copy ) elsif ($ENVREQUEST_METHOD eq "GET") ;
    } elsif ($ENVREQUEST_METHOD eq "POST") );
    } elsif ($ENVREQUEST_METHOD eq "STDIN")
    } else
    
    # Seems there is a parameter passing problem with Apache. 
    # I have solved it in this way. 
    # 28-Sep-2000, Martin Mohnhaupt, mohnhaup@nicedata.com
    if ($in eq "")
...

After applying this change, I could see my tickets by number.
So far so good...

Problems with FootPrints calling OS commands

I noticed that when creating a new project, I received an HTTP 500 (internal server error) with following message (Apache log):

10.1.1.53 - - [29/Sep/2000:11:00:43 +0200] "POST /MRcgi/MRnew_proj.pl HTTP/1.1" 500 600
[Fri Sep 29 11:34:21 2000] [error] [client 10.1.1.53] malformed header from script. Bad header= 1 file(s) copied.: d:/footprints/cgi/mrnew_proj.pl


One knows, that the OS copy command sends "n file(s) copied." to stdout. To do cgi stuff, the perl scripts write to stdout (print "..." commands). This is what generates the mess. To circumvent this issue, I have modified the RMCopy, RMDelete, and RMmove perl routines in MRLib.pl by adding "> NUL" at the end of the NT command. The effect of this is that all OS messages are redirected to nowhere... Example (sub Rmcopy):

   sub MRcopy
       $copyCommand = "cp";
       $copyCommand = "copy" if ($NT ne "");
       $exitcode = system "$copyCommand $sourcefile $destinationfile > NUL";
       return ($exitcode); ### assuming everything went OK.
   }


Now everything runs nicely and smoothly... even under Apache for Win32!!!