Django + mod_wsgi + Apache = 403 Forbidden

泪湿孤枕 提交于 2019-11-29 18:02:00

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.
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!