phpMyAdmin local internet access only

ssgill

Verified User
Joined
May 9, 2012
Messages
168
Hello, i am trying to limit phpMyAdmin access to local internet only. I have read few threads with different options one being .htaccess file but is there another way of doing it. I had already tried updating the config.php file with this code:
PHP:
$cfg['Servers'][$i]['AllowDeny']['order'] = 'deny,allow';
$cfg['Servers'][$i]['AllowDeny']['rules'] = array(
'deny % from all',
'allow % from localhost',
'allow % from 10.2.1.0/24',
);

but this is not working, i can still access it from outside.

Another question is can i block access to phpmyadmin from site url for all users. e.g: www.<site_url>/phpmyadmin.

So its only available from main directadmin ip as its accessed from the directadmin phpmyadmin link. e.g: https//:<directadmin_ip>/phpmyadmin. This would be a real help thanks.
 
Why wouldnt you just use htaccess it is super easy.

Code:
<IfModule mod_access.c>
order deny,allow
allow from 127.0.0.1
allow from 10.2.1.0/24
deny from all
</IfModule>
 
Last edited:
Why wouldnt you just use htaccess it is super easy.

Code:
<IfModule mod_access.c>
order deny,allow
allow from 127.0.0.1
allow from 10.2.1.0/24
deny from all
</IfModule>
But will .htaccess file survive subsequent updates to phpmyadmin or i would have to add this after every update. thanks
 
Back
Top