Mailing List Archive

mod_backhand, problems...
Hi, still struggling with my problems here.

Right now, I'm using only two machines, with this configutation:

1) machine a: 10.10.250.29

<Location /cert/hit.dll>
SetHandler fastcgi-script
Backhand removeSelf
Backhand byAge
Backhand byRandom
</Location>

<IfModule mod_backhand.c>
BackhandConnectionPools off
UnixSocketDir /var/backhand/backhand
MulticastStats 10.10.250.29:4445,1
AcceptStats 10.10.250.0/24
</IfModule>

2) machine b: 10.10.250.30
<Location /cert/hit.dll>
SetHandler fastcgi-script
</Location>

<IfModule mod_backhand.c>
UnixSocketDir /var/backhand/backhand
MulticastStats 10.10.250.29:4445,1
</IfModule>


The "hit.dll" fastcgi script need to use the client's ip addres, but
right now it's getting the moderator address (10.10.250.29). Anybody can
tell me what I'm doing wrong?

--
Leonardo Herrera
mailto:leonardo.herrera@platpro.cl
http://leus.epublish.cl
mod_backhand, problems... [ In reply to ]
Leonardo,

You need to have backhand directives for a particular directory in the conf
file on machine b

like this -

<Directory "/some-directory/web/apache/cgi-bin">
AllowOverride None
Options None
Order allow,deny
Allow from all
Backhand byAge
Backhand byLoad
Backhand addSelf
</Directory>

also, you may want to turn debug on and you can look at the apache error_log
to get a better sense of what is happening, to turn debug on add this after
the accept stats line


BackhandLogLevel +net1
BackhandLogLevel +mbcs1
BackhandLogLevel +dcsn1

restart the webserver and see how it works...

Hope this helped

-Steve



Leonardo Herrera wrote:

> Hi, still struggling with my problems here.
>
> Right now, I'm using only two machines, with this configutation:
>
> 1) machine a: 10.10.250.29
>
> <Location /cert/hit.dll>
> SetHandler fastcgi-script
> Backhand removeSelf
> Backhand byAge
> Backhand byRandom
> </Location>
>
> <IfModule mod_backhand.c>
> BackhandConnectionPools off
> UnixSocketDir /var/backhand/backhand
> MulticastStats 10.10.250.29:4445,1
> AcceptStats 10.10.250.0/24
> </IfModule>
>
> 2) machine b: 10.10.250.30
> <Location /cert/hit.dll>
> SetHandler fastcgi-script
> </Location>
>
> <IfModule mod_backhand.c>
> UnixSocketDir /var/backhand/backhand
> MulticastStats 10.10.250.29:4445,1
> </IfModule>
>
> The "hit.dll" fastcgi script need to use the client's ip addres, but
> right now it's getting the moderator address (10.10.250.29). Anybody can
> tell me what I'm doing wrong?
>
> --
> Leonardo Herrera
> mailto:leonardo.herrera@platpro.cl
> http://leus.epublish.cl
>
> _______________________________________________
> backhand-users mailing list
> backhand-users@lists.backhand.org
> http://lists.backhand.org/mailman/listinfo/backhand-users
mod_backhand, problems... [ In reply to ]
Steve Fisk wrote:
> Leonardo,
>
> You need to have backhand directives for a particular directory in the conf
> file on machine b
>
> like this -
[...]

Perhaps I didn't explain the idea. I want only one machine to do the
balancing, the other just have to respond. The machine "a" receives
traffic, and then balance against several machines (right now, I'm
testing with just one "workhorse", the "b" machine). I forgot to mention
that I have other machine, but I left it out of this setup. That machine
have exactly the same configuration, yet receives the ip right ip address.


> also, you may want to turn debug on and you can look at the apache error_log
> to get a better sense of what is happening, to turn debug on add this after
> the accept stats line
>
>
> BackhandLogLevel +net1
> BackhandLogLevel +mbcs1
> BackhandLogLevel +dcsn1
>
> restart the webserver and see how it works...

I forgot to try this, thanks.


> Hope this helped
>
> -Steve

Thank you very much.
--
Leonardo Herrera L.
mailto:leus@epublish.cl
mod_backhand, problems... [ In reply to ]
Leonardo,

Yes, now I see what you are saying. I had some issues with certain content that
needed to maintain session state, and the users got redirected to another
webserver and the session didn't exist there. That was using the default method
where it is "backhand proxied".

