I. Log splitting of Apache
1. Configure Apache to use Cronolog:
The following configuration is carried out in the virtual host because Apache is enabled for the experiment, so it is also convenient for multi-site analysis operations.
Vim/etc/httpd/conf.d/vhosts.conf
Replace the Customlog and errorlog in the configuration file with the following (because we want to multi-site, so here to replace two virtual host, and the log storage name to make a valid distinction only good)
Www.test.com
Customlog "|/usr/local/sbin/cronolog logs/www.test.com_access_log_%y%m%d" combined
Errorlog "|/usr/local/sbin/cronolog logs/www.test.com_access_log_error_%y%m%d"
Www.test2.com
Customlog "|/usr/local/sbin/cronolog Logs/www.test2.com_access_log_access_%y%m%d.log" combined
Errorlog "|/usr/local/sbin/cronolog Logs/www.test2.com_error_%y%m%d.log"
Note: It is important to note that the log name configuration for two Web sites
2. Using logrotate:
/var/log/httpd/*log {
Daily
Dateext
Copytruncate
Rotate 60
Missingok
Notifempty
Sharedscripts
Postrotate
/sbin/service httpd reload >/dev/null 2>/dev/null | | True
Endscript
}
Second, awstats configuration:
1, logfile= "/var/log/httpd/www.test.com_access_log-%yyyy-0%mm-0%dd-0"
Logfile= "/var/log/httpd/www.test2.com_access_log-%yyyy-0%mm-0%dd-0"
Analysis of the data from the preceding day
2. Execute command:/usr/local/awstats/tools/awstats_updateall.pl now
3, crontab add:
0 9 * * * (time/usr/local/awstats/tools/awstats_updateall.pl now) &>/usr/local/awstats/logs/
Awstats.log
This article is from the "Autumn Fairy tale" blog, please be sure to keep this source http://wushank.blog.51cto.com/3489095/1715640
Awstats Multi-site log analysis for Apache