apachelogrotate.pl
I have written the script apachelogrotate.pl for my Linux web server Apache,
because the log files were growing and growing while
I didn't find a log rotate program suitable for my needs.
These are the features I implemented:
- Logs are rotated and packed (gzipped) while Apache is running, thus
without interrupting the http service.
- Multiple Apache configuration files and multiple log files (e.g. of virtual
domains) are supported.
- Options allow file rotation according to limits in time and/or file size.
- The script is able to find the log files by checking the apache configuration file
(recursively checking included configuration files). So normally there is no need
to configure this script.
Nevertheless you may pass one or more apache configuration files as arguments to the
script and make some other choices.
- Apache configuration directories (Apache 1.3.13 and higher) are supported (since version 0.1.2).
- Relative paths within configuration files are supported (since version 0.1.3).
- It makes sense to call this script by a cron job.
The script requires:
- a Linux/Unix system (I use it with SuSE 7.3)
- a suitable version of Apache (I use it with version 1.3.20)
- a perl interpreter (I use it with version 5.6.1)
- the programs ps and gzip (present on almost every linux system).
The current release is 0.1.5; you may download it as:
Documentation and some configuration options are included in the file itself
(open it with a text editor). You may use the script (under GPL), but there is absolutely
no warranty that this script serves any purpose.