Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I recently wrote a web.py-based stand alone web service. Due to unforeseen circumstances, the service has to run through IIS. I've heard that it's possible to run web.py as a CGI in IIS, but I'm having trouble setting it up. I can run Python CGI scripts, but I get internal server errors when I try to run the web.py-based script. The error states:

CGI Error

The specified CGI application misbehaved by not returning a complete set of HTTP headers.

For reference, the script is:

import web
urls = (
class hello:
    def GET(self,name):
        i = web.input(times=1)
        if not name: name = 'world'
        for c in xrange(init(i.times)): print 'Hello, '+name+'!'
if __name__=="__main__":
  1. Where are the log files for IIS that would have internal server error information?
  2. Do I have to employ a Rewrite ISAPI filter to use web.py on IIS?
  3. Do I need to employ a WSGI-ISAPI bridge to use web.py on IIS?
  4. Has anyone done this before?

This thread mentions using a hacked version of flup to avoid socket creation, which I've done, but to no avail.

share|improve this question
This question on SO may cover what you need: stackoverflow.com/questions/5975131/… –  MikeyB Dec 8 '11 at 0:54

1 Answer 1

up vote 1 down vote accepted

Here is some info: http://support.microsoft.com/kb/145661

Here is a suggestion: http://support.microsoft.com/kb/238788

Here is a bugfix: http://support.microsoft.com/kb/884764

If you are running IIS7, (you didn't really specify), the last one can probably just be ignored

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.