zoukankan      html  css  js  c++  java
  • 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.

  • 相关阅读:
    MongoDB 释放磁盘空间 db.runCommand({repairDatabase: 1 })
    RK 调试笔记
    RK Android7.1 拨号
    RK Android7.1 移植gt9271 TP偏移
    RK Android7.1 定制化 itvbox 盒子Launcher
    RK Android7.1 双屏显示旋转方向
    RK Android7.1 设置 内存条作假
    RK Android7.1 设置 蓝牙 已断开连接
    RK Android7.1 进入Camera2 亮度会增加
    RK 3128 调触摸屏 TP GT9XX
  • 原文地址:https://www.cnblogs.com/CQ-LQJ/p/4931086.html
Copyright © 2011-2022 走看看