SLUG Mailing List Archives
Re: [SLUG] Apache vh log handling, reverse lookup, log aging, log analyzing
- To: "slug@xxxxxxxxxxx" <slug@xxxxxxxxxxx>
- Subject: Re: [SLUG] Apache vh log handling, reverse lookup, log aging, log analyzing
- From: John Clarke <johnc+slug@xxxxxxxxxxx>
- Date: Thu Dec 19 09:51:02 2002
- User-agent: Mutt/188.8.131.52i
On Wed, Dec 18, 2002 at 11:52:23AM +1100, Voytek Eymont wrote:
> I'm looking at setting a number of v-host, and, need to automate/simplify processing web logs
> how do I handle on Linux Apache reverse log lookup ,logs per v-host, and deleting old logs ?
You can have apache generate separate logs for each virtual host by
having ErrorLog and CustomLog directives in each VirtualHost section in
httpd.conf, for example:
CustomLog logs/virtual/domain.com.au/access_log combined
Add each virtual host's log files to /etc/logrotate.d/apache so that
they're all rotated at the same time.
I use webalizer to produce stats for each virtual host. I do this by
having a webalizer config file for each host in /etc/webalizer/virtual.
There are two directives which need to be different for each host:
I run webalizer from a script in /etc/cron.daily:
for i in /etc/webalizer/virtual/*.conf
< /var/log/httpd/virtual/`basename $i|sed -e 's/.conf$//'`/access_log \
| /opt/webalizer/bin/webalizer -c $i -p -q
It should be fairly easy to write a script to make all the necessary
changes when adding a new virtual host. Apache's config file allows
you to include other files by wildcard pattern, so you can put something
like this in httpd.conf:
and create one file for each virtual host. This makes automating the
process even easier.
GPG key id: 0xD59C360F