For the sake of simplicity we decided to go with the "HTTPRedirectToName" method
and just use the front end machine as an initial load balancer, once clients are
redirected to a backend host, they stay there. It is however apparent to the
remote client via the url that he is now on a new server. And if users bookmark
and that host is not in the pool anymore... well you get the idea...

And since we are using the redirect method, and want to have users stick to a
server, there are no directives in those servers conf file other then the generic
accept/socketdir/load and unload stuff...

In any case, if you have other hosts that are working properly, and appear to be
set up the same way, I'd check the module load order. I've seen it have all kinds
of strange effects, like everything stopped working all of a sudden for no reason-
other then the load order had changed...

-Steve

Leonardo Herrera wrote:

> Steve Fisk wrote:
> > Leonardo,
> >
> > You need to have backhand directives for a particular directory in the conf
> > file on machine b
> >
> > like this -
> [...]
>
> Perhaps I didn't explain the idea. I want only one machine to do the
> balancing, the other just have to respond. The machine "a" receives
> traffic, and then balance against several machines (right now, I'm
> testing with just one "workhorse", the "b" machine). I forgot to mention
> that I have other machine, but I left it out of this setup. That machine
> have exactly the same configuration, yet receives the ip right ip address.
>
> > also, you may want to turn debug on and you can look at the apache error_log
> > to get a better sense of what is happening, to turn debug on add this after
> > the accept stats line
> >
> >
> > BackhandLogLevel +net1
> > BackhandLogLevel +mbcs1
> > BackhandLogLevel +dcsn1
> >
> > restart the webserver and see how it works...
>
> I forgot to try this, thanks.
>
> > Hope this helped
> >
> > -Steve
>
> Thank you very much.
> --
> Leonardo Herrera L.
> mailto:leus@epublish.cl
>
> _______________________________________________
> backhand-users mailing list
> backhand-users@lists.backhand.org
> http://lists.backhand.org/mailman/listinfo/backhand-users
mod_backhand, problems... [ In reply to ]
Steve Fisk wrote:
> Leonardo,
>
> Yes, now I see what you are saying. I had some issues with certain content that
> needed to maintain session state, and the users got redirected to another
> webserver and the session didn't exist there. That was using the default method
> where it is "backhand proxied".
>
> For the sake of simplicity we decided to go with the "HTTPRedirectToName" method
> and just use the front end machine as an initial load balancer, once clients are
> redirected to a backend host, they stay there. It is however apparent to the
> remote client via the url that he is now on a new server. And if users bookmark
> and that host is not in the pool anymore... well you get the idea...
[...]

I can't use simple redirect, because our servers must be "hidden" from
the wild world :-). Actually, it's because of legacy problems, so we
must stick to use a single ip address.

Rereading a response from Theo, I started doing some research in
mod_backhand.c, and I have found that the following sentence is always
false in the failing machine:

if(inet_aton(bps, &new_in_addr) &&
matchACL(UDPacl, &r->connection->remote_addr.sin_addr)!=NULL &&
memcmp(&new_in_addr, &r->connection->remote_addr.sin_addr,
sizeof(struct in_addr))) {

If I understand this sentence, first is doing inet_aton (which converts
an ip address in the form "x.x.x.x" to a number), then calling matchACL.
If I understand right, matchACL seeks for a matching ip address in the
linked list UDPacl (in order to allow the request, I think) and return a
pointer to it, NULL if not found; and then doing a memory comparation
between the direction contained in the BackhandProxied header and the
remote address... I have splitted this sentence in three, and put log
messages. I found that matchACL was returning NULL, because the
BackhandProxied contained the _user_ ip address.

Sorry for being so... hm, talkative, but this is my first time working
with this kind of things (any kind of server), and I'm trying to
understand some things. Please correct me: Isn't BackhandProxied
supposed to contain the client's ip address? If so, why are
matchACL()'ing against this value?

Now, there is a lot of stuff that I don't understand. I don't think I
understand what means MulticastStats, or Acceptstats... I have a vague
idea, but I want to know exactly what they mean. Can anybody point where
I can find any definitions of these directives?

Sorry for bothering the list with my questions.

Regards,
--
Leonardo Herrera L.
mailto:leus@epublish.cl
mod_backhand, problems... [ In reply to ]
I believe I've found what was causing my problems. I wasn't configured
correctly the AcceptStats directive, duh.

Regards,
--
Leonardo Herrera L.
mailto:leus@epublish.cl