Separating vhosts in combined apache logfile?
August 17, 2005 5:17 PM Subscribe
I am in a shared hosting environment, but I host multiple domains using mod_rewrite. Of course, this means all the domains get lumped together in one logfile. I need to be able to separate the individual domains for log analysis, without using a CustomLog statement.
posted by joshwa to computers & internet (6 answers total)
Let's take care of the obvious: I can't afford individual accounts for each domain, or upgrading to a dedicated server. I don't have access to httpd.conf, so I can't use with accompanying CustomLog statements.
It would seem that one would be able to infer which request is for which domain by looking at requests in aggregate (e.g. first request is for "/" with the referring page as the referrer, and the second request is for the page's style sheet, graphics, etc, with the requested domain's docroot as the referrer. )
I suppose some perl is the answer, but that's a frightening prospect for me. There's got to be a way to either tag or otherwise indicate in the log entry which domain is being requested, somewhere in .htaccess (where the mod_rewrite rules live, and which is the only apache config to which I have access).
Possible ideas: Can RewriteLog be hacked to do this? Or I could do an AddHandler to a shell script that created the appropriate logs, but that would create serious performance issues.
Or perhaps there's a way to do this in Sawmill, my logfile analyser.
I can't be the only one in this situation, but Google has yielded zilch.