禁止:您无权访问此服务器上的/phpmyadmin [英] Forbidden :You don't have permission to access /phpmyadmin on this server
问题描述
我已经在centos机器上安装了phpmyadmin,当我尝试通过浏览器点击phpmyadmin
时,出现此错误:
Hi I have installed phpmyadmin on my centos machine and when I try to hit phpmyadmin
through my browser I get this error :
Forbidden
You don't have permission to access `phpmyadmin` on this server.
我的phpmyadmin.conf
文件具有以下内容:
My phpmyadmin.conf
file has following content:
# phpMyAdmin - Web based MySQL browser written in php
#
# Allows only localhost by default
#
# But allowing phpMyAdmin to anyone other than localhost should be considered
# dangerous unless properly secured by SSL
Alias /phpMyAdmin /usr/share/phpMyAdmin
Alias /phpmyadmin /usr/share/phpMyAdmin
<Directory /usr/share/phpMyAdmin/>
<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>
<Directory /usr/share/phpMyAdmin/setup/>
<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>
# These directories do not require access over HTTP - taken from the original
# phpMyAdmin upstream tarball
#
<Directory /usr/share/phpMyAdmin/libraries/>
Order Deny,Allow
Deny from All
Allow from None
</Directory>
<Directory /usr/share/phpMyAdmin/setup/lib/>
Order Deny,Allow
Deny from All
Allow from None
</Directory>
<Directory /usr/share/phpMyAdmin/setup/frames/>
Order Deny,Allow
Deny from All
Allow from None
</Directory>
# This configuration prevents mod_security at phpMyAdmin directories from
# filtering SQL etc. This may break your mod_security implementation.
#
#<IfModule mod_security.c>
# <Directory /usr/share/phpMyAdmin/>
# SecRuleInheritance Off
# </Directory>
#</IfModule>
请帮助我解决此问题.任何线索都表示赞赏.
Kindly help me resolve this issue. Any lead is appreciated.
谢谢
推荐答案
您需要执行以下步骤:
下面的查找行
Require ip 127.0.0.1
替换为您的工作站IP地址:
Replace with your workstation IP address:
Require ip 10.1.3.53
再次找到以下行:
Allow from 127.0.0.1
替换如下:
Allow from 10.1.3.53
也找到deny from all
并在整个文件中添加注释.
Also find deny from all
and comment it in the entire file.
保存并关闭文件.Restart Apache httpd server
:
# service httpd restart
由于这是选定的答案,并且具有最好的可见性……也请确保已安装PHP ,否则会出现相同的Forbidden
错误.
Since this is the selected answer and gets best visibility ... please also make sure that PHP is installed, otherwise you get same Forbidden
error.
这篇关于禁止:您无权访问此服务器上的/phpmyadmin的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!