close

今天遇到一個新機器,把舊機器上的 Apache config (httpd.conf) 和程式直接丟上去,卻跑出錯誤訊息:

403 Forbidden
You don't have any permission on ...
(路徑名稱)

原來是舊機器用 Apache 2.2,新機器是 Aapche 2.4,config 要做一些調整。

在 Apache 2.2 是這樣寫:

Order allow, deny
Allow from all

在 Apache 2.4 要改成:

Require all granted

其他換版本後的設定調整可以參考 Tsung 的《Apache 2.2 升級到 2.4 的 Conf 調整修復》

 

 

--
另外有個小地方,是我們同時在 Load Balance 的主機群裡混用了不分大小寫的 Windows 與大小寫敏感的 Linux,所以在 Apache 開了 CheckSpelling On。不過這會造成當 user 嘗試連結到某一檔案時,server 會自動把使用者轉向 (HTTP status code 301) 到檔名類似的網頁。

要解決這個問題,別忘了除了 CheckSpelling On 之外,再加上 CheckCaseOnly On。

 

arrow
arrow
    全站熱搜

    小攻城師 發表在 痞客邦 留言(0) 人氣()