Question

Allow all IP to access my Secured PhpmyAdmin

Hey I set up my /etc/httpd/conf.d/phpMyAdmin.conf to allow only specific IP to access my phpMyAdmin now my C# application requires that I should allow all the I.P. How will do it? any suggestion is much appreciated. Im using Centos 6.5 and MySQL 5.6xx

Subscribe
Share

Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Solution that worked for me (Centos 7.3 Apache/2.4.6 (CentOS) PHP/5.4.16 phpMyAdmin-4.4.15.10-2.el7):

<Directory /usr/share/phpMyAdmin/>
   AddDefaultCharset UTF-8

   <IfModule mod_authz_core.c>
     # Apache 2.4
     <RequireAny>
       #ADD following line:
       Require all granted
       Require ip 127.0.0.1
       Require ip ::1
     </RequireAny>
   </IfModule>
   <IfModule !mod_authz_core.c>
     # Apache 2.2
     #CHANGE following 2 lines:
     Order Allow,Deny
     Allow from All
     Allow from 127.0.0.1
     Allow from ::1
   </IfModule>
</Directory>

thanks to chris

It’s unlikely that you need to allow all IP addresses access to phpMyAdmin. Instead it is more secure to whitelist the specific IP addresses that may need access in your phpMyAdmin.conf You can use more than one address. For instance:

   <IfModule mod_authz_core.c>
     # Apache 2.4
     <RequireAny>
      Require ip your.local.IP.address
      Require ip your.C#.app.IP.address
      Require ip 127.0.0.1
      Require ip ::1
     </RequireAny>
   </IfModule>
   <IfModule !mod_authz_core.c>
     # Apache 2.2
     Order Deny,Allow
     Deny from All
     Allow from your.local.IP.address
     Allow from your.C#.app.IP.address
     Allow from 127.0.0.1
     Allow from ::1
   </IfModule>

If you really need to allow all all IP addresses to access it, you can comment out the entire RequireAny section and change Deny from All to Allow from All

Remember to restart Apache after making any changes:

  1. sudo service httpd restart

How to deny request:

::1 - - [01/May/2017:06:46:37 +0700] "OPTIONS * HTTP/1.0" 200 -

Thank

How do I know my your.C#.app.IP.address???

This comment has been deleted