Awstats Multi-site log analysis for Apache

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.