403使用个人计算机IP正确配置禁止访问phpMyAdmin

403使用个人计算机IP正确配置禁止访问phpMyAdmin,phpmyadmin,ip,config,Phpmyadmin,Ip,Config,我正在尝试在我的VPS服务器上设置MySQL数据库和phpMyAdmin。MySQL数据库启动良好,phpMyAdmin的网站部分也启动良好。但是当我转到我的VPS ip here/phpmyadmin时,它会显示403禁止访问-您没有访问此服务器上的/phpmyadmin/的权限。我的配置在所有4个空间中都有我的计算机IP。这是我的配置,我的实际配置已替换为占位符,供您查看: # phpMyAdmin - Web based MySQL browser written in php # #

我正在尝试在我的VPS服务器上设置MySQL数据库和phpMyAdmin。MySQL数据库启动良好,phpMyAdmin的网站部分也启动良好。但是当我转到我的VPS ip here/phpmyadmin时,它会显示403禁止访问-您没有访问此服务器上的/phpmyadmin/的权限。我的配置在所有4个空间中都有我的计算机IP。这是我的配置,我的实际配置已替换为占位符,供您查看:

# 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 (MY COMPUTER IP HERE)
       Require ip ::1
     </RequireAny>
   </IfModule>
   <IfModule !mod_authz_core.c>
     # Apache 2.2
     Order Deny,Allow
     Deny from All
     Allow from (MY COMPUTER IP HERE)
     Allow from ::1
   </IfModule>
</Directory>

<Directory /usr/share/phpMyAdmin/setup/>
   <IfModule mod_authz_core.c>
     # Apache 2.4
     <RequireAny>
       Require ip (MY COMPUTER IP HERE)
       Require ip ::1
     </RequireAny>
   </IfModule>
   <IfModule !mod_authz_core.c>
     # Apache 2.2
     Order Deny,Allow
     Deny from All
     Allow from (MY COMPUTER IP HERE)
     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>

我在这里做了一些假设,但是您将别名/phpmyadmin/usr/share/phpmyadmin作为配置文件中的目录,但是当您使用allow语句时,您正在授予访问其下的/usr/share/phpmyadmin/setup/目录的权限。如果您试图连接到/phpMyAdmin,那么您的允许规则将不覆盖父目录。您可能还希望在.htaccess中查找任何可能阻止连接的内容