打开APACHE目录,打开Apache\conf\extra\httpd-vhosts.conf文件,按照实例配置
<VirtualHost *:80> ServerAdmin test@huwai.com DocumentRoot "F:\phpStudy\WWW\myrepos" ServerName test.huwai.com ErrorLog "logs/dummy-host2.example.com-error.log" CustomLog "logs/dummy-host2.example.com-access.log" common </VirtualHost>
然后再修改 host 文件(/windows/system32/drivers/etc/host)
添加如下内容:
127.0.0.1 test.huwai.com