Open the Apache installation directory and locate the httpd.conf file, removing the # number in front of the following two lines of text, respectively.
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.
Then the httpd-vhosts.conf file in the extra directory
<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>
2. Local Service Setup
01. Determine the local IP
02. Configure the route map
03. Determine the routing ip
Apache Configure local domain name