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


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

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

    一、httpd.conf文件更改

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

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

    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地址了~

  • 相关阅读:
    C#使用结构体,输入5个人的学号,姓名,分数,按照成绩高低排列打印出来
    数据库考试试题
    数据库存储系统应用,超市小票系统
    数据库变量与语句
    练习:C#---类(身份证号截取生日、验证邮箱、DateTime)
    Chapter 3. 类---String类、Math类、Datetime类
    练习:C#---for循环(整数和、阶乘、楼梯)
    Chapter 2 C#语句---异常语句
    Chapter 2. C#语句---循环语句
    Chapter 2 C#语句---选择语句
  • 原文地址:https://www.cnblogs.com/lijIT/p/9044743.html
Copyright © 2020-2023  润新知