您无权访问此服务器上的 /phpmyadmin

您无权访问此服务器上的 /phpmyadmin

我在 CentOS 6.6 服务器上安装了 wordpress,一切正常,WP、mysql 等,但我无法访问http://MY_IP/phpmyadmin页面导入数据库,我得到:

You don't have permission to access /phpmyadmin on this server.

我检查了登录信息:

/var/log/httpd/error_log

并发现:

[error] [client 192.168.2.12] client denied by server configuration: /usr/share/phpMyAdmin

服务器 IP 是 192.168.2.101,我尝试从另一台 IP 为 192.168.2.12 的机器访问。尝试从服务器本身访问,但也不成功。

知道如何修复此问题吗?谢谢!

答案1

我找到了解决方案:

我编辑了文件 /etc/httpd/conf.d/phpMyAdmin.conf 如下:

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

 <IfModule mod_authz_core.c>
 # Apache 2.4
 <RequireAny>
   Require ip 127.0.0.1
   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 ::1
</IfModule>
</Directory>

基本上我注释掉了:“Deny from All”,httpd 重新启动并且它工作了!

相关内容