Django + mod_wsgi + Apache = 403 Forbidden

后端 未结 1 1477
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-22 04:18

I\'m getting this error on Debian all the time. No matter where I put my code.

I\'ve already gone through all other questions on here and have\'t found anything usef

相关标签:
1条回答
  • 2020-12-22 04:53

    What URL are you using to access the site?

    There is quite a lot broken in this configuration. If this is a Django site, are you even following the Django docs on mod_wsgi setup?

    Some of the things which are wrong are:

    • ServerName should be a host name, not a URL so the VirtualHost would be ignored.
    • The WSGIScriptAlias is outside of the VirtualHost and because the VirtualHost is ignored, the access permissions for Apache setup within it for the target directory are ignored and you would get a forbidden response.
    • The WSGIScriptAlias is referring to a directory anyway, when likely it should be referring to the wsgi.py file.
    • Setting Allow from all from Directory / is a security disaster waiting to happen.
    0 讨论(0)
提交回复
热议问题