Under Wamp, virtual machine configuration is divided into three steps. The example is as follows:
1. Modify the Hosts file
C:WINDOWSsystem32driversetcHosts
127.0.0.1 dz1.test.com
2. Edit the wampbinapacheApache2.2.11confextrahttpd-vhosts.conf file and add the following code at the bottom of the file
ServerName dz1.test.com
ServerAlias dz1.test.com
DocumentRoot "e:/wamp/www/dz1"
In addition, after adding this sentence, if you don’t have the following sentence, remember to add it, otherwise localhost cannot be opened. It is best to add
ServerName localhost
ServerAlias localhost
DocumentRoot "D:/wamp/www"
3. Edit the E:wampbinapacheApache2.2.11confhttpd.conf file and add the following code at the bottom of the file
Note: Failure to add this code will result in a 403 error
Open the configuration file httpd.conf , and remove the # in front of #Include 0conf/extra/httpd-vhosts.conf! !
Options Indexes FollowSymLinks
AllowOverride all
Order Allow,Deny
Allow from all
Restart Apache, and then test dz1.test.com, that’s it.
. . . . . . . . . . . . . . . .
Pay attention to the red bolded parts, they must be the same and the files exist