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

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:

  • tools.cherrypy.org/wiki/FastCGIWSGI
  • tools.cherrypy.org/wiki/BluehostDeployment

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

2 Answers 2

This is a very common apache error, see http://httpd.apache.org/docs/1.3/misc/FAQ-F.html#premature-script-headers

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:

http://stackoverflow.com/questions/1665742/cherrypy-or-other-python-framework-with-fastcgi-on-shared-host

Thanks.

share|improve this answer

Your Answer

 
discard

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