wampserver怎么设置外网可访问

wampserver配置httpd.conf容许外网访问?

在电脑上开启wamp服务后,默认是禁止外部网络访问的,若是您想要同一局域网中的设备可以访问PC上的web项目,则须要对httpd.conf文件进行一些修改。web

1、修改httpd.conf文件

一、httpd.conf文件在哪?

通常是在wamp安装目录的 bin\apache\apache2.4.23\conf\httpd.conf,例如:个人电脑wamp安装在D盘的wamp文件夹,则httpd.conf文件路径为D:\wamp\bin\apache\apache2.4.23\conf\httpd.confapache

找到本身httpd.conf文件了吗?若是找到了,咱们就继续吧!!浏览器

二、修改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 grantedui

即:命令行

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服务。

二、确保将要访问此PC的设备(如:手机)和此PC链接在同一个网络,处于同一个局域网中

三、win+R输入cmd,打开命令行,在命令行输入ipconfig,查看此PC的ip

四、将要访问此PC的设备(如手机)的浏览器的地址栏中输入刚才查到的ip

这时候咱们就能够经过其余设备访问本机的web项目了!

相关文章
相关标签/搜索