Customlog "|/usr/local/apache/bin/rotatelogs/var/log/access_log 86400" common
The above may not work properly, so with the following, add the following command in Httpd.conf, and then access the page, the log will be replaced in a minute.
Customlog "| | /usr/local/apache/bin/rotatelogs/var/log/access_log 86400 "Common
[Email protected] httpd]# vi/etc/httpd/conf/httpd.conf
[Email protected] httpd]# service httpd restart
Starting httpd: [OK]
No access within a minute, no rotation. There is a visit, when the time is up for rotation.
[email protected] httpd]# LL
Total 104
-rw-r--r--. 1 root root 1001 Apr 3 17:46 Access_log
-rw-r--r--. 1 root root 950 Apr 3 18:00 access_log.1428055200
-rw-r--r--. 1 root root 950 Apr 3 18:01 access_log.1428055260
-rw-r--r--. 1 root root 2850 Apr 3 18:02 access_log.1428055320
-rw-r--r--. 1 root root 475 Apr 3 18:03 access_log.1428055380
HTTPD of Linux Services