I have IIS 7.0 on Vista Business and ActivePerl. However I can't get perl to run. Can you help?
When I run a test program I get this
HTTP Error 502.2 - Bad Gateway
Description: The specified CGI application did not return a complete set of HTTP headers.
Error Code: 0x00000000
Notification: ExecuteRequestHandler
Module: CgiModule
Requested URL: http://localhost:80/cgi-bin/hello.pl
Physical Path: C:\inetpub\wwwroot\cgi-bin\hello.pl
However I can run the program from the command line
C:\Users\Bob> C:\inetpub\wwwroot\cgi-bin\hello.pl
Content-Type:text/html
<HTML>
<HEAD><TITLE>Hello World!</TITLE></HEAD>
<BODY>
<H4>Hello World!</H4>
</BODY>
</HTML>
In the default Web Site I have a handler set up - The executable is in C:\Perl\bin\perl.exe. The mapping screen shows this.
Perl *.pl Enabled File CgiModule Local
The file permissions for hello.pl are for the user IIS_IUSRS: Read & Execute and Read
The server log is not much help
2007-05-25 14:55:46 ::1 GET /cgi-bin/hello.pl - 80 - ::1 Mozilla/4.0+(compatible;+MSIE+7.0;+Windows+NT+6.0;+SLCC1;+.NET+CLR+2.0.50727;+.NET+CLR+3.0.04506) 502 2 0
I tried turning offf the (Norton) firewall but no change.
I set up the tracing as described in http://www.iis.net/default.aspx?tabid=2&subtabid=25&i=969&p=1 (fantastically clear instructions!)
IIS Diagnostics Output |
| Url: |
http://localhost:80/cgi-bin/hello.pl |
| Site: |
1 |
| App Pool: |
DefaultAppPool |
| Process: |
5032 |
| Authentication: |
anonymous |
| User from token: |
NT AUTHORITY\IUSR |
| Activity ID: |
{00000000-0000-0000-0400-0080000000FC} |
| Failure Reason: |
STATUS_CODE |
| Final Status: |
502.2 |
| Time Taken: |
483 msec |
IIS Trace Detail Highlights |
| No. |
|
EventName |
Details |
Time |
IIS Trace Detail |
| No. |
|
EventName |
Details |
Time |
| 1. |
| GENERAL_REQUEST_START |
SiteId="1", AppPoolId="DefaultAppPool", ConnId="39862976", RawConnId="39862984", RequestURL="http://localhost:80/cgi-bin/hello.pl", RequestVerb="GET" |
16:08:53.862 |
| 2. |
| GENERAL_GET_URL_METADATA |
PhysicalPath="C:\inetpub\wwwroot\cgi-bin\hello.pl", AccessPerms="513" |
16:08:53.862 |
| 3. |
| CGI_START |
|
16:08:53.862 |
| 4. |
| GENERAL_CGI_HANDLER |
|
16:08:53.862 |
| 5. |
| CGI_LAUNCH |
CommandLine="C:\Perl\bin\perl.exe", ErrorCode="The operation completed successfully. (0x0)", ProcessId="2500" |
16:08:53.924 |
| 6. |
| CGI_REQUEST_ENTITY_SENT |
|
16:08:53.924 |
| 7. |
| CGI_PREMATURE_TERMINATION |
Headers="" |
16:08:54.330 |
| 8. |
| CGI_END |
|
16:08:54.330 |
| 9. |
| GENERAL_SEND_CUSTOM_ERROR |
HttpStatus="502", HttpSubStatus="2", FileNameOrURL="502.htm" |
16:08:54.330 |
| 10. |
| GENERAL_FLUSH_RESPONSE_START |
|
16:08:54.345 |
| 11. |
| GENERAL_FLUSH_RESPONSE_END |
BytesSent="2537", ErrorCode="The operation completed successfully. (0x0)" |
16:08:54.345 |
| 12. |
| GENERAL_REQUEST_END |
BytesSent="2537", BytesReceived="645", HttpStatus="502", HttpSubStatus="2" |
16:08:54.345 |