Is it possible to block access to phpmyadmin page over the network in XAMMP Windows? I want only localhost(127.0.0.1) to be able to access the page. Other people connected to the same network shouldn't be able to access it. Eg. if 192.168.1.2 tries to access 192.168.1.1/phpmyadmin they couldn't access it.
2 Answers
If I was running phpmyadmin and wanted to restrict access to localhost, I would use the Apache web server and would use the Order, Deny, and Allow directives to govern access. For example:
<Directory "/my/restricted/content" >
Order Deny,Allow
Deny from All
Allow from 127.0.0.1
</Directory>
If you don't use Apache but your web server has something similar to Apache's mod_authz_host you should be able to set up a similar access restriction.
- 21
- 1
-
I'm using apache as my web server. Sorry a dumb question, but is that a .htcaccess file? If so, where do i put it? Or I should edit some configuration file or something? – ysj May 08 '13 at 06:49
-
@ysj - put it into one of the configuration files; generally it is advisable to read [the docs](http://httpd.apache.org/docs/) before going into web development. – Deer Hunter May 08 '13 at 07:03
In addition to having your webserver block acccess to the right URL you should also: 1 Not use /phpmyadmin is the path 2 Not install phpmyadmin on the default listening ports (80, 443) 3 Configure the hosts firewall to block external access to the port you use 4 Consider not leaving phpmyadmin active all the time; it takes almost no time to spin up an httpd so leave it off and light it up when you need to use it, and take it down when you're done.
- 119
- 2