How can we restrict ip based access to phpmyadmin directory

I was working on this in last week and I came to know following solution. There can be other ways too , but I am not sure. So I am just explaining the way I did it for my site.

1. You can edit phpMyAdmin.conf (located at /etc/httpd/conf.d/) file in vi editor.
2. Following code block should be there.

< directory /var/www/phpMyAdmin >
DirectoryIndex index.php
Options Includes ExecCGI
AllowOverride None
Order deny,allow
Allow from all
< / Directory >

3. Add new line "Allow from ip.ip.ip.ip", check code below.

< directory /var/www/phpMyAdmin >
DirectoryIndex index.php
Options Includes ExecCGI
AllowOverride None
Order deny,allow
Allow from ip.ip.ip.ip
Allow from all
< / Directory >

please put your comments if you have any suggestions or doubts about this implementation.

0 comments:

Post a Comment

Share this post with your friends