2016-09-18 322 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 

然後改變這一切「從所有拒絕」到「從沒有拒絕」和「允許的形式無」到「從全部允許」。 這應該工作:)