CentOS installation is simple
Yum Install Epel-release
Yum Install Cronolog
Then configure the virtual host
[[email protected] ~]# vim/opt/app/apache/conf/extra/httpd-vhosts.conf (Virtual host profile)
#
#
<virtualhost *:80>
ServerAdmin sadoc.blog.51cto.com
DocumentRoot "/var/www"
ServerName bbs.52cto.com
Serveralias 52ctt.com
Errorlog "Logs/bbs-error_log"
#CustomLog "Logs/bbs-access_log" common
#以下是日期轮询方法, select one to remove the other.
#按天日志轮询, the log does not automatically overwrite
Customlog "|/usr/sbin/cronolog/var/log/httpd_acc%y%m%d.log" combined
#按小时日志轮询, more details
Customlog "|/usr/sbin/cronolog/var/log/httpd_acc%y%m%d%h.log" combined
#按周日志轮询, the log will automatically overwrite
Customlog "|/usr/sbin/cronolog/var/log/httpd_acc%w.log" combined
#按周分目录日志轮询, the log will automatically overwrite
Customlog "|/usr/sbin/cronolog/var/log/%w/httpd_acc.log" combined
</VirtualHost>
Restart Service
Cat /var/log/ ...
Apache Log polling Cronolog installation configuration