【问题标题】:Cannot access phpMyAdmin on my EC2 LAMP instance无法访问我的 EC2 LAMP 实例上的 phpMyAdmin
【发布时间】:2016-08-25 19:53:14
【问题描述】:

几天前我能够在我的 EC2 上成功登录到我的 phpMyAdmin,但现在它给了我一个 403 禁止错误。 我看过thisthis 的帖子,他们基本上建议允许从所有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


    【解决方案1】:

    根据我的理解,它与您的 Ec2 实例附带的安全组配置有关。检查 phpMyAdmin 端口是否为您的 ip 打开。

    【讨论】:

    • 那是什么端口号?和mysql一样吗?
    • 您的网络服务器端口(apache. eg:8080)
    • 那是允许的
    • 3306 已启用?类型:MYSQL/Aurora
    • 是的,它也已启用\
    猜你喜欢
    • 1970-01-01
    • 2017-11-07
    • 1970-01-01
    • 2017-05-03
    • 2023-04-06
    • 2011-08-30
    • 2016-08-08
    • 1970-01-01
    • 2019-11-23
    相关资源
    最近更新 更多