| 請依路徑開啟 httpd.conf 的Apache組態設定檔
路徑:c:\Program Files\Apache Group\Apache2\conf\httpd.conf
用記事本開啟後,進行設定:
利用記事本的:編輯 => 尋找 來進行字串尋找

A、找尋DirectoryIndex字串:設定首頁名稱,用一空白字元分隔
表示依序找尋首頁的位置,只要打網址就會先找index.php,若沒有再找index.htm,若沒再找index.html
找到此行:DirectoryIndex index.html index.html.var
設定加入index.php如右:DirectoryIndex index.php index.htm
index.html |
B、找尋AddDefaultCharset字串:設定語系
找到此行:AddDefaultCharset ISO-8859-1
設定成:
#AddDefaultCharset ISO-8859-1
AddDefaultCharset .Big5 |
C、找尋DocumentRoot字串:設定首頁目錄
|
找到此行:
DocumentRoot "C:/Program Files/Apache Group/Apache2/htdocs"
如上行是預設的首頁目錄,可以自行更改,不改也可以
如:DocumentRoot "C:/myweb"
|
D、設定Apache編譯工作
到httpd.conf檔的最下面空白行加入三行
ScriptAlias /php/ "c:/php/"
AddType Application/x-httpd-php .php .php3
Action application/x-httpd-php "/php/php.exe"
|
E、存檔後重新啟動Apache即可套用
因為這是Apache伺服器的組態,設定後必須重新啟動(Restart)Apache,才會套用新的設定,每次修改都要重新啟動,另外,文字的大小寫,因為在Windows系統下不分大小寫,所以文字大小寫沒差,但若在Linux系統下設定,文字大小寫是固定的喲!
|
檢視修改的組態設定檔 |