Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

FCGI htaccess handler

I'm trying to setup django on a shared hosting provider. I followed the instructions on http://helpdesk.bluehost.com/index.php/kb/article/000531 and almost have it working.

The problem I'm facing now is that the traffic is properly routed throught the fcgi file, but the file itself shows up as plain text in the browser. If I run ./mysite.fcgi in the ssh shell, I do get the default django welcome page.

my .htaccess is:

AddHandler fastcgi-script .fcgi
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ mysite.fcgi/$1 [QSA,L]

and mysite.fcgi:

#!/usr/bin/python2.6
import sys, os
os.environ['DJANGO_SETTINGS_MODULE'] = "icm.settings"

from django.core.servers.fastcgi import runfastcgi
runfastcgi(method="threaded", daemonize="false")

thanks.

like image 395
sharvey Avatar asked Feb 28 '23 05:02

sharvey


1 Answers

Try removing AddHandler, or changing it to:

AddHandler fcgid-script .fcgi
like image 102
h0tw1r3 Avatar answered Mar 07 '23 04:03

h0tw1r3