【发布时间】:2018-09-24 14:36:40
【问题描述】:
我知道有很多关于这个主题的问题,但我仍然无法让它发挥作用。
我已经在我的笔记本电脑上本地设置了一个 Wordpress 站点和一个虚拟主机(通过 Wamp 3.1),现在我想从同一网络上的另一台 PC 访问它。在本地主机上一切正常。
我的httpd-vhosts.conf 文件如下所示:
# Virtual Hosts
#
#Wamp
<VirtualHost *:80>
ServerName localhost
ServerAlias localhost
DocumentRoot "${INSTALL_DIR}/www"
<Directory "${INSTALL_DIR}/www/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>
#Hp1
<VirtualHost *:80>
ServerName hp1.local
DocumentRoot "d:/wamp64/www/hp1"
<Directory "d:/wamp64/www/hp1">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local
Require ip 192.168.100.76
</Directory>
</VirtualHost>
我已将192.168.100.88 hp1.local(笔记本的 IP)添加到我的 PC 的主机文件中。 192.168.100.76 是我电脑的 ip。
我可以从笔记本上 ping 我的电脑,反之亦然。
我尝试通过以下方式访问该网站
http://192.168.100.88
and
http://hp1.local
但无济于事。甚至没有 403 或任何东西,只是
错误:网络超时
编辑: 认为我已经尝试过:
- 为端口 80 设置入站规则(在我的 PC 上)
- 停用防火墙(在我的电脑上)
- 将 Apaches httpd.exe 添加到我的主机防火墙例外(解决方案)
【问题讨论】:
-
您需要笔记本上的入站规则。运行 WAMPServer 的那个
-
还将
192.168.100.88 hp1.local添加到客户端PC(没有运行WAMPServer的那个)的主机文件中 -
192.168.100.88 hp1.local已经在我电脑的主机文件中了。但是我现在也向主机添加了入站规则,即使它已经在工作了。以防万一。
标签: php mysql apache wamp wampserver