Originally posted on forums.iis.net
After spending a good bit of time with Google and through trial and error I have found a configuration that appears to support perl using FastCGI on IIS 5.1 and IIS 6.0 using MS's FastCGI Extension for IIS6.0. I have tested it out on a limited basis using both IIS 5.1 on WinXp and IIS 6.0 on a virtual machine copy of Windows 2003 Server running on top of WinXP.
With this setup you setup a specific perl routine to run every time a URL with a specific extension is entered. What use this is I will leave up to you to decide.
A good description of how to configure FastCGI that focuses on PHP:
http://learn.iis.net/page.aspx/248/configuring-FastCGI-extension-for-iis60/
Here are the steps that I took to make it work with perl.
- Configure IIS on both platforms using the default choices.
- Download and install ActivePerl 5.8.8.824 using the msi installer and the default choices. Downloaded from: http://www.activestate.com/store/download_file.aspx?binGUID=45107672-7d2c-4529-85be-4aad89bcd59c
- Using the ppm utility from ActivePerl install the FCGI module from the ActiveState PPM repository.
- Download and install FastCGI using default options. Downloaded from: http://www.microsoft.com/downloads/details.aspx?FamilyID=2d481579-9a7c-4632-b6e6-dee9097f9dc5&displaylang=en and check to make sure fcgiconfig.js, fcgiext.dll and fcgiext.ini were all present in c:\windows\system32\inetsrv.
- In "Local Security Settings" under "User Rights Assignment" add the "Network Service" to "Access this computer from the network". This took me a while to figure out. Now I need to think about potential side effects.
- Using the Internet Information Services manager program:
- Select properties for the "Default Web Site" and then go to the "Home Directory" tab and select "Configuration..." to get "Application Configuration" window.
- Select "Add" to get the "Add/Edit Application Mapping" window.
- Under "Executable:" browse to c:\windows\ststem32\inetsrv\fcgiext.dll and select it.
- Once back at the "Add/Edit Application Mapping" select the value in the "Executable:" window. If you don't do this you will never be able to select "OK". See http://support.microsoft.com/kb/317948 for further details.
- Type in .fcgi into the "Extension" field.
- Check to make sure the "Script Engine" box is checked
- The documentation says that "File Exists" must be checked but based on initial tests this is not the case.
- Press OK.
- Using the Services I restart the "World Wide Web Publishing" service.
- Edit fcgiext.ini to include the lines below at the bottom. Note that what this is going to do is run the perl routine in printenv.fcgi every time you enter anything with an ".fcgi" extension. If you have not selected the checked the "File Exists" above then there will be no checking to make sure the file even exists.
[Types] fcgi=fcgi [fcgi] ExePath=c:\perl\bin\perl.exe Arguments=c:\inetpub\wwwroot\printenv.fcgi
- Placed printenv.fgci into the c:\inetpub\wwwroot directory.
use FCGI; while (FCGI::accept() == 0) { print "Content-type: text/html\r\n\r\n"; while (($key, $val) = each %ENV) { print "$key = $val\n"; } }
At this point printenv.fcgi will run every time you enter the following URL http://yourserver.domain.com/printenv.fcgi. Again note if you have not selected "File Exits" when you setup the application mapping no checking to see if the file on the URL actually exists. In this case http://yourserver.domain.com/mydir/test.fcgi will also run printenv.fcgi.
No comments:
Post a Comment