1.hosts文件路径C:\Windows\System32\drivers\etc\hosts
2.使用虚拟站点需要在httpd.conf中打开配置
Include conf/extra/httpd-vhosts.conf
<VirtualHost *:80>
# 需要绑定的域名
ServerName a.com
# 绑定多个域名
#设置默认的访问的页面
DirectoryIndex index.php index.html index.htm
# 指定网站根目录(虚拟主机)
DocumentRoot "f:/www/a"
# 指定目录的权限
<Directory "f:/www/a">
# 如果首页不存在,则显示目录列表(Options Indexes FollowSymLinks)
Options Indexes FollowSymLinks
# 禁止和允许的执行顺序
Order Allow,Deny
# 允许哪些IP访问虚拟主机
Allow from All
#高版本新加要不然依然forbidden
Require all granted
</Directory>
</VirtualHost>