1.首先在apache的httpd.conf文件中开启服务器里面的虚拟主机
Include conf/extra/httpd-vhosts.conf
2.在apache vhost.conf文件配置虚拟主机
<VirtualHost *:80>
DocumentRoot "路径"
ServerName 域名
ServerAlias 别名 <Directory "路径">
Options Indexes FollowSymLinks
AllowOverride All
</Directory>
</VirtualHost>
3.在c盘hosts文件修改文件
127.0.0.1 域名