Apothem
Apothem

Reputation: 405

How do I use FCGI with Python (and Django) on Fedora 17?

I'm having trouble accessing my "index.fcgi"; I keep getting a 500 Internal Server Error. Here's my error_log:

[Thu Aug 09 19:40:17 2012] [warn] [client 127.0.0.1] (104)Connection reset by peer: mod_fcgid: error reading data from FastCGI server
[Thu Aug 09 19:40:17 2012] [error] [client 127.0.0.1] Premature end of script headers: index.fcgi

Here's what I have in my .htaccess file:

Options +ExecCGI
Options +Indexes
AddHandler fcgid-script .fcgi
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.fcgi/ [QSA,L]

and here's my index.fcgi:

#!/usr/bin/python2.7
from django.core.servers.fastcgi import runfastcgi
runfastcgi(method="threaded", daemonize="false")

print "Content-type: text/html\n\n"
print
print "<html>"
print "<body>"
print "<b>test</b>"
print "</body>"
print "</html>"

I have even removed the django import and runfastcgi component, and I'm still inable to see my page.

Why is this happening to me? I have definitely installed mod_python, mod_wsgi, mod_fcgid, mod_fcgi, but nothing seems to be making it run...

Upvotes: 2

Views: 419

Answers (1)

Arun Reddy
Arun Reddy

Reputation: 3753

There is a way to solve this problem: cd to the directory where index.fcgi is there and run ./index.fcgi
- This will give you the exact error.

Upvotes: 2

Related Questions