Easy like 1...2...3

Aug 23, 2007 15:10 GMT  ·  By

IIS doesn't support Perl scripts by default, but it's easy to install support for Perl scripts in IIS. The steps for this are: 1. Install IIS 2. Download and install Perl 5 for Windows. 3. Configure Perl scripts maps.

Make sure that you have installed IIS and start the service. After you've installed Perl 5, you can place cgi scripts in any scripts directory. You can add the scripts directory to the Internet Information Server manager and enable the Execute attribute.

There are 2 different methods to configure Perl script maps: for Internet Information Server 1.x, 2.x or 3.x and for Internet Information Server 4.x or later.

Install For IIS 1.x, 2.x, 3.x Start ->Run->type regedt32.exe and open HKEY_LOCAL_MACHINE/ SYSTEM/CurrentControlSet/Services/W3SVC/Parameters/ScriptMap. After that select Add Value from the Edit menu, set Value Name to .pl (or .cgi) and set Data type to REG_SZ, set String value to: perl.exe %s %s. If you installed Perl in C:/PERL, type c:perl inperl.exe %s %s.

Install for IIS 4.x or later Open Internet Service Manager from Control Panel -> Administrative Tools. Right click on your web server name and select Properties. Under Master Properties select WWW Service and click on Edit. Change to the Home Directory tab, click on Configuration, add an .pl entry and click on Edit and set Executable parameter to: perl.exe %s %s . If you installed Perl in C:PERL, type c:perl inperl.exe %s %s.Click on Apply, close Internet Service Manager and restart all Internet Information Server services or better, restart the server machine.

To test if the installation completed properly, create a new .pl file, name it test.pl, open the file and paste the following code:

code
print "HTTP/1.0 200 OK
";
print "Content-Type: text/html

";
print "
";
print "
";
print "Perl Test Page
";
print "
";
print "
";
print "This is a test
";
print "
";
print "
";
print "
";
Copy the file in inetpub/wwwroot/cgi-bin, open your browser and type: http://localhost/cgi-bin/testing.pl.