403 Forbidden Error

69 views
Skip to first unread message

Biekei

unread,
Jan 1, 2011, 3:14:37 PM1/1/11
to modwsgi
hello,

I tried using the configuration of mod_wsgi for django from the
documentation but I always get a 403 Forbidden error. I use django,
mod_wsgi and apache provided by my distribution (ubuntu). Any advice

dumb906

unread,
Jan 1, 2011, 3:28:41 PM1/1/11
to modwsgi
hi there

used the default settings from the configuration for django from the
documentation page. I'm using django 1.2.3, apache 2.2, mod_wsgi
3.2-2. All files I used for django is stored in /home/biekei/.projects/
py/kt and the folder created by django-admin is /home/biekei/.projects/
py/kt/kt

This is my config file from /etc/apache2/sites-available/default ( the
same error when i used httpd.conf)

<VirtualHost *:80>
ServerAdmin webmaster@localhost

DocumentRoot /var/www
WSGIScriptAlias /kt /home/biekei/.projects/py/kt/kt/apache/
django.wsgi

<Directory /home/biekei/.projects/py/kt/kt/>
Options Indexes MultiViews FollowSymLinks
Order allow,deny
allow from all
</Directory>
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>

ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>

ErrorLog ${APACHE_LOG_DIR}/error.log

# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn

CustomLog ${APACHE_LOG_DIR}/access.log combined

Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>

</VirtualHost>

here also is /home/biekei/.projects/py/kt/kt/apache/django.wsgi
import os
import sys
sys.path.append('/home/biekei/.projects/py/kt')
sys.path.append('/home/biekei/.projects/py/kt/kt')

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

import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()


Thanks for any advice

Graham Dumpleton

unread,
Jan 1, 2011, 4:18:25 PM1/1/11
to mod...@googlegroups.com
Presuming you are same person as OP, then 403 likely because of
restrictive permissions on your home directory preventing user that
Apache runs as from seeing inside of your home directory for your
account.

Have a watch of video presentation and look at slides that go with it at:

http://code.google.com/p/modwsgi/wiki/WhereToGetHelp?tm=6#Conference_Presentations

The quick fix is to change permissions on your home directory, and
possibly stuff under .projects as well. Alternatively move the web
site stiff outside of your home directory, or run your application in
mod_wsgi daemon mode.

The talk goes through the options.

Graham

> --
> You received this message because you are subscribed to the Google Groups "modwsgi" group.
> To post to this group, send email to mod...@googlegroups.com.
> To unsubscribe from this group, send email to modwsgi+u...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/modwsgi?hl=en.
>
>

Reply all
Reply to author
Forward
0 new messages