几天前,我能够在 EC2 上成功登录 phpMyAdmin,但现在却出现 403 禁止错误。 我见过this帖子,以及this帖子,他们基本上建议允许所有 IP 的访问。我已经按照他们的建议做了,这对我不起作用。
我认为出了问题,我可能是不正确的,但我在过去几天做了以下事情,它们可能会产生影响: - 我下载了新的访问 key - 我删除了与正在运行的实例不关联的弹性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。请在此处提供一些指导。
最佳答案
根据我的理解,它与您的 Ec2 实例附加的安全组配置有关。检查 phpMyAdmin 端口是否为您的 IP 打开。
关于mysql - 无法访问我的 EC2 LAMP 实例上的 phpMyAdmin,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39141763/