Wamp2.5(Apache2.4.9)外网访问403(Forbidden)错误

Posted AidenChen8

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Wamp2.5(Apache2.4.9)外网访问403(Forbidden)错误相关的知识,希望对你有一定的参考价值。

把wamp配置到Azure上之后,倒腾好久都没有解决403错误问题,网上百度了很多资料,差不多都是这样修改的:

1、在C:wamp/bin/apache/apache2.4.9/conf目录下找到“httpd.conf”文件(建议先备份一下)

2、将“httpd.conf”下240行处的:

<Directory />

  AllowOverride All
    OptionsNone
    Orderallow,deny
    Deny from all
</Directory>

将其改为

<Directory"c:/wamp/apache2/cgi-bin">

  AllowOverride All
    OptionsNone
    Orderallow,deny
    Allow from all
</Directory>

 

但实际上在后面的版本中,这样修改仍然会出现403错误,归其原因有两点:

1、2.5版本之后新增了一些命令;

2、单单配置这一个地方没有用。

 

后来继续查询资料,然后多次尝试之后发现这样改可以解决问题:

将“httpd.conf”下240行处改为:

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

将“httpd.conf”下约254行处改为:

<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>

然后保存后退出,重启Wamp就可以了。

 










以上是关于Wamp2.5(Apache2.4.9)外网访问403(Forbidden)错误的主要内容,如果未能解决你的问题,请参考以下文章

WAMP 2.5 (Apache 2.4.9) 允许从 LAN 上的所有计算机进行访问

WAMP 虚拟主机不工作

wampserver2.5 apache2.4.9:forbidden,本机可以访问,局域网内部能访问。

应用wamp3.x.x设置,让外网能够访问本服务器

wamp用www域名访问怎么配置?

wamp2.5可用php5.6,局域网访问,多站点配置