Subject: Re: virtual server access log files
From: Matt Larson (ml582@columbia.edu)
Date: Tue Dec 11 2001 - 08:37:46 MST
Brian Foster wrote:
>I've successfully set up three virtual servers. But I've noticed that Linux
>performs administrative duties by automatically making new 'access_log'
>files on its own such as 'access_log.1', 'access_log.2' and so on. However
>the virtual server log files do not generate new files; they just keep
>getting bigger and bigger and I manually have to empty the files. Is there a
>setting some where to automate the generation and backup of virtual server
>files?
>
>Thanks for any help!
>
Assuming that your Apache is set up to put logs for the virual servers
in their own directories or something like that, you need to use the
logrotate program. I have not done this on YDL, but I'm assuming it's
there. It's very easy to use. On a Mandrake system I administer you
just add a file in the directory /etc/logrotate.d. This (usually called
httpd) is probably automatically set up for a normal server, as you
said. For your virtual servers just add something like this:
"/home/virtualserver1/logs/access_log" {
rotate 5
monthly
create
compress
postrotate
sbin/killall -HUP httpd
endscript
}
"/home/virtualserver2/logs/access_log" {
rotate 5
monthly
create
compress
postrotate
sbin/killall -HUP httpd
endscript
}
Read the manpage for logrotate; on the Mandrake system it covers most
things you could want to know about using it.
Good luck.
Matt Larson
This archive was generated by hypermail 2a24 : Tue Dec 11 2001 - 08:51:20 MST