Fedora 20
Sponsored Link

Mail Log Analyzer - AWstats
2014/01/07
 
Install maillog analyzer AWstats. Web Server is also needed. Web Server is also necessarry to be installed.
[1] Install AWstats
[root@mail ~]#
yum -y install awstats
# the config file "awstats.(hostname).conf" is automatically created

[root@mail ~]#
vi /etc/awstats/awstats.mail.srv.world.conf
# line 51: change

LogFile="
/usr/share/awstats/tools/maillogconvert.pl standard < /var/log/maillog |
"
# line 63: change

LogType=
M
# line 123 make it comment / add the line below

#
LogFormat=1
LogFormat="%time2 %email %email_r %host %host_r %method %url %code %bytesd"
# line 839: change like below

LevelForBrowsersDetection=
0

LevelForOSDetection=
0

LevelForRefererAnalyze=
0

LevelForRobotsDetection=
0

LevelForSearchEnginesDetection=
0

LevelForKeywordsDetection=
0

LevelForFileTypesDetection=
0

LevelForWormsDetection=0
# line 957: change like below

ShowMonthStats=
UHB

ShowDaysOfMonthStats=
HB

ShowDaysOfWeekStats=
HB

ShowHoursStats=
HB

ShowDomainsStats=
0

ShowHostsStats=
HBL

ShowRobotsStats=
0

ShowEMailSenders=
HBML

ShowEMailReceivers=
HBML

ShowSessionsStats=
0

ShowPagesStats=
0

ShowFileTypesStats=
0

ShowOSStats=
0

ShowBrowsersStats=
0

ShowOriginStats=
0

ShowKeyphrasesStats=
0

ShowKeywordsStats=
0

ShowMiscStats=
0

ShowHTTPErrorsStats=
0

ShowSMTPErrorsStats=
1
[root@mail ~]#
vi /etc/httpd/conf.d/awstats.conf
# line 24: add Alias

Alias /report "/usr/share/awstats/wwwroot/"

<Directory "/usr/share/awstats/wwwroot">
    Options None
    AllowOverride None
    <IfModule mod_authz_core.c>
        # Apache 2.4
        Require local
# line 31: add IP address you permit to access

       
Require ip 10.0.0.0/24

    </IfModule>
[root@mail ~]#
systemctl restart httpd.service

# generate reports

[root@mail ~]#
/usr/share/awstats/wwwroot/cgi-bin/awstats.pl -config=mail.srv.world -update

Create/Update database for config "/etc/awstats/awstats.mail.srv.world.conf" by AWStats version 7.1.1 (build 1.989)
From data in log file "/usr/share/awstats/tools/maillogconvert.pl standard < /var/log/maillog |"...
Phase 1 : First bypass old records, searching new record...
Direct access to last remembered record has fallen on another record.
So searching new records from beginning of log file...
Jumped lines in file: 0
Parsed lines in file: 1
Found 0 dropped records,
Found 0 comments,
Found 0 blank records,
Found 0 corrupted records,
Found 1 old records,
Found 0 new qualified records.
# generate HTML from reports

[root@mail ~]#
/usr/share/awstats/wwwroot/cgi-bin/awstats.pl -config=mail.srv.world -output -staticlink > /usr/share/awstats/wwwroot/index.html
# change cron settings

[root@mail ~]#
vi /etc/cron.hourly/awstats
#!/bin/bash
# comment out

#
exec /usr/share/awstats/tools/awstats_updateall.pl now -configdir="/etc/awstats" -awstatsprog="/usr/share/awstats/wwwroot/cgi-bin/awstats.pl" > /dev/null
# add

/usr/share/awstats/wwwroot/cgi-bin/awstats.pl -config=mail.srv.world -update > /dev/null
/usr/share/awstats/wwwroot/cgi-bin/awstats.pl -config=mail.srv.world -output -staticlink > /usr/share/awstats/wwwroot/index.html

exit 0
[2] Access to 'http://(your server's name or IP address)/report/' with web browser. Then following screen is shown and it's possible to make sure mail log summary. ( "http://(your server's name or IP address)/)/awstats/awstats.pl" is also accessible )
Matched Content