Wampserver2.5 configure the virtual host to present the processing scheme of 403 Forbidden

  • 2020-05-09 19:49:04
  • OfStack

It is easy to use APMServ 5.2.6, mysql, which can be replaced by mariadb for upgrading. However, when php is upgraded to 5.4.7, there is no way to upgrade again, and it is also difficult to install the accelerator. I want to migrate to Wampserver. I have tried Wampserver before, but it is very troublesome to configure.

This time I had to configure it, the setup was smooth, and the default site was working. But the problem comes when configuring the virtual host, always prompt:


Forbidden
You don't have permission to access / on this server.
Apache/2.4.9 (Win32) PHP/5.5.12 Server at www.sitename.com Port 80

1. The following information can be searched on domestic websites:

1. Modify the httpd.conf file

Enable the httpd-vhosts.conf configuration file
Include conf/extra/httpd-vhosts.conf

2. Modify httpd-vhosts. conf and add something like the following:


<VirtualHost *:80>
ServerAdmin admin@localhost.com
DocumentRoot "D:/path/foldername"
ServerName www.sitename.com
ServerAlias www.sitename.com
ErrorLog "logs/ sitename.log"
CustomLog "logs/ sitename.log" common
<Directory " D:/path/foldername ">
Options FollowSymLinks
AllowOverride None
Order deny,allow
Allow from all
</Directory>
</VirtualHost>

3. Modify the hosts file


127.0.0.1 www.sitename.com

Try N back, waste N more time, no use at all.

2. I have no choice but to change to a search engine that I can't access, and I can read E. Although I'm not good at E, I can still understand it.
There are two main points mentioned in E:

Enable rewrite_moudle.

After trying to enable and restart Apache, the situation remains the same, and the 403 error persists.

Modify the 1 sentence in the vhosts configuration file, this is the key:

Allow from all changed to Require all granted

Test successful, problem solved.

3. Summary

The reason is that the syntax of the apache configuration file has changed. Because the content of apache is too much and too complex, I am too lazy to read the latest official documents, and the domestic translation version also lags behind, so I cannot find the answer to this question.

I hope this blog post can help those who are suffering from the same problem, instead of wasting time on those useless things found by 100 x.

The original address: http: / / www cnblogs. com/ffsystem p / 3950686. html

Related articles: