【问题标题】:error: 403 Forbidden in centos 6.4 for php website错误:403 Forbidden in centos 6.4 for php website
【发布时间】:2014-06-10 16:30:42
【问题描述】:

在 Centos 6.4 中配置我的网站后。 当我在浏览器中点击 url 时,我得到 403 Forbidden。 我的 apache、php 和 mysql 都很好。 在 httpd.conf 中设置为默认 DocumentRoot 时,我的测试页面将正确打开。 但是当我将 DocumentRoot 更改为我项目的 www 文件夹时,它显示 403 禁止。

【问题讨论】:

    标签: php mysql apache centos6


    【解决方案1】:

    确保httpd 用户拥有项目 www 文件夹的读取/执行权限。

    你可以试试这个

    chmod -R 755 project_www_folder
    

    并重新加载您的浏览器

    ====== 将段添加到 apache 配置文件 ======

    <Directory "/path to project folder/">
        Options Indexes FollowSymLinks
        AllowOverride all
        Order allow,deny
        Allow from all
    </Directory>
    

    【讨论】:

    • [root@vishapp ~]# cd /root/myproject/www [root@vishapp www]# ls -l 总共 56 个 drwxrwxrwx。 7 apache apache 4096 Apr 24 12:12 管理员 drwxrwxrwx。 2 apache apache 4096 Apr 24 12:12 组件-rwxrwxrwx。 1 apache apache 1461 Apr 24 12:12 configuration.php lrwxrwxrwx。 1 apache apache 46 Apr 24 12:12 图片 -> ../vendor/anahita/anahita/vendor/joomla/images lrwxrwxrwx。 1 apache apache 43 Apr 24 12:12 包括 -> ../vendor/anahita/anahita/src/site/includes -rwxrwxrwx。 1 apache apache 577 2014 年 4 月 25 日 index.php drwxrwxrwx。 2 apache apache 4096 Apr 24 12:12 模块
    • 感谢邢的回复。 Httpd 用户 apache 拥有所有权限。但仍然得到 403 禁止
    • apache 用户必须拥有 index.php 父文件夹的权限。如果已经有,请检查 apache 的日志文件以获取更多信息。
    • 是的,他有权访问我的项目文件夹中的所有文件夹和子文件夹。还是一样的问题
    • 10.156.1.150 - - [25/Apr/2014:07:48:38 +0530] "GET / HTTP/1.0" 403 289 "-" "check_http/v1.5 (nagios-plugins) 1.5)"
    猜你喜欢
    • 2018-04-15
    • 2017-06-27
    • 1970-01-01
    • 2012-01-30
    • 2019-01-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多