Webアクセスログ解析(AWStats)のインストール
AWStatsをインストールします。
root@www:~# apt -y install awstats
root@www:~# vi /etc/awstats/awstats.ubuntuserver.jp.conf
LogFormat=1
SiteDomain="ubuntuserver.jp"
HostAliases="localhost 127.0.0.1 REGEX[^.*ubuntuserver\.jp$] REGEX[^192\.168\.1\.]"
root@www:~# cp /usr/share/doc/awstats/examples/apache.conf /etc/apache2/conf-available/awstats.conf
root@www:~# vi /etc/apache2/conf-available/awstats.conf
Allow from 192.168.1.1/24
#ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
root@www:~# a2enconf awstats serve-cgi-bin
root@www:~# systemctl restart apache2 root@www:~# sed -i -e "s/www-data/root/g" /etc/cron.d/awstats
root@www:~# /usr/share/awstats/tools/update.sh
awstats:http://ubuntuserver.jp/cgi-bin/awstats.pl
メールログ解析(Pfiogsumm)のインストール
pflogsumm をインストールします。
root@www:~# apt -y install pflogsumm
root@www:~# perl /usr/sbin/pflogsumm -d yesterday /var/log/maillog Postfix log summaries for Jul 29 Grand Totals ------------ messages 8 received 8 delivered 2 forwarded 1 deferred (1 deferrals) 0 bounced 0 rejected (0%) 0 reject warnings 0 held 0 discarded (0%) 2428k bytes received 2429k bytes delivered 3 senders 2 sending hosts/domains 2 recipients 2 recipient hosts/domains Per-Hour Traffic Summary ------------------------ time received delivered deferred bounced rejected -------------------------------------------------------------------- 0000-0100 0 0 0 0 0 0100-0200 0 0 0 0 0 0200-0300 0 0 0 0 0 …
root@www:~# crontab -e
00 01 * * * perl /usr/sbin/pflogsumm -e -d yesterday /var/log/mail.log | mail -s 'Logwatch for Postfix' root
コメント