Ubuntu 16.04
Sponsored Link

MailLog Report : AWstats
2016/06/01
 
Install Mail Log reporting tool, it's AWstats.
[1]
[2] Install AWstats.
root@mail:~#
apt-get -y install awstats
# copy awstats.conf to "awstats.(hostname).conf"

root@mail:~#
cp /etc/awstats/awstats.conf /etc/awstats/awstats.mail.srv.world.conf

root@mail:~#
cp /usr/share/doc/awstats/examples/maillogconvert.pl /usr/share/awstats

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

LogFile="
/usr/share/awstats/maillogconvert.pl standard < /var/log/mail.log |
"
# line 62: change

LogType=
M
# line 122: comment out and add

#
LogFormat=4
LogFormat="%time2 %email %email_r %host %host_r %method %url %code %bytesd"
# line 153: specify hostname

SiteDomain="
mail.srv.world
"
# line 222: change

DirIcons="
./icon
"
# line 848: change like follows

LevelForBrowsersDetection=
0

LevelForOSDetection=
0

LevelForRefererAnalyze=
0

LevelForRobotsDetection=
0

LevelForSearchEnginesDetection=
0

LevelForKeywordsDetection=
0

LevelForFileTypesDetection=
0

LevelForWormsDetection=0
# line 966: change like follows

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:~#
mkdir /var/www/html/awstats

root@mail:~#
ln -s /usr/share/awstats/icon /var/www/html/awstats/icon

root@mail:~#
vi /etc/apache2/sites-available/awstats.conf
# create new

<Directory /var/www/html/awstats>
    Require ip 127.0.0.1 10.0.0.0/24
</Directory>
root@mail:~#
a2ensite awstats

Enabling site awstats.
To activate the new configuration, you need to run:
  service apache2 reload

root@mail:~#
systemctl restart apache2

# generate reports

root@mail:~#
/usr/lib/cgi-bin/awstats.pl -config=mail.srv.world -update
# generate HTML from reports

root@mail:~#
/usr/lib/cgi-bin/awstats.pl -config=mail.srv.world -output -staticlink > /var/www/html/awstats/index.html

[3] Access to 'http://(your server's name or IP address)/awstats/' with web browser. Then following screen is shown and it's possible to make sure mail log summary.
Matched Content
 
Tweet