1. Open the httpd.conf in Apache with a text editor, search for httpd-vhosts.conf, find "#Include conf/extra/httpd-vhosts.conf", and remove "#" to enable the virtual host feature.
Find the following code in HTTPD.CONF:
<directory/>options followsymlinksallowoverride noneorder deny,allowdeny from all</Directory>
When PHP is initially set, "Deny from all" means "Deny all connections" and is modified to "allow from all"
2. Open httpd-vhosts.conf, configure your own virtual host information, add it after the file
<virtualhost *:80> documentroot "(Root of Project)" ServerName the domain name <directory "(Root directory of Project)" > Options followsymlinks allowoverride None Order allow,deny allow from all </directory></ Virtualhost>
DocumentRoot and ServerName are required to be configured
3. Modify the Hosts file, and the file is finally added
127.0.0.1 the domain name you set yourself
Note: The problem of resolving 403 is primarily to modify the "Deny from all" in httpd.conf and to increase when the virtual host information is configured
<directory "Project root directory"/> Options followsymlinks allowoverride None Order deny,allow allow from all </directory& Gt
Once configured, reboot Apache and the problem should be solved.
Reference: http://www.cnblogs.com/wajika/p/6481167.html
Troubleshooting 403 error when configuring virtual host for Apache