Solve the Problem of 403 Forbbiden error when Wamp enables vhost localhost!

Source: Internet
Author: User

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




Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.