javascript - WAMP下面配置多台虚拟主机,其他计算机如何控制访问哪个网站?
本文介绍了javascript - WAMP下面配置多台虚拟主机,其他计算机如何控制访问哪个网站?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
问 题
httpd-vhosts.conf下配置vhost两个
<VirtualHost *:80>
DocumentRoot "G:\PhpDemo"
ServerName "localhost"
<Directory "G:\PhpDemo">
Options Indexes FollowSymLinks
AllowOverride all
Require all granted
</Directory>
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "G:\MVC"
ServerName "www.mvc.com"
<Directory "G:\MVC">
Options Indexes FollowSymLinks
AllowOverride all
Require all granted
</Directory>
</VirtualHost>
在windows的host文件中也添加了对应的配置
127.0.0.1 localhost
127.0.0.1 www.mvc.com
但是其他计算机通过ip访问本机还是localhost,如何让其他机器访问到www.mvc.com?
解决方案
其他机器上需要绑定你机器ip的host。域名就是www.mvc.com
这篇关于javascript - WAMP下面配置多台虚拟主机,其他计算机如何控制访问哪个网站?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文