A348  FAQ

Modified

IIS

Host contacted, waiting for reply - Sometimes the IIS appears to hang, particularly after running ASP scripts or CGI programs. Stopping the transfer on the client will stop the client from waiting but the server may not repond to new requests. According to Microsoft documentation, the server cache fills and it takes a while (sometimes forever) to reclaim cache memory and continue. There are three solutions 1) let the browser wait for a while, perhaps 2 to 20 minutes, 2) reboot, always reliable, or 3) using the Global.Asa file, set the Server.ScriptTimeout = 10;  and Session.Timeout = 1. We should be thankful the usual 'reinstall the operating system' solution isn't required.
<Script LANGUAGE = VBScript RUNAT = Server>
 Sub Session_OnStart
  Server.ScriptTimeout = 10      ' Stop server processing after 10 seconds
  Session.Timeout = 1               ' End session after 1 minute
 End Sub
</Script>
will limit the time the server spends trying to process a script. This can also be set inside of an ASP, the Server.ScriptTimeout  is in seconds and is the maximum time the server will spend processing a script; Session.Timeout is in minutes and is the maximum time the server maintains session information. Its hard to tell if this really prevents the server from hanging, it seems to help and it is needed for timing out client sessions anyway.

Testing CGI's - The server seems especially sensitive to CGIs that run amuck. It is generally possible to test Perl and C++ CGI behavior outside the server by defining environment variables. For Windows OS, the necessary environment variables, such as REQUEST_METHOD can be defined at the DOS prompt by:

set CONTENT_LENGTH = "15"
then in Perl accessed for testing by the same means used when run as a CGI by the server:
$size_of_form = $ENV{'CONTENT_LENGTH'};
Virtual directories - The default location for server scripts/pages is c:\InetPub\wwwroot. To use other directories one must define a virtual directory. Right click on the file folder to make virtual and select Web Sharing. You should put the Global.Asa file in the root of the virtual drive to have it processed for ASP scripts.
 

Global.Asa - An apparent problem requires that the server machine be rebooted for changes to the file to take effect.
.
Perl - Perl can be used as CGI programming language with PWS. Assuming that ActivePerl has been installed on directory c:\Perl then define the directory c:\Perl\bin as a virtual drive named Perl. The Perl interpreter can then be executed with the program path as an argument. Perl program named test.pl located on directory D:\A348 can then be executed by:

localhost/Perl/perl.exe?D:/A348/test.pl
C++ - C++ or any other executeable file can be a CGI program. Assuming that a directory D:\CGI has been defined as a virtual drive named CGI. Any exe file placed in the directory can then be executed. A program named test.exe located on directory D:\CGI can then be executed by:
localhost/CGI/test.exe
Why does the browser try to save the CGI file instead of executing? - The most common problem is due to sending invalid HTTP headers. The header must have:

Content-type: text/html

before any HTML. Sending a cookie must be done before the Content-type.