Problems with log rotate and virtual hosts

ok guys,

Im running Centos 4.6 Final
latest versions of apache, mysql etc etc

Basically, I have several websites on there and one of them is a busy forum and it generates big log files in not that long of a timeperiod.

I set it up about 8 months ago so that logrotate was rotating the logs of my virtual hosts and pruning them at a set size limit, then renaming them as it went along so they were log 1, log 2, log 3 and so on.

This was working great after quite a bit of testing and tweaking but I found out tonight that for some reason this has stopped working and one of the logs is now over 5GB!

I would delete it and start over but I need the information in it for awstats so thats not really an option. Which brings me to my next point!!

I installed Awstats maybe 3 months ago and got it working, but Im not sure if that is what has broken my logrotate script?

Now I know this DID work perfectly!!

but I would appreciate some help in the best way to trouble shoot the problem.

I have restarted Cron.d

and also forced logrotate to run, and go thits

Site1 is the one giving me trouble

That doesn't look like logrotate output to me, it looks like the contents of the AWStats log files?

Lol!

I know! Thats part of the problem....
That was:
[me@server1]# logrotate -f /etc/logrotate.conf

This is my /etc/logrotate.conf

Anyone know what awstats has done to my logrotate?!!!!!thanks

Do you have the files in /etc/logrotate.d for each of the virtual hosts logs location?

# cat /etc/logrotate.d/somevirtualhost
/var/www/vhosts/somevirtualhost.com/logs/*log {
    missingok
    notifempty
    sharedscripts
    postrotate
        /sbin/service httpd reload > /dev/null 2>/dev/null || true
    endscript
}

Looking closer at your logrotate rule, it looks like the prerotate script, genstats.sh is the one generating that output.

What is the output of logrotate -v (you can chop out the genstats bit as we've alraedy seen it)?

Thanks. Sorry for this slow reply.

Here is the output from the verbose command

I dont understand why this

refuses to work!! it did before and now it doesnt!

My httpd log directories are

var/log/httpd/site1/site1.accesslog

I have tried again to force rotation and Ive still got the silly big log file?!

thanks for your help :b:

It's because those patterns don't match those log file names. It needs to be /var/log/http/*/*.accesslog, for example.

Thanks :slight_smile:
Not sure how that happened....but I have corrected it and my site logs have now rotated :smiley:

sometimes I cant see the wood for the trees :eek:

so thanks for the help mate.. :b::b: