首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >403带有正确配置和个人计算机IP的禁止访问phpMyAdmin

403带有正确配置和个人计算机IP的禁止访问phpMyAdmin
EN

Stack Overflow用户
提问于 2015-10-13 12:26:46
回答 1查看 548关注 0票数 0

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

代码语言:javascript
复制
# 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>
EN

回答 1

Stack Overflow用户

发布于 2015-10-13 12:44:31

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

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/33094119

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档