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

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to configure the Python mini-framework CherryPy with FastCGI (actually fcgid) on Apache. I am on a shared host, so I don't have access to httpd.conf, just htaccess. I have followed these tutorials to no avail:


I keep getting 500 errors w/ the Apache logs saying "Premature end of script headers". I have tried everything (permissions/shebangs/full-paths/deamonized/not-daimonized). I know Apache is correctly executing my .fcgi, because I am able to print to the error log from python, but that's it. Has anyone out there successfully installed CherryPy or any other framework on a shared host before? Your help would be greatly appreciated. Thanks.

share|improve this question

This is a very common apache error, see

In all likelihood if your fcgi is executing as you say, then it is dying abruptly on an uncaught exception of some kind and the output it not being generated correctly.

I would follow the recommendations from that link, specifically trying to generate the output (cutting apache out of the equation).

share|improve this answer
I was able to run the built-in cherry by web server with no problem and correctly generate output to the browser. There were no exceptions. I figured out the issue w/ apache+fcgi (need 'dynamic mode') which is slated for the next release of CherryPy (see my solution). Thanks for your help. – arshaw Nov 12 '09 at 6:12
up vote 0 down vote accepted

I asked this question on both Server Fault and Stack Overflow. I have figured out the issue, and posted the solution on Stack Overflow:


share|improve this answer

Your Answer


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