PDA

View Full Version : 403 Forbidden in subdomain



geekforGod
12-20-2006, 12:36 PM
Hey everyone,

I have set up a subdomain for running django. My subdomain is django.mysite.net. I know it works because adding an index.html file to the directory displays. However, when I remove the index.html file and try to access django.mysite.net I get a 403 forbidden. I have a .htaccess file that is supposed to run a file django.fcgi. I am not sure if this is an apache problem, a fastcgi problem, or an alias problem. If I access django.fcgi directly, I see the text of the script. Any help is appreciated. Sorry if I posted this in the wrong forum.

Todd

wildjokerdesign
12-20-2006, 08:55 PM
If the document root for your subdomain is above /var/www/html then that is because you need to make manual changes to httpd.conf in order for a .htaccess file to work. What directory did you point the subdomain to?

Here is a link to a thread that well explain the lack of .htaccess abilities outside the document root of your main domain incase that applies here.
http://forums.westhost.com/showthread.php?t=9120

geekforGod
12-21-2006, 10:01 AM
Thanks Shawn, that seemed to be one of my problems. After changing my httpd.conf file and editing the .htaccess file, I can now go to my subdomain and it redirects to the django.fcgi file as it should.

However, it still displays the text of the file instead of executing it. I know the file is world executable and I think I set up the correct directives to allow fastcgi to work in that directory. I have to say I prefer programming to server administration anyday. :)

Oh, and my root directory for my subdomain is under my home directory, not sure if that can cause some of these problems, but it seemed to be what the django docs suggested. Maybe I read it wrong. I would love it if Westhost included Django in the site manager. :)

Thanks again for all your help,

Todd

wildjokerdesign
12-21-2006, 12:26 PM
I have to admit that I am not familiar at all with django at all. :) I did do a search and checked out their site and from a real quick read I see it needs Python to run. I am pretty sure that accounts have that installed by default but double check you have it installed. Let me do some checking of the httpd.conf and see if maybe there is something that needs to be added to get Python to work outside of the primary domain root. I'll also check for fastcgi needs. :) Might take me some time since I don't have fastcgi installed on anything at the moment.

geekforGod
12-21-2006, 02:35 PM
Django is running(at least the admin portions of it work). I installed Python 2.5 from sources as well as flup and postgresql. I have already tested it from the command line. I won't count out Django, but at the moment I don't think it is the problem.

If I don't get Django running it is ok. I can convert my app to Ruby on Rails. But Django would be nice to play with.

Thanks again for all your help,

Todd