Sponsored Content
Operating Systems Linux Problems with log rotate and virtual hosts Post 302221533 by anderow on Monday 4th of August 2008 04:58:08 PM
Old 08-04-2008
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?



Quote:
Originally Posted by my logrorate.d for my virtual hosts
/var/log/httpd/*/.accesslog /var/log/httpd/*/.errorlog /var/log/httpd/*/.sslerrorlog /var/log/httpd/*/.sslaccesslog {
missingok
notifempty
errors me@mydomain.com
sharedscripts
prerotate
/etc/genstat.sh
endscript
postrotate
/bin/kill -HUP `cat /var/run/httpd.pid 2>/dev/null` 2> /dev/null || true
endscript
}
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

Quote:
error: httpdvirtual:4 unexpected text
Create/Update database for config "/etc/awstats/awstats.site1.conf" by AW Stats version 6.6 (build 1.887)
From data in log file "/var/log/httpd/site1/site1accesslog" ...
Phase 1 : First bypass old records, searching new record...
Direct access after last parsed record (after line 7947985)
Jumped lines in file: 7947985
Found 7947985 already parsed records.
Parsed lines in file: 5351
Found 243 dropped records,
Found 0 corrupted records,
Found 0 old records,
Found 5108 new qualified records.
Create/Update database for config "/etc/awstats/awstats.site2.conf" by AWStats version 6.6 (build 1.887)
From data in log file "/var/log/httpd/site2/site2.accesslog"...
Phase 1 : First bypass old records, searching new record...
Direct access after last parsed record (after line 7556)
Jumped lines in file: 7556
Found 7556 already parsed records.
Parsed lines in file: 0
Found 0 dropped records,
Found 0 corrupted records,
Found 0 old records,
Found 0 new qualified records.
Create/Update database for config "/etc/awstats/awstats.site3.conf" by AWSta ts version 6.6 (build 1.887)
From data in log file "/var/log/httpd/site3/site3.accesslog"...
Phase 1 : First bypass old records, searching new record...
Direct access after last parsed record (after line 444693)
Jumped lines in file: 444693
Found 444693 already parsed records.
Parsed lines in file: 94
Found 0 dropped records,
Found 0 corrupted records,
Found 0 old records,
Found 94 new qualified records.
Create/Update database for config "/etc/awstats/awstats.localhost.localdomain.co nf" by AWStats version 6.6 (build 1.887)
From data in log file "/var/log/httpd/access_log"...
Phase 1 : First bypass old records, searching new record...
Direct access after last parsed record (after line 956)
Jumped lines in file: 956
Found 956 already parsed records.
Parsed lines in file: 0
Found 0 dropped records,
Found 0 corrupted records,
Found 0 old records,
Found 0 new qualified records.
and so on
Site1 is the one giving me trouble
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Apache 2 Virtual Hosts not resolving

Hey all, I'm having some apache problems. I've installed apache countless times on FreeBSD. However, I'm having some problems and I could use some help. Here is my system info: FreeBSD 5.2.1 Apache 2.0.51 (/usr/local/apache2), doc root (/www symlink to /var/www) PHP 5.0.1 (/usr/local/php)... (2 Replies)
Discussion started by: ezekiel61
2 Replies

2. UNIX for Dummies Questions & Answers

Application & Virtual hosts in Apache

Folks; I need help knowing how to add an application to existing Virtual host on Apache. here's the details: I have a virtual host file (Based on IP address) for Apache and is configured to run application inside it. How can i add another application to the same virtual host based on the same IP... (0 Replies)
Discussion started by: moe2266
0 Replies

3. Shell Programming and Scripting

how to rotate log files

hi friends i need a shell script to rotate the logs in a directory, dated n days back. can anybody of help. appreciate.. (0 Replies)
Discussion started by: satya_skm
0 Replies

4. UNIX for Advanced & Expert Users

Virtual Hosts and Alteon DNS conflicts

Hi, This is more of a verification rather than a question of technical nature. This is based on solaris 10 machine Could we use Virtual hosts (within our hosts file): 123.1.1.10 virtual_host_name 123.1.1.10 host_A (note: 123.1.1.10 - host_A is also in our DNS server entry) And... (0 Replies)
Discussion started by: jackola
0 Replies

5. UNIX for Advanced & Expert Users

log rotate

hi , what is the meaning of log rotate? how do i rotate /var/adm/wtmps log and gzip it? (6 Replies)
Discussion started by: cromohawk
6 Replies

6. UNIX for Dummies Questions & Answers

Have to log out of a virtual terminal twice in order to exit virtual terminals

Not really a newbie, but I have a strange problem and I'm not sure how to further troubleshoot it. I have to log out of a virtual terminal by typing exit, then exit again as in: woodnt@toshiba-laptop ~ $ exit logout woodnt@toshiba-laptop ~ $ exit logout I DON'T have to do this when I'm... (1 Reply)
Discussion started by: Narnie
1 Replies

7. UNIX for Dummies Questions & Answers

Maximum Number of Virtual Hosts per Apache instance

Is there a directive to limit the number of virtual hosts allowed per apache instance? I am told yes but I cannot find it. (1 Reply)
Discussion started by: mojoman
1 Replies

8. Red Hat

apache httpd virtual hosts setup keep hitting the same VirtualHost

I'm trying to set up two virtual hosts. Here's my httpd config: <Directory /Users/userX/dev/sandbox-2> Order deny,allow deny from All Allow from localhost </Directory> NameVirtualHost 127.0.0.1 <VirtualHost 127.0.0.1> DocumentRoot "/Users/userX/dev/sandbox-2" ... (0 Replies)
Discussion started by: GlideK
0 Replies

9. UNIX for Dummies Questions & Answers

How to rotate the log messages?

Hi, i want to log rotate the /var/adm/messages file after reaching the specified limit and delete those logs. how do i do that. i you solaris 10 OS ,Please help me in doing the same.... (2 Replies)
Discussion started by: Rahulne25
2 Replies

10. Shell Programming and Scripting

Log rotate

Hi, I have below script in logrotate.d to rotate logs. logs are not rotating after the file grow to 1k, do you have any idea? Is it because of it just only 1K? Please let me know if the below syntax is in correct. # more trotate /sourcepath/*/servers/*/logs/*log... (2 Replies)
Discussion started by: lpprasad321
2 Replies
All times are GMT -4. The time now is 08:07 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy