How to Rotate Apache Log Files in Linux
Posted on: 07/22/2011 08:48 AM

The Geek Stuff shows you how to rotate Apache log files

How to Rotate Apache Log Files in Linux


Question: I would like to automatically rotate the apache access_log and error_log files. Can you explain with an example on how to do this? Answer: This can be achived using logrotate utility as explained below. Add the following file to /etc/logrotate.d directory. # vi /etc/logrotate.d/apache /usr/local/apache2/logs/access_log /usr/local/apache2/logs/error_log { size 100M compress dateext maxage 30 postrotate [...]



Printed from Linux Compatible (http://www.linuxcompatible.org/news/story/how_to_rotate_apache_log_files_in_linux.html)