在httpd.conf 文件中启用 httpd-vhosts.conf
就是把#注销掉
# Virtual hosts ,虚拟主机
Include conf/extra/httpd-vhosts.conf


假设我们的虚拟主机在 f:/myweb 盘 [该站点,事先有]
设置http-vhosts.conf文件
#配置我们自己的虚拟主机
<VirtualHost127.0.0.1:80>
DocumentRoot "d:/myblog"
#这里配置欢迎首页面
DirectoryIndex index.html index.htmindex.php
<Directory />
Options FollowSymLinks
#不许可别人修改我们的页面
AllowOverride None
#设置访问权限
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
4. 在hosts文件中添加我们的ip 和主机映射关系

c:/windows/system32/drivers/etc/hosts

127.0.0.1 www.sohu.cn
要求大家掌握:
1. 通过案例你要清楚访问一个页面(HTML/PHP) 详细流程
2. 能够配置虚拟主机