Solve the Problem of 403 Forbbiden error when Wamp enables vhost localhost!
This is a strange problem. I have never been like this before! When you access http: // localhost/, the error 403 Forbbiden is displayed.
My previous settings always look like this:
Httpd. conf
AllowOverride AllOptions Indexes FollowSymLinks Require all granted
Extra/httpd-vhost.conf
ServerAdmin webmaster@localhost DocumentRoot "d:/localhost" ServerName localhost ServerAlias local ErrorLog "logs/localhost-error.log" CustomLog "logs/localhost-access.log" common
ServerAdmin webmaster@localhost DocumentRoot "d:/wamp/www" ServerName localhost81 ServerAlias local81 ErrorLog "logs/localhost81-error.log" CustomLog "logs/localhost81-access.log" common
Then there is no index file in the Directory d:/localhost/and d:/wamp/www (for example, index.html index. php index.html) previously accessed directories are listed by default, but today when localhost is opened, the system prompts that 403 has no permission.
In addition, this is the case when you change the vhost, port 80, and port 81!
Obsessive-compulsive disorder. After spending an afternoon studying, I still had no clue. I returned home at night and accidentally saw a post on stackoverflow,Http://stackoverflow.com/questions/9110179/adding-virtualhost-fails-access-forbidden-error-403-xampp-windows-7, Try to modify the first VirtualHost and add ... Restart Apache.
<喎?http: www.bkjia.com kf ware vc " target="_blank" class="keylink"> VcD4KPHByZSBjbGFzcz0 = "brush: java;"> ServerAdmin webmaster @ localhost DocumentRoot "d:/localhost" ServerName localhost ServerAlias local ErrorLog "logs/localhost-error.log" CustomLog "logs/localhost-access.log" common Options IndexesRequire all granted
However, I removed this section and restarted it. The access to http: // localhost becomes accessible again. It means that I restored all the changes and accessed localhost again, but the error 403 Forbbiden will not appear!
In addition ...And then restart Apache:
AllowOverride All Require all granted
When I access http: // localhost/or http: // localhost: 81, the directory can still be listed !!
I think wamp seems to have a cache and cannot be cleared after restart? Reinstallation cannot be cleared.
Now the problem has not been reproduced again, but if you have a thorough solution, please contact us via email. By default.fu@foxmail.com