【问题标题】:Laravel 5.4 application 403 errorLaravel 5.4 应用程序 403 错误
【发布时间】:2018-07-10 18:08:18
【问题描述】:

我遇到这种情况,我的基于 Laravel 5.4 的网站突然出现 403 错误:

禁止。您无权访问此服务器上的 /。

但是,当我使用开发者工具清除网站的 cookie 并刷新时,它工作正常。

我正在使用 CentOS (CWP) + Apache + PHP + MySQL 配置,以下是我的网站虚拟主机。

<VirtualHost xxx.xxx.xx.xxx:80>
    ServerName mywebsite.lk
    ServerAlias www.mywebsite.lk
    ServerAdmin webmaster@mywebsite.lk
    DocumentRoot /home/mywebsite/public_html
    UseCanonicalName Off
    ScriptAlias /cgi-bin/ /home/mywebsite/public_html/cgi-bin/

    # Custom settings are loaded below this line (if any exist)
    # Include "/usr/local/apache/conf/userdata/mywebsite/mywebsite.lk/*.conf

    <IfModule mod_userdir.c>
        UserDir disabled
        UserDir enabled mywebsite
    </IfModule>

    <IfModule mod_suexec.c>
        SuexecUserGroup mywebsite mywebsite
    </IfModule>

    <IfModule mod_suphp.c>
        suPHP_UserGroup mywebsite mywebsite 
        suPHP_ConfigPath /home/mywebsite 
    </IfModule>

    <Directory "/home/mywebsite/public_html">
        AllowOverride All
                Require all granted
    </Directory>

</VirtualHost>

可能是什么问题?非常感谢专家提供的任何线索和建议。

谢谢!

【问题讨论】:

    标签: php laravel-5 laravel-5.4 http-status-code-403


    【解决方案1】:

    如果安装了 Mod_Security,可能会导致它。

    其次,请检查您的 error_log 文件

    tail -f /usr/local/apache/logs/error_log
    

    【讨论】:

      猜你喜欢
      • 2017-12-20
      • 1970-01-01
      • 1970-01-01
      • 2018-01-27
      • 1970-01-01
      • 1970-01-01
      • 2017-07-26
      • 2023-04-04
      • 2018-02-17
      相关资源
      最近更新 更多