在电脑上开启Apache服务后,如何让外部网络访问呢?

在网上查找答案和问过一些小伙伴后,得到以以下方案。大致是在httpd.conf中加入一些语句以及利用自己的WiFi建立热点,让需要访问的设备连接上。

一、httpd.conf文件更改

1、找到httpd.conf文件位置:

在你的wamp安装目录下的\bin\apache\apache2.4.9\conf文件夹中。此台电脑上我的文件路径为:C:\wamp\bin\apache\apache2.4.9\conf

2、httpd.conf代码更改

①在第240行左右的位置将

<Directory />
AllowOverride none
Require all denied
</Directory>

  更改成

<Directory />
AllowOverride none
#Require all denied
Require all granted
</Directory>

  

也就是允许其他请求访问。

②在第280行左右的位置在“Require local”后面加上一句:“Require all granted”

<Directory "c:/wamp/www/">
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/2.4/mod/core.html#options
# for more information.
#
Options Indexes FollowSymLinks #
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# AllowOverride FileInfo AuthConfig Limit
#
AllowOverride all #
# Controls who can get stuff from this server.
# # onlineoffline tag - don't remove
Require local
Require all granted
</Directory>

 

二、重启apache 服务

三、关闭本机防火墙或者添加端口策略

四、通过ipconfig查看本机的ipv4地址

这时候我们就可以访问利用其他设备访问本机的IP地址了~

WAMP配置httpd.conf允许外部访问的更多相关文章

  1. wamp中apache2.4.9配置httpd.conf允许外部访问

        安装最新的wamp后发现通过外部网络无法访问本机的apache.在网上查询了相关问题,所有的答案基本都是说在httpd.conf文件中加入语句Allow from all.但是这些对应的是ap ...

  2. 关于WAMPserver配置httpd.conf无法修改根目录解决方法

    最近在学习php开发, 在慕课网上先听了安装配置WAMP server的课,可是第二步配置网站根目录的地方就出错了,按照网课上讲的将httpd.conf文件中的 [Document] 和[Direct ...

  3. Apache的配置httpd.conf文件配置

    (1) 基本配置: ServerRoot "/mnt/software/apache2" #你的apache软件安装的位置.其它指定的目录如果没有指定绝对路径,则目录是相对于该目录 ...

  4. apache配置httpd.conf相关

    1.apache开启压缩AddOutputFilterByType 找到并打开apache/conf目录中的httpd.conf文件 在httpd.conf中打开deflate_Module,head ...

  5. apache配置httpd.conf的webapp根目录(基于appserv服务)

    只要修改httpd.conf中两个配置项的值即可: DocumentRoot "E:/workspacePHP/what" <Directory "E:/works ...

  6. 配置IIS Express 允许外部访问

    修改applicationhost.config 配置允许外部访问 操作步骤: 1. 查看本机IP地址记录IP地址,例如:10.1.20.138 2. 如下图,找到要发布的站点的名称 记录站点的名称, ...

  7. 安装完Apache后,配置httpd.conf来使apache来加载php模块

    以apache模块的方式来安装php,在httpd.conf文件中首先使用LoadModule php5_module '.../php5apache2.dll'来动态装载Php模块,然后再用语句Ad ...

  8. IIS配置Windows防火墙允许外部访问

    控制面板-Windows防火墙-高级设置-入站规则 在入站规则窗口中找到“BranchCache内容检索(HTTP-In)”选项并启用此规则. 这时候远程用户通过网站地址即可访问站点程序. 但是如果远 ...

  9. wamp配置apache虚拟主机支持多域名访问localhost

    1.背景: 在进行网站开发的时候,通常需要以http://localhost或者127.0.0.1等地址来访问本地环境的网站.不过随着开发项目的增多,需要每次先访问localhost然后再选项目,显得 ...

随机推荐

  1. django系列8.5--使用装饰器(视图函数中)实现用户登录状态检验

    views.py def session_auth(fn): def inner(request,*args,**kwargs): status = request.session.get('sess ...

  2. 正则表达式的Wed验证应用(40)

    电子邮件地址的校验 <?php /* 校验邮件地址*/ function checkMail($email) { //用户名,由“\w”格式字符.“-”或“.”组成 $email_name= & ...

  3. A - 最少拦截系统 (最长上升子序列)

    点击打开链接 A - 最少拦截系统 某国为了防御敌国的导弹袭击,发展出一种导弹拦截系统.但是这种导弹拦截系统有一个缺陷:虽然它的第一发炮弹能够到达任意的高度,但是以后每一发炮弹都不能超过前一发的高度. ...

  4. 【ocp-12c】最新Oracle OCP-071考试题库(41题)

    41.(8-14) choose two View the Exhibit and examine the structure of the ORDERS table. The columns ORD ...

  5. 【Oracle 12c】CUUG OCP认证071考试原题解析(32)

    32.choose the best answer View the Exhibit and examine the data in EMP and DEPT tables. In the DEPT ...

  6. SpringMVC常用方法大全

    ---恢复内容开始--- web.xml: <?xml version="1.0" encoding="UTF-8"?> <web-app x ...

  7. axios跨域问题

    最近遇到一个很奇怪的问题,在帮助测试妹子做一个小项目的时候,遇到了一个很棘手的问题,axios请求的时候报404,请求type是options,我当时的第一反应就是跨域问题,果然在console里面还 ...

  8. 火焰图定位dbproxy问题

    https://blog.csdn.net/oujiangping/article/details/78580450 https://blog.csdn.net/gatieme/article/det ...

  9. 架构师养成记--20.netty的tcp拆包粘包问题

    问题描述 比如要发ABC DEFG HIJK 这一串数据,其中ABC是一个包,DEFG是一个包,HIJK是一个包.由于TCP是基于流发送的,所以有可能出现ABCD EFGH 这种情况,那么ABC和D就 ...

  10. 题目1006:ZOJ问题(字符串处理)

    问题来源 http://ac.jobdu.com/problem.php?pid=1006 问题描述 输入一个只包含'z','o','j'三种字符的字符串,判断是否符合要求. 问题分析 分析AC的三个 ...