Take the 2-minute tour ×
Information Security Stack Exchange is a question and answer site for Information security professionals. It's 100% free, no registration required.

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.

share|improve this question

2 Answers 2

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.

share|improve this answer
    
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 8 '13 at 6:49
    
@ysj - put it into one of the configuration files; generally it is advisable to read the docs before going into web development. –  Deer Hunter May 8 '13 at 7: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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.