我正在尝试在我的VPS服务器上设置一个MySQL数据库和phpMyAdmin。MySQL数据库启动正常,phpMyAdmin的网站部分也启动正常。但是当我转到(这里是我的VPS )/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>发布于 2015-10-13 12:44:31
我在这里做了一些假设,但是您在配置文件中别名为/phpmyadmin /usr/share/phpMyAdmin作为目录,但是当您发出"allow“语句时,您就授予了访问它下面的/usr/share/phpMyAdmin/setup/目录的权限。如果您正在尝试连接到/phpMyAdmin,那么您的允许规则将不会覆盖父目录。您可能还希望在.htaccess中查找会阻止连接的任何内容。
https://stackoverflow.com/questions/33094119
复制相似问题