I have installed wamp on windows 8 and received above error whenever I go to localhost or phpmyadmin. After much searching I found many answers which includes modifying the httpd.conf to Allow from All
etc. This link shows such a common answer with further information.
My problem is that many have argued that it gives permission to all users to access phpMyAdmin and it is insecure and vulnerable etc. I want to create perfectly secure WAMP server and is it OK if I do this?
Can someone please provide me with some reference or information?
1.
first of all Port 80(or what ever you are using) and 443 must be allow for both TCP and UDP packets. To do this, create 2 inbound rules for TPC and UDP on Windows Firewall for port 80 and 443. (or you can disable your whole firewall for testing but permanent solution if allow inbound rule)
2.
If you are using WAMPServer 3 See bottom of answer
For WAMPServer versions <= 2.5
You need to change the security setting on Apache to allow access from anywhere else, so edit your
httpd.conf
file.Change this section from :
To :
if "Allow from all" line not work for your then use "Require all granted" then it will work for you.
WAMPServer 3 has a different method
In version 3 and > of WAMPServer there is a Virtual Hosts pre defined for
localhost
so dont amend thehttpd.conf
file at all, leave it as you found it.Using the menus, edit the
httpd-vhosts.conf
file.It should look like this :
Amend it to
Note:if you are running wamp for other than port 80 then VirtualHost will be like VirtualHost *:86.(86 or port whatever you are using) instead of VirtualHost *:80
3. Dont forget to restart All Services of Wamp or Apache after making this change
Adding
Allow from All
didn't worked for me. Then I tried this and it worked.I added this in the file C:\wamp\bin\apache\apache2.4.9\conf\extra\httpd-vhosts.conf
This could be one solution.
By default wamp sets the following as the default for any directory not explicitly declared:
For me, if I comment out the line that says
Require all denied
I started having access to the directory in question. I don't recommend this.Instead in the directory directive I included
Require local
as below:NOTE: I was still getting permission denied when I only had
Allow from all
. AddingRequire local
helped for me.I find the best (and least frustrating) path is to start with
Allow from All
, then, when you know it will work that way, scale it back to the more secureAllow from 127.0.0.1
orAllow from ::1
(localhost).As long as your firewall is configured properly,
Allow from all
shouldn't cause any problems, but it is better to only allow from localhost if you don't need other computers to be able to access your site.Don't forget to restart Apache whenever you make changes to httpd.conf. They will not take effect until the next start.
Hopefully this is enough to get you started, there is lots of documentation available online.