0

I was able to successfully login to my phpMyAdmin on my EC2 few days ago, but now it gives me a 403 forbidden error. I have seen this post, and this post, and they basically suggest allowing access from all IPs. I have done what they suggest, it doesn't work for me.

What I think has gone wrong, and I might be incorrect, but I did the following over the last few days, and they could have had an impact: - I downloaded a new access key - I deleted an elastic IP that was not associated with a running instance - I deleted a NAT gateway.

At the moment, my phpMyAdmin.conf looks like this:

# 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>

I changed that to what the two posts suggested above, then restarted both apache and mysql but nothing happened. It still showed a 403. Please give some guidance here.

Community
  • 1
  • 1
omrakhur
  • 1,362
  • 2
  • 24
  • 48

1 Answers1

0

Based on my understanding , its related with Security group configuration attached with your Ec2 instance.Check phpMyAdmin port is opened for your ip.

Abdul Manaf
  • 4,933
  • 8
  • 51
  • 95