«

»

May 07 2009

Awstats ile postfix logları analizi

1. Depodan paketi kurduktan sonra, /etc/awstats altında bulunan awstats.conf dosyasını sunucu ismini ekleyerek  (Ör: /etc/awstats/awstats.sunucu.alan.adi) kopyala ve bu dosyayı kafana göre düzenle.

2. /etc/apache2/conf.d/awstats.conf dosyasını oluştur ve içine şunları gir, sonra apache’yi yeniden başlat.
Alias /awstatsclasses “/usr/share/awstats/lib/”
Alias /awstats-icon/ “/usr/share/awstats/icon/”
Alias /awstatscss “/usr/share/doc/awstats/examples/css”
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
ScriptAlias /awstats/ /usr/lib/cgi-bin/
Options ExecCGI -MultiViews +SymLinksIfOwnerMatch

3. Cron’a aşağıdaki şekilde script çalıştırmayı ekle, 5 dakikada bir güncellesin:
0,5,10,15,20,25,30,35,40,45,50,55 * * * * /usr/lib/cgi-bin/awstats.pl -config=sunucu.alan.adi -update >/dev/null

4. /etc/awstats/awstats.sunucu.alan.adi dosyasındaki LogFile satırını (muhtemelen 52. satır) aşağıda anlatıldığı şekilde düzenle:
Tek bir metin dosyasını almak için:
LogFile=”perl /usr/share/doc/awstats/examples/maillogconvert.pl standard < /var/log/mail.info |”
Sıkıştırılmış dosyayı almak için:
LogFile=”gzip -cd /var/log/mail.*gz | /usr/share/doc/awstats/examples/maillogconvert.pl standard |”

5. Aynı dosyanın geri kalanını da şu şekilde düzenle ki, web loglarını analiz etmeye uğraşmasın:
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

6. http://sunucu.alan.adi/awstats/awstats.pl?config=sunucu.alan.adi adresine girerekten çalışıp çalışmadığını gör.

Bad Behavior has blocked 20 access attempts in the last 7 days.