Connecting Tech Pros Worldwide Forums | Help | Site Map

Python and IIS 7 - "HTTP Error 502.2 - Bad Gateway"

scubak1w1's Avatar
Member
 
Join Date: Feb 2008
Location: nr. Denver, CO
Posts: 47
#1: Apr 10 '09
Hello,

Gor some new hardware, Windows Server 2008 with IIS 7; I have full admin access... but am new to IIS 7... :-)

I am trying to get Python running under IIS 7 so I can use TileCache:
When I try a simple test file "test.py" I get the error below (note that the file works under IIS 5.1 on my previous hardware - added at the end FYI though...)

HTTP Error 502.2 - Bad Gateway
The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are "".

Module CgiModule
Notification ExecuteRequestHandler
Handler Python
Error Code 0x00000000


Any pointers would be SINCERELY appreciated... thank you in advance...

Regards,
GREG...

----------------
test.py consists of

Expand|Select|Wrap|Line Numbers
  1. print 'Content-type: text/html'
  2. print
  3. print '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"'
  4. print '"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'
  5. print '<html xmlns="http://www.w3.org/1999/xhtml">'
  6. print
  7. print '<HEAD><TITLE>Python Sample CGI</TITLE></HEAD>'
  8. print '<BODY>'
  9. print '<H2>Here is a web page generated by a Python file/script</H1>'
  10. print
  11. print '<h3 style="color:red">' #this is a comment
  12. print 'See this is just like most other HTML'
  13. print '</h3>'
  14. print '</BODY>'

Reply