最近在使用wamp启动服务时,遇到一个坑,当启动服务以后,就只有自己的电脑能访问,而局域网内的其他IP是不能访问的:
查了很多资料都说是将什么改了之类的,都没有用,后来只是改了(你的安装路径)F:\wamp\bin\apache\apache2.4.23\conf\extra目录下的httpd-vhosts.conf。
只要将里面的ServerName:localhost和ServerAlias:localhost都改为本机的IP地址,然后将下面的Require local改为Require all granted就好了。
# Virtual Hosts
#
<VirtualHost *:80>
ServerName 你的IP地址
ServerAlias 你的IP地址
DocumentRoot F:/wamp/www/demo/public
<Directory "F:/wamp/www/demo/public/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
# Require local
Require all granted
</Directory>
</VirtualHost>
#