Apache installation of the default is not to open the virtual server, if you want to configure the virtual server on the local Apache, similar to the online purchase of virtual host, you can follow the following steps to configure:
1, modify the Hosts file of this machine, as follows
Example:
127.0.0.1 localhost
127.0.0.1 xlb.com
127.0.0.1 xlb2.com
2, open the Apache installation directory, find the httpd.conf file, respectively, remove the following two lines of text in front of the # number.
LoadModule Vhost_alias_module modules/mod_vhost_alias.so
Remove # means enable Apache's virtual host feature.
Include conf/extra/httpd-vhosts.conf
Getting rid of this line means importing the virtual host configuration from the conf/extra/httpd-vhosts.conf file.
3. Open the httpd-vhosts.conf file in the extra directory and set the default configuration
<virtualhost *:80>
ServerAdmin [email protected]
DocumentRoot "/www/docs/dummy-host.localhost"
ServerName Dummy-host.localhost
Serveralias http://www.dummy-host.localhost/
Errorlog "Logs/dummy-host.localhost-error_log"
Customlog "Logs/dummy-host.localhost-access_log Common"
</VirtualHost>
<virtualhost *:80>
ServerAdmin [email protected]
DocumentRoot "/www/docs/dummy-host2.localhost"
ServerName Dummy-host2.localhost
Errorlog "Logs/dummy-host2.localhost-error_log"
Customlog "Logs/dummy-host2.localhost-access_log Common"
</VirtualHost>
Change to the directory and domain name you want
<virtualhost *:80>
ServerAdmin [email protected]
DocumentRoot "d:/wamp/www/"
ServerName localhost
Serveralias localhost
Errorlog "Logs/localhost-error_log"
</VirtualHost>
<virtualhost *:80>
ServerAdmin [email protected]
DocumentRoot "d:/wamp/www/web/"
ServerName test.com (main domain)
Serveralias *.test.com (the server alias here can support Pan-resolution, that is, all subdomains can be resolved to bind to the virtual host)
Errorlog "Logs/localhost-error_log"
</VirtualHost>
If the 403 error occurs after the completion of the httpd.conf found in the:
<directory/>
Options followsymlinks execcgi Indexes
AllowOverride None
Order Deny,allow
Deny from all
Satisfy All
</Directory>
Change to
<directory/>
Options followsymlinks execcgi Indexes
AllowOverride None
# Order Deny,allow
# Deny from all
# Satisfy All
</Directory>
WIN10 about Apache Configuring the virtual Host