本篇出處:酷米的資訊筆記

最近公司的網路一到下午就開始lag~ 之前其他的流量統計都已經裝過了,如:NTOP、bandwidth等

目前已經知道流量都被mail服務佔用,現在就是要找出到底是誰一直在找我麻煩啦!...痾~應該是說

找出那個帳號一直使用mail服務佔用留量。

廢話不多說了~請看以下的範例吧 

awstats 畫面demo圖 

 attachments/200712/3077507453.png

1.下載awstats 套件 <==點這邊下載(目前我用的是6.7版)

2.解壓縮並搬移wwwroot下的資料至網站目錄下。

    cd awstats-6.7

    mkdir /var/www/網站目錄/awstats/ 

    cp -a wwwroot/* /var/www/網站目錄/awstats/ 

 

3.複製 tools/maillogconvert.pl至cgi-bin下。

    cp -a tools/maillogconvert.pl /var/www/網站目錄/awstats/cgi-bin/

 

4.新增awstats.conf並修改內容。

    touch awstats.conf 

    vi /var/www/網站目錄awstats/cgi-bin/awstats.conf

    SiteDomain="網域名稱"
    LogFile="/var/www/網站目錄/awstats/cgi-bin/maillogconvert.pl standard < /var/log/maillog |"
    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
    ShowMonthStats=HB
    ShowDaysOfMonthStats=HB
    ShowDaysOfWeekStats=HB
    ShowHoursStats=HB
    ShowDomainsStats=0
    ShowHostsStats=HBL
    ShowAuthenticatedUsers=0
    ShowRobotsStats=0
    ShowEMailSenders=HBL
    ShowEMailReceivers=HBL
    ShowSessionsStats=0
    ShowPagesStats=0
    ShowFileTypesStats=0
    ShowFileSizesStats=0
    ShowBrowsersStats=0
    ShowOSStats=0
    ShowOriginStats=0
    ShowKeyphrasesStats=0
    ShowKeywordsStats=0
    ShowMiscStats=0
    ShowHTTPErrorsStats=0
    ShowSMTPErrorsStats=1

 

5.修改httpd.conf,在網站參數設定區域中新增下列設定。

    Alias /classes/ /var/www/網站目錄/awstats/classes/
    Alias /css/ /var/www/網站目錄/awstats/css/
    Alias /icon/ /var/www/網站目錄/awstats/icon/
    ScriptAlias /cgi-bin/ /var/網站目錄/kume/awstats/cgi-bin/

 

6.重新啟動httpd。

7.在crontab加入排程。

30 * * * * /var/www/網站目錄/awstats/cgi-bin/./awstats.pl -config=mail -update &

ps:上面的 "網站目錄" & "網域名稱" 請自行依照實際情況修改。

arrow
arrow
    全站熱搜

    正義的胖虎 發表在 痞客邦 留言(0) 人氣()