首页 > 代码库 > Wamp2.5(Apache2.4.9)外网访问403(Forbidden)错误

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)错误