在电脑上开启wamp服务后,默认是禁止外部网络访问的,若是您想要同一局域网中的设备可以访问PC上的web项目,则须要对httpd.conf文件进行一些修改。web
通常是在wamp安装目录的 bin\apache\apache2.4.23\conf\httpd.conf
,例如:个人电脑wamp安装在D盘的wamp文件夹,则httpd.conf文件路径为D:\wamp\bin\apache\apache2.4.23\conf\httpd.conf
apache
找到本身httpd.conf文件了吗?若是找到了,咱们就继续吧!!浏览器
i、 在244行左右,将:网络
<Directory /> AllowOverride none Require all denied </Directory>
改成:ide
<Directory /> AllowOverride none #Require all denied Require all granted </Directory>
ii、在280行左右,在 Require local
后面加上一句 Require all granted
ui
即:命令行
onlineoffline tag - don't remove Require local Require all granted
iii、打开wampserver3.0.4安装目录,找到”httpd-vhosts“文件,将Require local 修改成:Require all grantedcode
即: server
<Directory "E:/www/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
#Require local
Require all granted
</Directory>ip
到此,代码部分就修改完毕了,记得重启一下Apache服务。
win+R
输入cmd,打开命令行,在命令行输入ipconfig,查看此PC的ip这时候咱们就能够经过其余设备访问本机的web项目了!