You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Tony Finch <do...@dotat.at> on 1998/12/23 18:38:27 UTC
Some logging issues & questions
I have a couple of questions about fiddling with the way Apache deals
with logs so that I can decide on the right direction in which to
hack...
On our current web server cluster we configure Apache to write access
logs to a fifo from which they are picked up by the log processing
system. This collates logs from the various front-end servers,
produces some stats for accounting purposes, and delivers the logs to
customers.
The latter step is done on the basis of what Apache puts in the %v
field, i.e. what it thinks the ServerName is when it writes the log.
Because UseCanonicalName can change this, and because customers can
put it in their .htaccess files, they can therefore confuse the log
system and e.g. get free bandwidth...
My current solution to this is to prevent them from using
UseCanonicalName by setting its req_override to RSRC_CONF which is OK,
but I want the best of both worlds :-) i.e. I want customers to be
able to fiddle with UseCanonicalName if they wish but I want to revoke
any config changes made by .htaccess files before the server gets
around to logging. Does anyone have any suggestions about how to do
this cleanly?
The other thing that caught my eye recently was Aidan Cully's error
log patch. I have been vaguely thinking about providing customers with
error logs via something similar to our system for access logs. A
quick hack to http_log.c would sort-of do the trick, or perhaps
something like mod_log_config (but that's probably overkill).
Any suggestions welcome.
Tony.
--
f.a.n.finch dot@dotat.at fanf@demon.net
Re: Some logging issues & questions
Posted by Dean Gaudet <dg...@arctic.org>.
On Wed, 23 Dec 1998, Marc Slemko wrote:
> Except that you do need some way to log the hostname used if you are using
> it for non-vhost based vhosts with mod_rewrite. It is arguable that just
> using the Host: header there would be enough in most cases, although I
> think there may be a few where it isn't.
Hmm. Except %v and %p are defined as logging the canonical name/port, so
it was definately not working as documented... but maybe the docs are what
should be changed.
On Thu, 24 Dec 1998, Tony Finch wrote:
> I thought that might be the case. However, we are playing tricks with
> UseCanonicalName in order to avoid filling httpd.conf with thousands
> of <VirtualHost> configuration directives and having to kick the
> server when anything changes. This isn't a fix for us :-(
I'm starting to think that it's just wrong to let UseCanonicalName be
changed in .htaccess files.
Dean
Re: Some logging issues & questions
Posted by Tony Finch <do...@dotat.at>.
Dean Gaudet <dg...@arctic.org> wrote:
>On Wed, 23 Dec 1998, Tony Finch wrote:
>>
>> The latter step is done on the basis of what Apache puts in the %v
>> field, i.e. what it thinks the ServerName is when it writes the log.
>> Because UseCanonicalName can change this, and because customers can
>> put it in their .htaccess files, they can therefore confuse the log
>> system and e.g. get free bandwidth...
>
>Oh yuck, that wasn't intentional... I think mod_log_config should be
>changed to use r->server_hostname unconditionally... ditto for the
>port. I'll make that change.
I thought that might be the case. However, we are playing tricks with
UseCanonicalName in order to avoid filling httpd.conf with thousands
of <VirtualHost> configuration directives and having to kick the
server when anything changes. This isn't a fix for us :-(
Tony.
--
f.a.n.finch dot@dotat.at fanf@demon.net
Re: Disabling configuration directives
Posted by Tony Finch <do...@dotat.at>.
Ben Hyde <bh...@pobox.com> wrote:
>Tony Finch (a man with so many dots) writes:
>...
>>Because UseCanonicalName can change this, and because customers can
>>put it in their .htaccess files, they can therefore confuse the log
>>system and e.g. get free bandwidth...
>
>I've sometimes thought that a configuration directive that
>disabled a named command would be a good thing. - ben
Indeed, and also finer control over what Options may be set would be
nice...
Tony.
--
f.a.n.finch dot@dotat.at fanf@demon.net
Disabling configuration directives
Posted by Ben Hyde <bh...@pobox.com>.
Tony Finch (a man with so many dots) writes:
...
>Because UseCanonicalName can change this, and because customers can
>put it in their .htaccess files, they can therefore confuse the log
>system and e.g. get free bandwidth...
I've sometimes thought that a configuration directive that
disabled a named command would be a good thing. - ben
Re: Some logging issues & questions
Posted by Marc Slemko <ma...@worldgate.com>.
On Wed, 23 Dec 1998, Dean Gaudet wrote:
> On Wed, 23 Dec 1998, Tony Finch wrote:
>
> > The latter step is done on the basis of what Apache puts in the %v
> > field, i.e. what it thinks the ServerName is when it writes the log.
> > Because UseCanonicalName can change this, and because customers can
> > put it in their .htaccess files, they can therefore confuse the log
> > system and e.g. get free bandwidth...
>
> Oh yuck, that wasn't intentional... I think mod_log_config should be
> changed to use r->server_hostname unconditionally... ditto for the
> port. I'll make that change.
Except that you do need some way to log the hostname used if you are using
it for non-vhost based vhosts with mod_rewrite. It is arguable that just
using the Host: header there would be enough in most cases, although I
think there may be a few where it isn't.
Re: Some logging issues & questions
Posted by Dean Gaudet <dg...@arctic.org>.
On Wed, 23 Dec 1998, Tony Finch wrote:
> The latter step is done on the basis of what Apache puts in the %v
> field, i.e. what it thinks the ServerName is when it writes the log.
> Because UseCanonicalName can change this, and because customers can
> put it in their .htaccess files, they can therefore confuse the log
> system and e.g. get free bandwidth...
Oh yuck, that wasn't intentional... I think mod_log_config should be
changed to use r->server_hostname unconditionally... ditto for the
port. I'll make that change.
Dean