xampp vhost 虚拟主机设置

Xampp Vhost 虚拟主机设置,可用于在本机做php+mysql环境测试!
Edit:
C:xamppapacheconfextrahttpd-vhosts.conf
Add:

NameVirtualHost *:80
<VirtualHost *:80>
    ServerAdmin [email protected]
    DocumentRoot "C:/xampp/htdocs/test"
    ServerName test.itkylin.com
    ServerAlias test.itkylin.com
    ErrorLog "logs/test.itkylin.com-error.log"
    CustomLog "logs/test.itkylin.com-access.log" combined
</VirtualHost>
<VirtualHost *:80>
    ServerAdmin [email protected]
    DocumentRoot "C:/xampp/htdocs"
    ServerName itkylin.com
    ServerAlias www.itkylin.com
    ErrorLog "logs/www.itkylin.com-error.log"
    CustomLog "logs/www.itkylin.com-access.log" combined
</VirtualHost>

保存,重启apache,OK!

备注:
Edit:
C:WINDOWSsystem32driversetchosts
Add:
127.0.0.1 localhost
127.0.0.1 www.itkylin.com
127.0.0.1 test.itkylin.com
这样就可以本机测试了!