• 游啊游
  • 信仰
  • 原点
  • 清明
  • 关不上的窗
  • 雨一直下-古筝
  • 你的样子
  • Sofía
  • Suddenly
  • Traveling Light
  • 城南花已开
  • 简单与秋夜
  • 最美的期待
Oo笑容太甜oO/

WAMP配置httpd.conf允许外部访问


一、httpd.conf文件更改

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

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

2、httpd.conf代码更改

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

更改为:

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

也就是允许其他请求访问。
在“Require local”后面加上一句:“Require all granted”

#
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
DocumentRoot "${INSTALL_DIR}/www"
<Directory "${INSTALL_DIR}/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 +Multiviews

    #
    # 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.
    #
#   Don't modify this line - Instead modify Require of VirtualHost in httpd-vhost.conf
    Require local
        Require all granted
</Directory>

二、httpd-vhosts.conf文件更改

打开“httpd-vhosts”文件,找到 Require local,并用“Require all granted”代替它,保存,关闭。##

# Virtual Hosts
#
<VirtualHost *:80>
  ServerName localhost
  ServerAlias localhost
  DocumentRoot "${INSTALL_DIR}/www"
  <Directory "${INSTALL_DIR}/www/">
    Options +Indexes +Includes +FollowSymLinks +MultiViews
    AllowOverride All
    #Require local
    Require all granted
  </Directory>
</VirtualHost>

三、关闭本机防火墙

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

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

仅有 1 条评论

  1. admin  Windows 10 x64 Edition  Firefox 73.0:

    转自 Hulkzero https://blog.csdn.net/zhangchb/article/details/80118179

    February 26th, 2020 at 10:07 pm