在电脑上开启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. junit所需要的jar包

    hamcrest-core-1.1.jar junit-4.12.jar http://central.maven.org/maven2/org/hamcrest/hamcrest-core/1.3/ ...

  2. PHP之旅 php数据类型

    1.php中int型,表示八进制或十六进制或者十进制时的不同,八进制前面加0,十六进制前面加0x <?php $dec_int=99; $oct_int=066; $hex_int=0X1a; ...

  3. Bootstrap Modal 关闭时右侧滚动条消失,页面左移的解决方法

    问题描述:页面在打开Modal之前右侧有滚动条,Modal关闭之后,body中的class="modal-open"和style="padding-right: 17px ...

  4. Python中复制、深拷贝和浅拷贝的区别

    深拷贝定义(deepcopy) 在Python中,由于一切皆对象,所以任何变量都可以被引用,也即可以被赋值给任何变量.但是在Python中,给变量赋值,是区分的,一般情况下,Python中的变量赋值都 ...

  5. 【算法笔记】A1060 Are They Equal

    1060 Are They Equal (25 分)   If a machine can save only 3 significant digits, the float numbers 1230 ...

  6. LOJ3069. 「2019 集训队互测 Day 1」整点计数(min_25筛)

    题目链接 https://loj.ac/problem/3069 题解 复数真神奇. 一句话题意:令 \(f(x)\) 表示以原点 \((0, 0)\) 为圆心,半径为 \(x\) 的圆上的整点数量, ...

  7. 索引(Awakening!)

    orz写个索引,方便日后复习和补充. 目前笔记还不是很多,而且写得比较烂,望各位到访的巨佬谅解. 大概可以算作一个归纳总结? ……没链接的还没开始写或者没写完,而且不知道什么时候才能写完(咕咕咕) 一 ...

  8. 2018徐州网络赛 - Trace

    题意:n个左下角为原点右上角在第一象限的矩形不断覆盖,求最后形成的图形的周长 x和y是独立的,分别维护两棵线段树,一棵表示x坐标下最大的y值,另一棵表示y坐标下最大的x值 从覆盖的角度来考虑,如果逆序 ...

  9. springboot: mybatis的使用

    第一步:引入mybatis依赖 <dependency> <groupId>org.mybatis.spring.boot</groupId> <artifa ...

  10. Git的介绍和使用

    Git是目前世界上最先进的分布式版本控制系统 Git的安装 1.在linux上安装 你可以先输入git,看看系统是不是已经自带了git 或者 sudo apt-get install git  就可以 ...