xampp 3.2.2
C:\Windows\System32\drivers\etc\hosts
hosts文件增加
127.0.0.1 www.test1.com
127.0.0.1 www.test2.com
127.0.0.1 www.test3.com
127.0.0.1 www.test4.com
127.0.0.1 www.test5.com
127.0.0.1 www.test6.com
127.0.0.1 www.test7.com
127.0.0.1 www.test8.com
127.0.0.1 www.test9.com
编辑E:\xampp\apache\conf\httpd.conf
<Directory "E:\xampp\htdocs2">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
Require all granted
#最后一句必须要有!
</Directory>
#Include conf/extra/httpd-vhosts.conf
#不可在Directory前出现
#不用httpd-vhosts.conf也可以了
<VirtualHost *:80>
ServerAdmin webmaster@dummy-host.example.com
ServerName www.test1.com
DocumentRoot "E:/xampp/htdocs2"
ErrorLog "logs/www.test1.com-error.log"
CustomLog "logs/www.test1.com-access.log" common
</VirtualHost>