mod_wsgi docs need <Files wsgi.py> ...Require all granted</Files>
|Reported by:||colinnkeenan@…||Owned by:||nobody|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
Using Apache/2.4.3 (Unix) mod_wsgi/4.0-TRUNK Python/3.2.3 and Django 6.1 alpha (trunk)
After completing the polls tutorial, I got it running in apache/mod_wsgi, but I had to add an additional line not mentioned in Django documentation to httpd.conf: Require all granted. This also doesn't seem to be mentioned in the mod_wsgi documentation. I found it by trial and error and by looking through how access was granted to other directories in the automatically generated httpd.conf.
This is what the end of my httpd.conf looks like now:
WSGIScriptAlias / /home/colin/mysite/mysite/wsgi.py WSGIPythonPath /home/colin/mysite <Directory /home/colin/mysite/mysite> <Files wsgi.py> Order deny,allow Allow from all Require all granted </Files> </Directory>
Everything is as it's should be from Django documentation except I added 'Require all granted'. Here's the error that was logged by apache without that extra line:
[Sun Nov 18 12:42:41.330234 2012] [mpm_event:notice] [pid 5577:tid 140551381825280] AH00489: Apache/2.4.3 (Unix) mod_wsgi/4.0-TRUNK Python/3.2.3 configured -- resuming normal operations [Sun Nov 18 12:42:41.330825 2012] [core:notice] [pid 5577:tid 140551381825280] AH00094: Command line: '/usr/local/apache2/bin/httpd' [Sun Nov 18 12:44:09.842374 2012] [authz_core:error] [pid 5582:tid 140551143790336] [client 127.0.0.1:48490] AH01630: client denied by server configuration: /home/colin/mysite/mysite/wsgi.py
In the web browser, it would say I didn't have access to /polls (don't remember the exact wording).
After adding 'Require all granted', /polls works the same as it did in the tutorial.
Change History (10)
comment:1 Changed 2 years ago by grahamd
- Needs documentation unset
- Needs tests unset
- Patch needs improvement unset
comment:6 Changed 2 years ago by aaugustin
- Summary changed from https://docs.djangoproject.com/en/dev/howto/deployment/wsgi/modwsgi/ need <Files wsgi.py> ...Require all granted</Files> to mod_wsgi docs need <Files wsgi.py> ...Require all granted</Files>
comment:9 Changed 22 months ago by Tim Graham <timograham@…>
- Resolution set to fixed
- Status changed from new to closed