Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

10.3: A heads-up on Apache log file rotation System
Since installing 10.3, I noticed that my Apache logs were being rotated weekly in the early hours of Saturday morning. Worse still, each week, instead of renaming .0.gz to .1.gz, the files were being deleted, losing the log file information.

It appears that Apple has added Apache log rotation to the 'periodic weekly' script which crontab runs, but failed to mention this fact. I checked my PowerBook (still on 10.2.8) and it doesn't have the Apache log rotation in the weekly script.

As for the renaming problem, it appears that any other files present in /var/log/httpd were causing the problem. Moving them allows the script to function correctly.
    •    
  • Currently 1.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (3 votes cast)
 
[10,336 views]  

10.3: A heads-up on Apache log file rotation | 3 comments | Create New Account
Click here to return to the '10.3: A heads-up on Apache log file rotation' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.3: A heads-up on Apache log file rotation
Authored by: sn3ak on Dec 15, '03 09:55:25PM
It appears, (At least on my 10.3 Server) that /etc/daily includes the following:
 
if [ -d /var/log/httpd ]; then
    echo ""
    echo -n "Cleaning web server log files:"
    cd /var/log/httpd && \
       find . -type f -name '*_log*' -mtime +7 -exec rm -f -- {} \; >/dev/null 2>&1;
fi
Which would delete any log files over 7 days old, So what you may want to do is put a comment "#" in front of all those lines, and that should allow it to correctly save log files up to .4.gz (see /etc/periodic/weekly to change this if desired)
-Andrew

[ Reply to This | # ]
10.3: A heads-up on Apache log file rotation
Authored by: amacaulay on Feb 12, '04 08:10:46AM

I just went to check exactly when the periodic scripts are set to run and I don't have the cron entries any more. (My cron tabs directory is completely empty, so I haven't missed it.) Is this a 10.3 thing? If not I've either run something nefarious or removed them in a fit of madness.



[ Reply to This | # ]
10.3: A heads-up on Apache log file rotation
Authored by: jarik on Mar 11, '04 05:35:55AM

periodic scripts are run from /etc/crontab (which by the way is not exactly the same format as user crontabs).

Note that if you rotate your apache log files your self to something other than *_log they won't be touched by the cleanup mentioned above



[ Reply to This | # ]