安裝好PostFit後,沒有報表分析怎行呢?找了支援PostFix之源的分析軟體,採用awstats分析
1.sudo apt-get install awstats

修改設定檔案,請參考以下的網址
http://awstats.sourceforge.net/docs/awstats_faq.html#MAIL

2.sudo vim /etc/awstats/awstats.conf
#LogFile只需要修改後面的 /var/log/mail.log的位置就可以囉,若你安裝的awstats的maillogconvert.pl不再以下的路徑,也請你改一下
LogFile="perl /usr/share/doc/awstats/examples/maillogconvert.pl  standard < /var/log/mail.log |"
#設定Log的類型 = M
LogType=M
LogFormat="%time2 %email %email_r %host %host_r %method %url %code %bytesd"
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

3.執行編譯執行檔
root@ubuntu:#/usr/lib/cgi-bin/awstats.pl -config=awstats.conf

會出現以下的文字:
Error: SiteDomain parameter not defined in your config/domain file. You must edit it for using this version of AWStats.
Setup ('/etc/awstats/awstats.conf' file, web server or permissions) may be wrong.
Check config file, permissions and AWStats documentation (in 'docs' directory).

那是因為沒有設定 SiteDomain= 參數
再次修改 vim /etc/awstats/awstats.conf
SiteDomain=xxx.com.tw

在執行一次
root@ubuntu:#/usr/lib/cgi-bin/awstats.pl -config=awstats.conf

Create/Update database for config "/etc/awstats/awstats.conf" by AWStats version 6.95 (build 1.943)
From data in log file "perl /usr/share/doc/awstats/examples/maillogconvert.pl  standard < /var/log/mail.log |"...
Phase 1 : First bypass old records, searching new record...
Searching new records from beginning of log file...
Phase 2 : Now process new records (Flush history on disk after 20000 hosts)...
Warning: awstats has detected that some hosts names were already resolved in your logfile perl /usr/share/doc/awstats/examples/maillogconvert.pl  standard < /var/log/mail.log |.
If DNS lookup was already made by the logger (web server), you should change your setup DNSLookup=1 into DNSLookup=0 to increase awstats speed.
Jumped lines in file: 0
Parsed lines in file: 23
 Found 0 dropped records,
 Found 0 corrupted records,
 Found 22 old records,
 Found 1 new qualified records.

4.完成,請開啟IE看結果
http://192.168.255.129/cgi-bin/awstats.pl

5.建立排程取得最新資料
sudo crontab -e
0 */6 * * * /usr/lib/cgi-bin/awstats.pl -config=awstats.conf -update
每六個小時就執行一次

arrow
arrow
    全站熱搜

    蒼穹 發表在 痞客邦 留言(0) 人氣()