1. C:\Windows\System32\drivers\etc
更改下面的hosts文件 有些需要移到桌面更改 格式为
IP: 域名
127.0.0.1 www.api.com
2. 打开Apache的配置文件(httpd.conf)把 Include conf/extra/httpd-vhosts.conf 前面的# 删掉并保存
3. 打开Apache的httpd-vhosts.conf文件
<VirtualHost 192.168.1.5:80> # 根据自己的ip设置
DocumentRoot "D:\wamp"ServerName www.api.com
<Directory "D:\wamp">
#服务器允许在此目录中使用符号连接
Options Indexes FollowSymLinks
#不允许别人修改我们的页面
AllowOverride None
#设置访问权限
Require all granted
</Directory>
</VirtualHost>
4. 重启Apache服务器 浏览器访问 www.api.com(个人设置的域名)
出现默认页面 'hello world'
此时已经大功告成啦!~~