Wednesday, February 15, 2012

IIS7 FastCgiModule configuration

I won't be using FastCgiModule on IIS7. I had hoped to use it to run Perl scripts and, perhpas, avoid faults I have experienced with the CgiModule on IIS7 on Windows 7, but after several days searching and trying, I did not have any significant progress towards a working solution and had found no documentation from Microsoft that described how the module works or how to do anything with it other than run PHP, so I decided to cut my losses and stop the effort.

Instead, I will use Apache HTTP Server.

There are many examples of configuring IIS7 for FastCGI/PHP, but I am interested in Perl and, in particular, Strawberry Perl.

Enabling FastCGI in IIS7 is easy, just select the CGI feature.

I haven't found thorough documentation of the configuration of FastCGI from Microsoft. Maybe my searching or persistence are insufficient, but all I have seen from them is marketing, how to enable it and examples of configuration for PHP.

Many people have posted examples and instructions for configuration for specific purposes, but these generally present what to do without explaining why or how it works or what the alternatives are. Most of these I have found are for PHP or ActiveState Perl and mostly for older versions of the module and IIS.

One clue that at least got my toe in the water (i.e. enabled me to run perl with arguments) was this post on Catalyst. It showed the unusual (in my experience) feature of separating the executable from its arguments with a vertical bar rather than a space, as is done almost everywhere else. As usual with such examples, there was no explanation.

So, in the Executable field of the Edit Module Mapping window of IIS Manager for the FastCgiModule module, one can put:

'|'

Mysteriously, none of "%s%", %s% or %s get expanded in this context, as they do in the same field for the CgiModule. Obviously, the syntax and semantics of the Executable field are module specific.

So, I wonder what all the possibilities are and how they relate to the specific query being processed.

I wonder where Microsoft has documentation of their FastCGI feature, beyond how to enable it.

The Adding Handlers (add) page really should say more about how the text in the scriptProcessor attribute is parsed, what substitutions are done and how it is processed. If this is, as I suspect it is, module specific, then this should be stated and the documentation of the individual modules should provide details of what the module does with the attribute value.

The instructions at CosmicScripts.com refer to C:\windows\system32\inetsrv\fcgiext.ini but there is no such file on my Windows7 system, even though I have the FastCgiModule module installed and configured and executing Perl script. Although this page lists IIS7, the configuration page says "coming soon" for IIS7. I note also that the FCGI::IIS module documentaiton says IIS7 is supported, and refers to the CosmicScripts site for configuration instructions.

The environment of the script I have running has a variable named _FCGI_X_PIPE. This is the only variable that appears to be relevant to FCGI. Searching Microsoft for references to this variable name, there are two Japanese article found and KB980363, which provides a brief description. There are only 17 hits searching MSDN, and they almost all give the same information. None of them describe how the interface works.

this post mentions where IIS7 keeps configuration of the FastCgiModule module: in applicationHost.config, along with other IIS configuration. That file exists on my Windows7 system with IIS7, and it does have some of my configuration for the FastCgiModule module, though it is hard to be sure it is all there.

After many hours of searching, I have found so little other than examples of how to configure for PHP that I am not inclined to pursue using IIS/FastCgiModule with Perl.

No comments:

Labels