Apache2.4部署django出现403 Forbidden错误解决办法
前言:Apache2.4部署django出现403 Forbidden错误最好要结合apache中的错误日志来观察出现何种错误导致出现403错误
下午百度了一下午没找到解决办法,试了n种方法,简直坑爹!
比如网页出现最多的解决办法是:
<Directory E:/wamp/Apache24/www(你的工程路径)>
Order allow,deny
Allow from all
</Directory>
可惜这样改了后还是报403,最后想起来查看err.log一看报client denied by server configuration: E:/wamp/Apache24/www/www/wsgi.py,当时各种吐血呀,后来还是到开源社区找到一个网页,进去才找到解决办法
方法解决网址:https://mikegriffin.ie/blog/20140130-authz-core-error-client-denied-by-server-configuration/
正文:其实在前面已经把问题说的差不多了,就是在apache的 httpd.conf文件中添加
#添加mod_wsgi.so 模块
LoadModule wsgi_module modules/mod_wsgi.so
#工程中的wsgi文件
WSGIScriptAlias / E:/wamp/Apache24/www/www/wsgi.py
<Directory E:/wamp/Apache24/www>
Options FollowSymlinks
AllowOverride none
Require all granted
</Directory>
然后重启apache,果然解决问题了,原因我这里帮忙贴出来(大致是apache2.3后改动了访问目录权限的方式吧):
I found out that mod_authz_core
was introduced in Apache2.3. This changes the way that access control is declared from
Order allow, deny
Allow from all
to :
Require all granted
This means that the total configuration for a Directory
is now something like:
<Directory /path/to/directory>
Options FollowSymlinks
AllowOverride none
Require all granted
</Directory>
Restart apache and it'll all work nicely.
最新文章
- 1199 Problem B: 大小关系
- ios硬件编码
- NODE.JS开发指南学习笔记
- UIView UIwindow
- 《FLASH CC 2015 CANVAS 中文教程》——1、导出canvas动画,文件结构浅析
- sublime好看的字体
- 浅谈DEs,AES
- Collectl基础
- .net视图中日期格式化
- Apache:To Config The Vhost of Django Project
- python3 第十章 - 如何进行进制转化
- mosquitto安装和测试
- 【linux】---常用命令整理
- js 实现数据结构 -- 链表
- NEO学习笔记,从WIF到地址
- 一个简单的makefile文件
- curl命令下载jdk
- Go Revel - Modules(模块)
- 网络流24题 P2754 [CTSC1999]家园
- [转]LINQ: Using INNER JOIN, Group and SUM
热门文章
- 初入网络系列笔记(3)HTTP协议最简单的掌握
- sqlserver 通用分页存储过程(转)
- nodejs连接mongodb的方法
- should be mapped with insert=";false"; update=";false
- “.”(十六进制值 0x00)是无效的字符解决方案
- js严格模式总结
- HotApp小程序统计之如何接入
- iOS开发-UI 从入门到精通(二)
- java设计模式--策略模式
- [原创]python之简单计算器(超详解,只有基本功能+-*/,还有括号处理)