Restricting access to phpmyadmin

When i install phpmyadmin on a server, i prefer to make it unavailable outside of the internal network.
There are some instructions online that edits the config.inc.php, but that still makes the login page visible so i prefer this way instead.

Here is how to do it on a Debian based machine:

Open /etc/apache2/conf.d/phpmyadmin.conf
Add this just under the tag(change the 192.168 to whatever the internal network address begins with):

Order Deny,Allow
Deny from all
Allow from 192.168

Remember to do a /etc/init.d/apache2 reload to make apache read the changes you made.

Comments are closed.