1.在window系统路径C:\Windows\System32\drivers\etc\hosts中配置本地域名(hosts配置域名与IP的对应关系);
2.在appache配置文件httpd.conf中取消载入虚拟主机配置文件前的#。载入httpd.vhost.conf文件。
3.在D:\LAMP\apache\conf\extra\httpd-vhost.conf中添加如下配置
<VirtualHost *:80>
DocumentRoot "D:/proj"
ServerName www.villiam
</VirtualHost>
<Directory "D:/proj">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Require all granted
</Directory>
4.查看(在目标目录下创建测试proj,确认是否创建成功)
5.浏览器查看