back forward index

Answers to Microsoft Webserver Problems.

Table of Contents

  1. Microsoft Server Installation considerations (IIS,PWS )
  2. What is the difference between CGI and ISAPI ...?
  3. Where can I find the FAQs... ?
  4. PerlIS Problems and solutions... ?
    1. What is PerlIS?
    2. How do I run a CGI-script using PerlIS?
    3. What does PerlIS do with errors?
    4. What doesn't work with PerlIS?
    5. Where are the environment variables under perlis.dll ?
    6. Debugging Tip


What do I Change in IIS... ?

The animated gif above shows how to make an association for IIS ,Peer web Services or Personal Web server for Perl.
These associations are automatically done for you when you install perlis.dll Here's the configuration changes I needed to make for Perl 5 to work on IIS on an NT 3.51 release/NT 4.0 release(service pack 3).
Perl is in c:\perl 1) Control Panel, System Add to the Path: c:\perl\bin . Done automatically on install. 2) Run the Registry editor program regedit.exe. HKEY_LOCAL_MACHINE, System, Services, W3svc, Parameters, ScriptMap .pl:REG_SZ:c:\perl\bin\perl.exe "%s" "%s" See the above gif.. 4) IIS Directory Settings Execute

5) Restart the Web server service.

Some information is described about this in Chapter 8, page 85, Section:
Running Your Application, Sub-Section: Associating Interpreter with
Applications in the Microsoft Internet Information Server 1.0 Installation
and Planning Guide.

There should be something in the docs for the newer versions also but I'm not running them right now.

Back to Top


What is the difference between CGI and ISAPI ...?

CGI is the common gateway Interface.It is a way of extending the server's functionality
by defining a way for the server to spawn and communicate with an external executable or script
and return the results generated by the executable to the client.
In ISAPI which is a microsoft server specific standard there is no concept of a separate executable
Instead there is a dll (in our case perlis.dll) which gets loaded into the address space of the server
So when a request comes in to interpret a perl script there is no need to spawn a new executable which is a
costly process on NT but the In-process dll does the interpretation.Sounds like a good idea,however there are minor
differences which can cause major frustrations.
For more on ISAPI
What is PerlIS?
Back to Top


Where can I find The Faqs... ?

You might be interested in getting the FAQ for the IIS. The FAQ
covers general IIS information, ISAPI, WinCGI, IDC and HTTP questions.

Excerpts from the PerlIS FAQ

What is PerlIS?

PerlIS is a high performance perl interpreter for the Microsoft Internet Information Server.
The Microsoft Internet Information Server uses an API called ISAPI.
PerlIS.dll uses this API to improve efficiency.
Microsoft IIS uses a single thread per request, so requests use less resources, and take less time.

Back to Top


How do I run a CGI-script using PerlIS?

The Release Version of Microsoft's Internet Information Server does support
associations. If there were no errors during the
install procedure, then all you will need to do to run a perl cgi-script,
is to reference it directly in the URL
e.g

http://www.myhost.com/cgi-bin/myscript.plx
if .plx was the extension you chose to use as the association during
installation of perlis.

Back to Top


What does PerlIS do with errors?

The first error PerlIS encounters after loading, causes an entry to be added
to the server's eventlog. This entry points to a text
file that will contain any further errors. Any output to stderr is also
written to this log file. This file is generally stored in the
same directory as PerlIS.dll.

Back to Top


What doesn't work with PerlIS?

Since Perl scripts run by PerlIS are run in the same process space as the
Internet Information Server, there are a few
process-related calls that are broken in PerlIS.
Here is the current list:

Current working directory:
The Current working directory of the perl script being executed is the
working directory of the web server. This should
NOT be changed by the perl script as this will affect all other perl
scripts running with the server. Perl scripts that
will be run with PerlIS will require absolute pathnames.

This bug has been around since version 1.0 check out The Microsoft Knowledge base Thanks to Mike Wickenden for the pointer.

Shell escapes:
None of the shell escape or process spawing calls will work unless the
IUSR_HOSTNAME account has all needed permissions
This includes but is not limited to:

  1. System (This can work if permissions are set correctly)
  2. Backticks
  3. NTSpawn
  4. Exec and it's entire family.
Needed permissions may include read permissions to windows and system or system32 directories.
Back to Top


Where are the enviroment variables ?

In order to save script execution time the ENV array is a magic hashthat is
not built at startup but rather as queries are made to it. This saves
startup time on small/medium scripts and very few scripts require the entire
ENV hash. Since the left side of the environment string array
(i.e. =) is constant during each invocation of the IIS ActiveState felt that the delayed building of the environment hash would be a fair
trade for the improved startup time of the script.

Back to Top


Debugging tip

If you feel that your script is not executing and permissions are not correctly set
(for Nt users only) you can use the Event Log to advantage.
Just choose to log all events in the security log options
and then check the log to see what is the cause of the permissions problem.

Back to Top


Page © 2002Robin S. Chatterjee

Updated on 1st April 2002

back forward index