Apache access logs and multiple domains to same place

Jonathan jonathan at sirtis.org.uk
Tue Nov 2 13:11:59 GMT 2004


Dave Tiger wrote:
> Hi List,
> 
> How do I record the hits to my domains delivering the same pages.
> 
> I have say 5 domains pointing to the same place
> 
> www.domain1.com
> www.domain1.co.uk
> www.domain1.net
> www.domain1.org
> www.domain1.uk.org
> 
> I would like to have just 1 access log capturing all hits to these domains.
> 
> I think it’s a virtual host config thing but I am lost in the maze of
> options so I plead for help and advise for this.
> 
> Thank you in advance for any help

ServerName www.domain1.com
ServerAlias www.domain1.co.uk
ServerAlias www.domain1.net www.domain1.org www.domain1.uk.org
CustomLog /path/to/your/log/file common
ErrorLog /path/to/your/error/log


Change common to combined if you want to have referrer and browser info 
as well. The ServerAlias directive can either be one per line or space 
separated as shown above.

If you want to have nicely rotated logfiles, look at the cronolog port, 
it's very nice for that sort of thing.

Regards,

Jonathan




More information about the Ukfreebsd mailing list