Restrict Apache log access. log File Size
Rotatelogs is a simple program used with the Apache pipeline log function. You can configure the rotatelogs function of the Apache program in the httpd. conf configuration file of apache.
References: here
1. generate new logs every day
CustomLog "|/usr/sbin/rotatelogs/etc/httpd/logs/access_log _ % Y-% m-% d 86400 480" combined
2. Logs exceeding a certain size generate new logs
CustomLog "|/usr/sbin/rotatelogs/etc/httpd/logs/access_log _ % Y-% m-% d 5 M" combined
3 rotatelogs syntax
Rotatelogs [-l] logfile [rotationtime [offset] | [filesizeM]
Logfile. the benchmark name is the log file name. If logfile contains "%", it will be considered as a string in strftime () format; otherwise, it will be automatically added with the suffix ". nnnnnnnnnn" in seconds. Both formats indicate the start time of the new log. The interval in seconds when the rotationtime log file is rolled. The minute of the time difference between offset and UTC. If it is omitted, it is assumed that it is "0" and UTC time is used. For example, to specify the local time of the region with the UTC time difference of-5 hours, this parameter should be "-300 ". FilesizeM specifies to scroll by filesizeM file size, rather than by time or time difference. An example of setting in Windows is as follows:
# Restrict the error log file to 1 MB
ErrorLog "| bin/rotatelogs.exe-l logs/error-% Y-% m-% d. log 1 M"
# Generate an error log file every day
# ErrorLog "| bin/rotatelogs.exe logs/error-% Y-% m-% d. log 86400"
# Restrict access log files to 1 MB
CustomLog "| bin/rotatelogs.exe-l logs/access-% Y-% m-% d. log 1 M" common
# Generate an access log file every day
# CustomLog "| bin/rotatelogs.exe logs/access-% Y-% m-% d. log 86400" common
------------------------------------- I am a split line -------------------------------------
How to enable Apache Rewrite in Ubuntu
Key points after upgrading Apache 14.04 to 2.2 in Ubuntu 2.4
Install the LAMP \ Vsftpd \ Webmin \ phpMyAdmin service and settings in Ubuntu 13.04
Compile and install LAMP in CentOS 5.9 (Apache 2.2.44 + MySQL 5.6.10 + PHP 5.4.12)
Source code for Web server architecture in RedHat 5.4 build the LAMP environment and application PHPWind
Build a WEB Server Linux + Apache + MySQL + PHP in the LAMP source code Environment
-------------------------------------- Split line --------------------------------------
Apache details: click here
Apache: click here
This article permanently updates the link address: