0

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.

2 Answers 2

0

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).

1
  • 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, 2009 at 6:12
0

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

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

Thanks.

You must log in to answer this question.