首页 > 解决方案 > 403 Forbidden - 无法解决,搜索高低

问题描述

我已经解决这个错误超过 4 个小时了,“site:stackoverflow.com”上的每个结果在我的谷歌上都是紫色的,我已经尝试了所有建议,但它不起作用。最后,我重新安装了所有 LAMP 堆栈服务,但仍然无法正常工作。如果有人愿意为我解决此问题,我将不胜感激(我仍然是 Linux 新手)。

vi /etc/httpd/conf/httpd.conf

<Directory "/usr/share/phpmyadmin">
    AllowOverride None
    Options None
    Require all granted
</Directory>

vi /etc/httpd/conf.d/phpMyAdmin.conf

Alias /phpMyAdmin /usr/share/phpMyAdmin
Alias /phpmyadmin /usr/share/phpMyAdmin

<Directory /usr/share/phpMyAdmin/>
   AddDefaultCharset UTF-8

   <IfModule mod_authz_core.c>
     # Apache 2.4
     <RequireAny>
       Require ip 127.0.0.1
       Require ip <workstationip>
       Require ip ::1
     </RequireAny>
   </IfModule>
   <IfModule !mod_authz_core.c>
     # Apache 2.2
     Order Deny,Allow
     Deny from All
     Allow from 127.0.0.1
     Allow from <workstationip>
     Allow from ::1
   </IfModule>
</Directory>

我也尝试过:

    <IfModule mod_authz_core.c>
     # Apache 2.4
     <RequireAny>
       Require all granted
     </RequireAny>
   </IfModule>
   <IfModule !mod_authz_core.c>
     # Apache 2.2
     Allow from all
   </IfModule>

我还确保了“setenforce 0”,但仍然没有。

我的 httpd 日志指出“服务器配置”阻止了我对 /usr/share/phpMyAdmin 的访问

标签: apachephpmyadmincentos

解决方案


晚饭后我又回来了,它奏效了。我的猜测是 DNS 更新修复了它。


推荐阅读