1. 打开目录 {Apache2 安装目录}\conf\extra\, 找到 httpd-vhosts.conf 文件.
2. 仿照例子, 添加一段代码来指定某一域名的网站.
#
# DocumentRoot 是网站文件存放的根目录
# ServerName 是网站域名, 需要跟 DNS 指向的域名一致
#
<VirtualHost *:80>
ServerAdmin webmaster@dummy
-host.example.com DocumentRoot "D:/workspace/php/demo_neoease_com"
ServerName
demo.neoease.com ErrorLog "logs/
demo.neoease.com-error.log"
CustomLog "logs/
demo.neoease.com-access.log" common
</VirtualHost>
3. 打开 httpd.conf 文件, 添加如下语句.
# Virtual hosts
Include conf/extra/httpd-vhosts.conf
4. 重启 Apache 服务.