IIS, Perl

Enable Perl 5.20 on Windows IIS

The IIS configuration dialogues will differ between IIS versions.  This post used IIS 6 on Windows Server 2003.

 

1. Download and Install ActiveState Perl from the Official website

https://www.perl.org/

Ensure the correct MSI installer file, 32-bit or 64-bit, is downloaded based on your current Windows operating system.  Make note of the installation location.  You will need this information later for IIS configuration.

2. Define New IIS Application Extension

Perl will be enabled on the Default Web Site.

Start the Internet Information Services (IIS) Manager using
Control Panel >> Administrative Tools >> Internet Information Services Manager.

CP_Admin_IIS_manager

On the Internet Information Services Manager window above, click Web Sites  on the left pane.  On the right pane, right-click the Default Web Site to display the pop-up menu as shown below.

IIS_manager1

Select Properties from the above pop-up menu.  The Default Web Site Properties window is displayed below.  Click on the Home Directory tab.

IIS_manager2

Click on the Configuration button.  The Application Configuration window below is displayed.

IIS_manager3

Click on the above Add button.  The below blank Add/Edit Application Extension Mapping window is displayed.

IIS_manager4a

Find the installation location of the Perl executable module by using the Browse button.

The entries used for my installation are as follows –

  • Executable: C:\Perl\bin\perl.exe “%s” “%s”
  • Extension: *.pl   (to designate a perl script)
  • Limit to: GET, HEAD,POST
  • Check mark the Script engine and Verify that the file exists check boxes.

The below window represents the completed application extension mapping.

IIS_manager_aem_perl

Click OK to complete adding Application Extension Mapping.

Click OK to the Application Configuration window.

Click OK to the Default Web Site Properties window.

3. Define New IIS Web Service Extension

On the IIS Manager, click Web Service Extensions on the left pane.

IIS_manager5

Click on the Tasks link, Add a new Web service extension…

The New Web Service Extension window below is displayed.

IIS_manager6

Enter the following information –

  • Extension name: Perl
  • Set extension status to Allowed: Click the check box
  • Click the Add button to provide Required files information

The Add file window below is displayed.

IIS_manager7

Using the Browse button, find the location of the Perl executable module.

Click OK for all windows to complete the new Web Service Extension.  Below is a snippet of all windows used in this dialog.

IIS_manager_wse_perl

Restart IIS using iisreset from the command prompt window below.

IIS_restart

Congratulations!  Perl is now installed and configured on IIS.

4. Validate Perl on IIS

To test Perl on IIS, save the below test script to your IIS web directory, typically, C:\Inetpub\wwwroot, as test.pl.

#!/usr/bin/perl

# Perl test script
# test.pl


# Browser output always starts with content-type statement followed by a blank line
print "Content-type: text/html";
print "\n\n";

# Browser HTML
print "<html>";
print "<head>";
print "<title>PERL-Test</title>";
print "</head>";
print "<body>";
print "<hr>";
print "<h1>PERL</h1>";
print "<h3>Howdy Y'all from me PERL...</h3>";
print "<hr>";
print "</body>";
print "</html>";

On your browser address bar, enter  http://localhost/test.pl
 Note:This address will vary based on where test.pl is installed.

You should see a similar page as shown below.

Perl_Test_Browser

Enjoy using Perl scripts on IIS!

Leave a Reply

Your email address will not be published. Required fields are marked *


CAPTCHA Image
Reload Image

This site uses Akismet to reduce spam. Learn how your comment data is processed.