Wamp2.5(Apache2.4.9)外網訪問403(Forbidden)錯誤

來源:互聯網
上載者:User

標籤:Owner   沒有   oca   目錄   one   color   org   amp   important   

把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)錯誤

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.