Recently I wrote a post on Habré about how easy it is to
install Windows Web Server 2008 R2 and set up a Wordpress site on it . In the comments, the Habrayuser
KorP offered to write instructions on how to configure Perl. The theme is good and useful, especially since Perl was my first language for web development and a favorite tool for parsing texts. Therefore, I bring to your attention a small instruction on how to configure it.
Requirements
We will install on IIS 7.x, i.e. The OS must be Vista / Windows 7 / Windows Server 2008 / R2.
For installation on IIS we take
ActiveState ActivePerl . ISAPI extension is only for the x86 version of Perl, so we will install the 32-bit version.
Step 1. Install ActivePerl
Run the installation wizard, specify the directory (I have C: \ Web \ Perl86 \), leave all the other default settings and install ActivePerl. The ActivePerl installer, unfortunately, does not register the settings for IIS 7.x, so you have to go through the following steps.
Step 2. Configuring Perl on IIS 7.x
First you need to associate the required extension with the perex30.dll ISAPI module, for this in the IIS Manager snap-in for the site for which you need to configure Perl support, select Handler Mappings, then on the right in the taskbar select
Add Module Mapping ... and enter the necessary data in the opened dialogue.
- Request Path: * .pl (extension for processing perl)
- Module: IsapiModule (module type)
- Executable: C: \ Web \ Perl86 \ bin \ PerlEx30.dll (the extension itself)
- Name: PerlISAPI (name for convenience)

')
After saving, a dialog box will appear in which you need to click Yes to allow this ISAPI extension.
If you have a 32-bit OS, then the setup is complete. If 64-bit, then another simple step is described further.
Step 3. Configure the Application Pool (x64 systems only)
In IIS Manager, you need to open the Application Pool, within which the website for which Perl is configured is running. For example, it can be DefaultAppPool if Perl support is configured for the default website.
In the Application Pool list in IIS Manager, you need to select the corresponding pool and on the list of tasks on the right click on the
Advanced Settings ... link and in the opened window set True to enable
Enable 32-Bit Applications .

Step 4. Verify the Perl installation
Of course, we write the application Hello World!
Create a file test.pl in the site directory, write there something like:
$url = "http://$ENV{SERVER_NAME}$ENV{URL}";
print <<ENDOFTEXT;
HTTP/1.0 200 OK
Content-Type: text/html
<HTML><HEAD><TITLE>!</TITLE></HEAD><BODY><H1>$url</H1></BODY></HTML>
ENDOFTEXT
exit(0);
Contact localhost / test.pl , look at the result and smile :).
