2016-09-18 203 views
2

我安装了phpmyadmin,但当我在网站上:ip/phpmyadmin我试图登录,但我couldent,它不会重定向我,所以我删除它,并重新安装。PhpMyAdmin错误:403禁止

从那时起,我甚至不能连接到该网站。在/etc/httpd/phpMyAdmin.conf文件我已经加入我的IPS四次这样的...

# 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/> 
    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> 

<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> 

当我重新启动Apache,#服务的httpd重新启动,然后进入到该网站还在说

禁止

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

的Apache/2.2.15(CentOS的)在6gem.pw端口80

服务器我找不到任何修复,请帮助。

+0

由于目的,我没有在我的网站上包含我的IP。但在实际的文件中,我添加了我的IP。我运行它的所有我的VPS,所以我添加了我的电脑IP – exper

+0

首先,我会检查'/ usr/share/phpMyAdmin'文件夹的权限。 – Axidepuy

+0

Web服务器错误日志对你被拒绝的连接尝试说了什么? –

回答

0

编辑您的phpMyAdmin的配置文件:

vim /etc/httpd/conf.d/phpMyAdmin.conf 

然后改变这一切“从所有拒绝”到“从没有拒绝”和“允许的形式无”到“从全部允许”。 这应该工作:)