1、先在C:\Windows\System32\drivers\etc下修改hosts文件 增加想要创建的站点,格式如下
127.0.0.1 melody.com(此域名与httpd-vhost.conf中的域名一致)
2、去掉httpd.conf的注释,代表引入vhost
3、在httpd-vhost.conf中加入
注意,先复制<virtualhost *80></vitualhost>文件,然后再从httpd.conf中复制<directory></directory>到httpd-vhost.conf的<virtualhost *80></vitualhost>中,要修改相关documentroot,servername,errorlog,customlog,一定要增加options indexes followsymlinks,修改allow from all