ApacheI’ve been using Apache for quite some time, having many custom scripts that do chores for me. Recently I was asked to install Apache on a machine, a few yum installs and some editing of the Apache vhost files later I was all set.

Because the site being served by Apache started to grow I noticed that the log files got big, I had completely forgotten to have a script rotate the log files!

At the office we simply have a script that has been doing just that since Apache 1.x, this script also runs fine with Apache 2.x. Because I never use office related scripts anywhere outside the office, I decided to look around and encountered rotatelogs which is included with Apache 2.x.

The use of rotatelogs is actually quite simple. I currently have a CustomLog entry for a vhost I use that enables some extra information per client. This is mostly needed for AWStats.

I change the line:

To

That is all! This will rotate my apache logs daily :)

Now check if the syntax is OK and give Apache a graceful.

The changes become active immediately, be sure to check:

Nice addition to Apache 2.0!

- Ivo

Share and Enjoy:
  • Digg
  • del.icio.us
  • Furl
  • Slashdot
  • Spurl
  • StumbleUpon
  • Technorati