0

I have locally installed WAMP web server where different sites are hosted like

http://localhost/Web1/
http://localhost/Web2/
http://localhost/Web3/

Now the problem is that anyone can access my wamp homepage and all those hosted sites and even try to login in PHPMyAdmin. I want to restrict wamp homepage access that no one allows to access the wamp homepage from outside(Other than my PC).

Muhammad Faizan Khan
  • 10,013
  • 18
  • 97
  • 186
  • 2
    from outside of what? – DaFois Jan 09 '19 at 09:37
  • Outside of hosted location. Other than my PC. – Muhammad Faizan Khan Jan 09 '19 at 09:44
  • Are you using WAMPServer specifically? – RiggsFolly Jan 09 '19 at 09:46
  • I am using WampServer 2.2 – Muhammad Faizan Khan Jan 09 '19 at 09:47
  • how about trying .htacces config file? [link](https://stackoverflow.com/questions/4391530/how-to-use-htaccess-in-wamp-server) if you put `order deny,allow allow from 127.0.0.1 deny from all` this will only allow your local pc access to that website. – saur Jan 09 '19 at 09:49
  • The Dup links should explain, but basically you need to create a virtual host for localhost and all your other sites. Then the other sites can be `Require all granted` and localhost can use `Require local` As you are using a VERY OLD Version of WAMPServer though you will have to do the Virtual Host creation manually, the helper is only available in WAMPServer 3 – RiggsFolly Jan 09 '19 at 09:51
  • @saur where should i place this file? additionally i don't want to restrict web access from outside i just want to restrict homepage of wamp. – Muhammad Faizan Khan Jan 09 '19 at 09:52
  • @saur i have put 'order deny,allow allow from 127.0.0.1 deny from all' in httpd.conf but now website is not available from outside. – Muhammad Faizan Khan Jan 09 '19 at 09:55
  • @MuhammadFaizanKhan .htaccess file block access to folder and its sub folder. example: if i put .htaccess in my htdocs then no one will be able to access any of my website. hence if you want to block access to web1, web2 and web3..... then create the htaccess file and put them in each of the folder. – saur Jan 09 '19 at 09:57
  • @MuhammadFaizanKhan no need to mess with http.conf, .htacces is a seperate file which you can create. – saur Jan 09 '19 at 09:59
  • @MuhammadFaizanKhan [link](https://www.youtube.com/watch?v=4Gfk-Jt35gk) this will help you. my suggestion is you dont mess with httpd.conf file – saur Jan 09 '19 at 10:01

0 Answers0