AWSTATS配置说明-以年查看流量报错处理方法
我們已介紹過使用AWSTATS來分析APACHE的日誌檔(LOG File),若您想將它拿來分析Mail 伺服器的LOG File,那麼我們只要稍加更改 awstats.yourdoamin.conf 設定即可。這邊以 sendmail 的日誌檔為例,設定檔範例如下:
# 使用maillogconvert.pl 轉換 maillog LogFile="perl /usr/local/awstats/tools/maillogconvert.pl standard < /var/log/maillog |" # 日誌模式為 M - Mail LogType=M # 日誌格式 LogFormat="%time2 %email %email_r %host %host_r %method %url %code %bytesd" # 你的郵件主機或網域名稱 SiteDomain="your.domain" HostAliases="mail.your.domain your.domain localhost 127.0.0 .1 REGEX[your/.doamin$]" DirData="." DirCgi="/awstats" DirIcons="/awstatsicons" Lang="tw" # 設定是否可以從網頁分析整年的日誌,預設為2,設定為3時需注意分析時可能會對 # 主機造成一定的負載 # 0 - 不允許 # 1 - 只允許從指令產生,但-Year- 值不可看見 # 2 - 只允許從指令產生,-Year- 值可被看見但不被允許 # 3 - 可以從指令列及CGI產生 AllowFullYearView=3 # 其它的為awstats文件的範例設定值 LevelForBrowsersDetection=0 LevelForOSDetection=0 LevelForRefererAnalyze=0 LevelForRobotsDetection=0 LevelForWormsDetection=0 LevelForSearchEnginesDetection=0 LevelForFileTypesDetection=0 ShowMenu=1 ShowSummary=HB ShowMonthStats=HB ShowDaysOfMonthStats=HB ShowDaysOfWeekStats=HB ShowHoursStats=HB ShowDomainsStats=0 ShowHostsStats=HBL ShowAuthenticatedUsers=0 ShowRobotsStats=0 ShowEMailSenders=HBML ShowEMailReceivers=HBML ShowSessionsStats=0 ShowPagesStats=0 ShowFileTypesStats=0 ShowFileSizesStats=0 ShowBrowsersStats=0 ShowOSStats=0 ShowOriginStats=0 ShowKeyphrasesStats=0 ShowKeywordsStats=0 ShowMiscStats=0 ShowHTTPErrorsStats=0 ShowSMTPErrorsStats=1 |
之後一樣將它納入排程即可。 若您要允許從網頁產生整年的報表,請注意此舉會造成分析時伺服器的CPU負載較高,且請注意目錄安全性的設定,建議只允許特定主機查看,或使用驗證機制。 要從網頁上觀看整年統計圖表可以在瀏覽器中選取,若無法產生,可以在網址列下這樣的語法:
http://172.20.1.100/awstats/awstats.pl?month=all&year=2006&output=main&config=mail