I have installed WAMP version 2.1 on my windows 7 machine. When i browse to localhost in my browser, the WAMP server page is visible. But when I browse to my IP in my browser, I get the message.

403 Forbidden: You don’t have permission to access / on this server.

Any suggestions?

The access to your Apache server is forbidden from addresses other than 127.0.0.1 in httpd.conf (Apache’s config file) :

<Directory "c:/wamp/www/"> Options Indexes FollowSymLinks AllowOverride all Order Deny,Allow Deny from all Allow from 127.0.0.1 </Directory> 

The same goes for your PHPMyAdmin access, the config file is phpmyadmin.conf :

<Directory "c:/wamp/apps/phpmyadmin3.4.5/"> Options Indexes FollowSymLinks MultiViews AllowOverride all Order Deny,Allow Deny from all Allow from 127.0.0.1 </Directory> 

You can set them to allow connections from all IP addresses like follows :

AllowOverride All Order allow,deny Allow from all 

--------------------------------------------------------------------------------------------------------------

The solution for changing the permissions in the httpd.conf will work if you are OK with providing access to the WAMP server from outside.

If you do not want to do that then all you have to do is tell windows that the “localhost” domain points to 127.0.0.1. You can do that by editing the hosts file in your system directory.

The file is placed at : C:\Windows\System32\drivers\etc\hosts

by default windows 7 ships with :

# localhost name resolution is handled within DNS itself. # 127.0.0.1 localhost # ::1 localhost 

You have to un-comment the mapping for localhost:

# localhost name resolution is handled within DNS itself. 127.0.0.1 localhost # ::1 localhost 

Note: you will not be able to edit the hosts file as its a read-only file. To edit, you have to be the administrator, copy the file to some other location, edit it and then copy it back to the etc directory.

I do not recommend the change of the hosts file. Use the permissions of httpd.conf file. use the hosts file approach only if you do not want the server accessed from outside.

——————————————————————————————————————————————————–

if you have used localhost/phpmyadmin/

simply use

127.0.0.1/phpmyadmin/ for PHPMyAdmin

127.0.0.1/sqlbuddy/ for SQLBuddy

or if you have used localhost:8080/phpmyadmin/ then

127.0.0.1:8080/phpmyadmin/ for PHPMyAdmin

127.0.0.1:8080/sqlbuddy/ for SQLBuddy

——————————————————————————————————————————————————–

I tried the configs above and only this worked for my WAMP Apache 2.4.2 config. Go figure… For multiple root site without named hosts like http://locahost:8080, http://localhost:8081, http://localhost:8082 ….

#ServerName localhost:80
 ServerName localhost 
Listen 8080
 Listen 8081
 Listen 8082 
#..... 
<VirtualHost *:8080>
 DocumentRoot "c:\www"
 ServerName localhost
 <Directory "c:/www/">
 Options Indexes FollowSymLinks
 AllowOverride all
Require local
 </Directory>
 </VirtualHost>
 <VirtualHost *:8081>
 DocumentRoot "C:\www\directory abc\svn_abc\trunk\httpdocs"
 ServerName localhost
 <Directory "C:\www\directory abc\svn_abc\trunk\httpdocs">
 Options Indexes FollowSymLinks
 AllowOverride all
Require local </Directory>
 </VirtualHost>
 #<VirtualHost *:8082></VirtualHost>....... 

--------------------------------------------------------------------------------------------------------------------------------------------------------

hi there are 2 solutions :

  1. change the port 80 to 81 in the text file (httpd.conf) and click 127.0.0.1:81
  2. change setting the network go to control panel–network and internet–network and sharing center

click–>local area connection select–>propertis check true in the -allow other ….. and — allo other …..

——————————————————————————————————————————————————–

There could many causes to this problems

What I have experienced are:
1) 127.0.0.1 localhost entry was duplicated in hosts file
2) Apache mod_rewrite was not enabled

Regardless of the cause, backing up your www folder, vhost configuration file (and httpd configuration file) will help. And such process takes a few minutes.

——————————————————————————————————————————————————–

( Reference: http://stackoverflow.com/questions/8204902/wamp-403-forbidden-message)

Leave a Reply

Your email address will not be published. Required fields are marked *