看来我在上面的 cmets 中给了你一些错误的建议。
你所说的图标实际上是我忘记的一个新图标。
此图像 表示您已设置 WAMPServer Online,即您已使用 Online/Offline 菜单并将 Apache 设置为 Online。
注意:没有必要为正常的开发活动设置 Apache Online。 Online 只表示 Apache 可以被宇宙中的任何 IP 地址访问。
换句话说,当在线httpd.conf文件在
<Directory "D:/wamp/www/">
httpd.conf 部分
# onlineoffline tag - don't remove
Require all granted
正常情况下有
# onlineoffline tag - don't remove
Require local
除非您实际尝试从 Internet 访问您的网站,否则不需要在线。
澄清后的其他信息
好的,所以如果您只是想打开本地网络的连接,那么您必须这样做。 WAMPServer3 默认添加了使用 localhost 作为虚拟主机。所以现在你应该将httpd.conf 文件保留为
# onlineoffline tag - don't remove
Require local
现在编辑\wamp\bin\apache\apache{version}\conf\extra\httpd-vhost.conf 并像这样添加您的访问要求
默认是这个
<VirtualHost *:80>
ServerName localhost
DocumentRoot c:/wamp/www
<Directory "c:/wamp/www/">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>
所以只需添加这样的要求
<VirtualHost *:80>
ServerName localhost
DocumentRoot c:/wamp/www
<Directory "c:/wamp/www/">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require local
Require ip 192.168.0.1
Require ip 192.168.0.2
</Directory>
</VirtualHost>
或者为本地网络中的任何 ip 添加这个
<VirtualHost *:80>
ServerName localhost
DocumentRoot c:/wamp/www
<Directory "c:/wamp/www/">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require local
Require ip 192.168.0
</Directory>
</VirtualHost>