Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I recently wrote a stand alone web service. Due to unforeseen circumstances, the service has to run through IIS. I've heard that it's possible to run 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 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 on IIS?
  3. Do I need to employ a WSGI-ISAPI bridge to use 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:… – MikeyB Dec 8 '11 at 0:54

1 Answer 1

up vote 1 down vote accepted

Here is some info:

Here is a suggestion:

Here is a bugfix:

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.