Laravel 5.4应用程序403错误

问题描述 投票:0回答:1

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

故宫。您没有权限访问/在此服务器上。

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

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

<VirtualHost xxx.xxx.xx.xxx:80>
    ServerName mywebsite.lk
    ServerAlias www.mywebsite.lk
    ServerAdmin [email protected]
    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个回答
1
投票

可能性是Mod_Security在安装时导致它。

其次,请检查您的error_log文件

tail -f /usr/local/apache/logs/error_log
© www.soinside.com 2019 - 2024. All rights reserved.