站內搜尋

Saturday, May 21, 2011

[架站] 安裝Apache注意事項

本篇之安裝檔為Apache官網下載之安裝檔,同時安裝到預設資料夾位置(C:\Program Files\Apache Software Foundation)。

Q:如何設定網站根目錄?
A:
1.開啟C:\Program Files\Apache Software Foundation\Apache2.2\conf\httpd.conf
2.搜尋DocumentRoot
3.變更成你想要的檔案位置,例如:
DocumentRoot "C:/www"

如果發現出現 Forbidden 的錯誤訊息,代表訪問網站的權限沒開,加入下列設定
<Directory "C:/www">
Allow from all
</Directory>

Q:網站不會自動顯示index.php的網頁,怎麼辦?
A:
1.開啟C:\Program Files\Apache Software Foundation\Apache2.2\conf\httpd.conf
2.搜尋DirectoryIndex
3.增加成你想要的自動開啟的格式(中間用空格作間隔),例如:
DirectoryIndex index.html index.php

No comments:

Post a Comment