1、httpd.conf修改
打开Apache目录下 conf\httpd.conf 文件,找到 Include conf/extra/httpd-vhosts.conf 这一行,删除行首#,取消注释
2、httpd-vhosts.conf配置
httpd-vhost.conf在 conf\extra\httpd-vhost.conf,打开后有一个写好的样例
<VirtualHost *:80>
ServerAdmin webmaster@dummy-host.example.com
DocumentRoot "${SRVROOT}/docs/dummy-host.example.com"
ServerName dummy-host.example.com
ServerAlias www.dummy-host.example.com
ErrorLog "logs/dummy-host.example.com-error.log"
CustomLog "logs/dummy-host.example.com-access.log"
</VirtualHost>