You are currently offline, waiting for your internet to reconnect

Configuring and Testing a PERL Script with Internet Information Server (IIS)

This article was previously published under Q150629
This article has been archived. It is offered "as is" and will no longer be updated.
We strongly recommend that all users upgrade to Microsoft Internet Information Services (IIS) version 6.0 running on Microsoft Windows Server 2003. IIS 6.0 significantly increases Web infrastructure security. For more information about IIS security-related topics, visit the following Microsoft Web site:

The following PERL script can be used to test for the proper installationand execution of CGI scripts with Internet Information server.
Create a file with Notepad, and type the following lines of code. Save thefile in the scripts directory as
print "HTTP/1.0 200 OK\n";print "Content-Type: text/html\n\n";print "<HTML>\n";print "<HEAD>\n";print "<TITLE>Hello World</TITLE>\n";print "</HEAD>\n";print "<BODY>\n";print "<H4>Hello World</H4>\n";print "<P>\n";print "Your IP Address is $ENV{REMOTE_ADDR}.\n";print "<P>";print "<H5>Have a nice day</H5>\n";print "</BODY>\n";print "</HTML>\n";				

Once you have created the file, you need to configure PERL to run securelywith Internet Information. Perl.exe should not be located in any of thedirectories accessible by a user with a browser.

With a script mapping in the registry, you can place the Perl.exe outsideof the normal directory structure a user has access to.

To configure PERL script mapping

WARNING: Using Registry Editor incorrectly can cause serious, system-wideproblems that may require you to reinstall Windows NT to correct them.Microsoft cannot guarantee that any problems resulting from the use ofRegistry Editor can be solved. Use this tool at your own risk.
  1. Start Regedt32.exe and open the following registry key:

  2. Click Add Value from the Edit menu.
  3. The Value Name is .pl
  4. The Data type is REG_SZ.
  5. The String value is <the full path to perl.exe>\perl.exe %s %s

    NOTE: The "%s %s" is case sensitive. (e.g. "%S %S" will not work).
  6. Restart the WWW service.
Now that the registry has been configured, you can test the PERL scriptwith your browser. Using the defaults directory structure with IIS, theURL would be the following:
http://<Server Name>/scripts/

Article ID: 150629 - Last Review: 12/04/2015 14:39:53 - Revision: 2.2

Microsoft Internet Information Server 1.0, Microsoft Internet Information Server 2.0, Microsoft Internet Information Server 3.0

  • kbnosurvey kbarchive kbinfo KB150629