Mailing List Archive

[mod_backhand-users] avoiding duplicate logs when using mod_log_spread
I followed George's idea to prevent duplicate logs when a request is
proxied, like so:

SetEnvIf Backhand-Proxied-By ".*" proxied

CustomLog $cluster-host combined env=!proxied


However, the logs never show up whether the request was proxied or not.
This means Backhand-Proxied-By is always true (?). How do I dump out the
value of Backhand-Proxied-By? Or is there another env variable I should
use?

Thanks
Monte
[mod_backhand-users] avoiding duplicate logs when using mod_log_spread [ In reply to ]
On Thursday, August 16, 2001, at 04:43 PM, Monte Ohrt wrote:
> SetEnvIf Backhand-Proxied-By ".*" proxied
>
> CustomLog $cluster-host combined env=!proxied

I know I have done this before, but I can't seem to figure out on which
of my machines. So, I have no example. The ".*" matched 0 or more of
anything. Where in perl that match would fail if Backhand-Proxied-By is
undef, apache _may_ not have a sense of undef. Perhaps everything is
defined to be and empty string unless defined to be non-empty. If this
is the case, then that statement will match everything and yield the
results you spoke of.

Also, more importantly, the header is called "BackhandProxied" not
"Backhand-Proxied-By". :-) And it is supposed to contain the IP
address of the end client. So, it should only exist on HTTP requests
that are being proxied by other machines in the cluster. It should be
of the form /\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/. But, I don't know how
PC Apache's REs are (PCRE - Perl compatible regular expression).

I think you are on the right track. I know it took a few stabs for me
to get it right when I set it up.

--
Theo Schlossnagle
1024D/82844984/95FD 30F1 489E 4613 F22E 491A 7E88 364C 8284 4984
2047R/33131B65/71 F7 95 64 49 76 5D BA 3D 90 B9 9F BE 27 24 E7
[mod_backhand-users] avoiding duplicate logs when using mod_log_spread [ In reply to ]
For the record, this one works :-)

SetEnvIf BackhandProxied ".+" proxied
CustomLog $cluster-host combined env=!proxied


This way, the value of BackhandProxied must contain one or more
characters to be valid, regardless if defined or not.


Theo Schlossnagle wrote:
>
> On Thursday, August 16, 2001, at 04:43 PM, Monte Ohrt wrote:
> > SetEnvIf Backhand-Proxied-By ".*" proxied
> >
> > CustomLog $cluster-host combined env=!proxied
>
> I know I have done this before, but I can't seem to figure out on which
> of my machines. So, I have no example. The ".*" matched 0 or more of
> anything. Where in perl that match would fail if Backhand-Proxied-By is
> undef, apache _may_ not have a sense of undef. Perhaps everything is
> defined to be and empty string unless defined to be non-empty. If this
> is the case, then that statement will match everything and yield the
> results you spoke of.
>
> Also, more importantly, the header is called "BackhandProxied" not
> "Backhand-Proxied-By". :-) And it is supposed to contain the IP
> address of the end client. So, it should only exist on HTTP requests
> that are being proxied by other machines in the cluster. It should be
> of the form /\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/. But, I don't know how
> PC Apache's REs are (PCRE - Perl compatible regular expression).
>
> I think you are on the right track. I know it took a few stabs for me
> to get it right when I set it up.
>
> --
> Theo Schlossnagle
> 1024D/82844984/95FD 30F1 489E 4613 F22E 491A 7E88 364C 8284 4984
> 2047R/33131B65/71 F7 95 64 49 76 5D BA 3D 90 B9 9F BE 27 24 E7
>
> _______________________________________________
> backhand-users mailing list
> backhand-users@lists.backhand.org
> http://lists.backhand.org/mailman/listinfo/backhand-users

--
Monte Ohrt <monte@ispi.net>
http://www.ispi.net/