6

As a little background, I've been developing a django application for a 1&1 shared hosting website. When I tried to port the app to the web, I followed the tutorial from here: http://robhogg.me.uk/post/2. The servers have Python 2.6, and I installed django and flup through SSH. Here is my .fsgi file...

#!/usr/bin/python
import sys, os

basepath = '/home/path/' # This isn't my actual homepath

sys.path.insert(0, basepath + '/.local/lib')
sys.path.insert(0, basepath + '/mysite')

os.environ['DJANGO_SETTINGS_MODULE'] = 'mysite.settings'

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

...and here is my .htaccess file...

AddHandler fcgid-script .fcgi
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !(cgi-bin/mysite.fcgi) 
RewriteRule ^(.*)$ cgi-bin/mysite.fcgi/$1 [QSA,L]

I also already gave the .fcgi script 755 permissions. When I run the .fcgi script, the homepage HTML prints on the console (which according to many sites means the script is good). But when I go to my website's domain, I was getting just an Index.html page that was sitting in my home directory. So I moved all the html files from the home directory, and tried again. But this time I get an error:

Forbidden

You don't have permission to access / on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

I tried one more thing, and that was in the .htaccess file, changing

AddHandler fcgid-script .fcgi

to

AddHandler fastcgi-script .fcgi

After searching everywhere, I couldn't find a solution, so I followed the directions on this site: https://help.asmallorange.com/index.php?/Knowledgebase/Article/View/140 Even though it was a different host, it was the same concept with similar steps. I followed all the steps, creating a new project and everything, and in the end, had the same issue.

I've been through a ton of posts like this one, but none have had a solution that worked yet. Maybe this is a 1&1 specific issue, but I would really appreciate the help if anyone has any suggestions.

user2639703
  • 61
  • 1
  • 3

1 Answers1

1

I got the same error as you got. But after I moved the .htaccess file to the django project folder, it works.

Wilson
  • 21
  • 1