【发布时间】:2016-08-25 19:53:14
【问题描述】:
几天前我能够在我的 EC2 上成功登录到我的 phpMyAdmin,但现在它给了我一个 403 禁止错误。 我看过this 和this 的帖子,他们基本上建议允许从所有IP 访问。我已经按照他们的建议做了,它对我不起作用。
我认为出了问题,我可能是不正确的,但我在过去几天做了以下事情,它们可能会产生影响: - 我下载了一个新的访问密钥 - 我删除了一个与正在运行的实例无关的弹性 IP - 我删除了一个 NAT 网关。
目前,我的 phpMyAdmin.conf 如下所示:
# 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 <MyIP>
Require ip ::1
</RequireAny>
</IfModule>
<IfModule !mod_authz_core.c>
# Apache 2.2
Order Deny,Allow
Deny from All
Allow from <MyIP>
Allow from ::1
</IfModule>
</Directory>
<Directory /usr/share/phpMyAdmin/setup/>
<IfModule mod_authz_core.c>
# Apache 2.4
<RequireAny>
Require ip <MyIP>
Require ip ::1
</RequireAny>
</IfModule>
<IfModule !mod_authz_core.c>
# Apache 2.2
Order Deny,Allow
Deny from All
Allow from <MyIP>
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 和 mysql,但没有任何反应。它仍然显示 403。请在此处提供一些指导。
【问题讨论】:
标签: mysql amazon-web-services amazon-ec2 phpmyadmin