FAMP相關設定檔
Apache設定檔路徑
- 設定檔:
/usr/local/etc/apache24/httpd.conf
網頁目錄:
/usr/local/www/apache24/data/
刪除index.html
% sudo rm /usr/local/www/apache24/data/index.html
關閉IndexOf功能
% sudo vi /usr/local/etc/apache24/httpd.conf # 將257行的Indexes刪除 Options Indexes FollowSymLinks 改為 Options FollowSymLinks
新增首頁預設檔名
% sudo vi /usr/local/etc/apache24/httpd.conf 在 DirectoryIndex index.html 後新增 index.htm index.php
設定錯誤網頁
% sudo vi /usr/local/etc/apache24/httpd.conf # 將ErrorDocument 404 /missing.html 最前面的註解拿掉 # 並設定missing.html網頁內容 ErrorDocument 404 /missing.html
查看Apache伺服器狀態
- 啟動httpd-info網頁
% sudo vi /usr/local/etc/apache24/httpd.conf # 將下方指令最前面註解拿掉 Include etc/apache24/extra/httpd-info.conf
- 修改可讀取狀態之IP範圍
% sudo vi /usr/local/etc/apache24/extra/httpd-info.conf <Location /server-status> SetHandler server-status Require host .example.com Require ip 192.168.9. #.9層的ip都可以看這個網站 </Location> ExtendedStatus On #改On
- 查看伺服器狀態
在網址列輸入http://IP/server-status
後面可接?refresh=5
代表5秒自動重新整理一次