Mailing List Archive

[mod_backhand-users] HTTPRedirectToName
First let me explain what we want to do and what is working so far.

We have four webservers who share the load.
www.client.com
www2.client.com
www3.client.com
www4.client.com

All request get to Host www who ist backhanding a page from the frameset and
redirect to one of the other servers for example www3.
The other hosts just report their statistics to the backhand on host www.
All followup requests will now go directly to www3.
So we only want to backhand "new sessions" and use it as a simple load
balancer.

So far it works.

Now we want to use the same servers also for another project and need to
implement virtual server use.
As i read in the FAQ that can be done with HTTPRedirectToName and format
strings.

So i named the hosts to (so that this name ist displayed in the backhand
status page):
www.hosting.com
www2-4.hosting.com

and configured a virtual host on each server:
www.client.com
www2-4.client.com


Then i configured backhand with this format string:
HTTPRedirectToName %1S.%-2H
to take only the first part from the server choosen by backhand (for example
www3 from www3.hosting.com) and the domain name from the request (in my
example client.com) the get the redirect hostname (in my example
www3.client.com).

<Directory /home/client.com/html/manual/>
Backhand HTTPRedirectToName %1S.%-2H
Backhand removeSelf
Backhand byAge
Backhand byLoad
</Directory>

As long as i tell him to remove himself everything is working as expected.
But wenn i comment this line so that he also should serve pages if he has
nothing to do he always redirects to himself, ignoring what the backhand
statistics are saying.

Anybody knows whats wrong ?!?

Marcus Albrecht
[mod_backhand-users] HTTPRedirectToName [ In reply to ]
On Wednesday, May 2, 2001, at 10:47 AM, Marcus.Albrecht@sycor.de wrote:
> <Directory /home/client.com/html/manual/>
> Backhand HTTPRedirectToName %1S.%-2H
> Backhand removeSelf
> Backhand byAge
> Backhand byLoad
> </Directory>
>
> As long as i tell him to remove himself everything is working as
> expected.
> But wenn i comment this line so that he also should serve pages if he
> has
> nothing to do he always redirects to himself, ignoring what the backhand
> statistics are saying.
>
> Anybody knows whats wrong ?!?
>

That function creates the appropriate notes in the request record to
make the redirect. It does this assuming that the decision has been
made already and that the first one in the list is the end choice.

I am not sure how it is working at all the way you have it written.
Since the local server always starts as the first candidate, m_b is
setting up the redirection URL as if the local server is the choice.
Removing it later would still confuse things.

I think that simply placing HTTPRedirectToName <format> as the _last_
candidacy function will solve your problem.

Perhaps the documentation on this should be a little more clear. :-)

--
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
AW: [mod_backhand-users] HTTPRedirectToName [ In reply to ]
Thank you for the quick response.

I think i have got the point.

For testing i changed my configuration to:
< Directory /home/client.com/html/manual/>
Backhand byRandom
Backhand HTTPRedirectToName
</Directory>

It then tries to redirect to the backhand choosen hostname -> Good.

When I extend the redirect entry with "%1S" it tries ro redirect to =
for
example www2 (from the original server name www2.hosting.com) -> Good

When I change it to "%1S.%1H" it should create the desired name (
www2.hosting.com + www.customer.com =3D www2.customer.com ) but i am =
always
redirected to www.customer.com (my first backhand server is called
www.hosting.com) -> !? ;-(

For testing I tried "%1S%1H" (without the dot) and voila backhand tries =
to
redirect to www2customer.com.

Solution:
I now renamed my first host from www.hosting.com to www1.hosting.com =
(Apache
Server Name) so that my status page now looks like:

0 www1.hosting.com 0 127.0.0.1:80
1 www2.hosting.com 0 172.20.252.1:80
2 www3.hosting.com 0 172.20.252.201:80

Now it works even with the redirect format string!
The only thing that confused me a little is that he does not change the =
name
to www1.hosting.com when he chooses himself.
But I think he knows that he serves the page himself and does no =
redirect ?!
=20
Please give me a note on that point.

Thanks

Marcus Albrecht

> -----Urspr=FCngliche Nachricht-----
> Von: Theo Schlossnagle [SMTP:jesus@omniti.com]
> Gesendet am: Mittwoch, 2. Mai 2001 20:27
> An: backhand-users@lists.backhand.org
> Betreff: Re: [mod_backhand-users] HTTPRedirectToName
>=20
> On Wednesday, May 2, 2001, at 10:47 AM, Marcus.Albrecht@sycor.de =
wrote:
> > <Directory /home/client.com/html/manual/>
> > Backhand HTTPRedirectToName %1S.%-2H
> > Backhand removeSelf
> > Backhand byAge
> > Backhand byLoad
> > </Directory>
> >
> > As long as i tell him to remove himself everything is working as=20
> > expected.
> > But wenn i comment this line so that he also should serve pages if =
he=20
> > has
> > nothing to do he always redirects to himself, ignoring what the =
backhand
> > statistics are saying.
> >
> > Anybody knows whats wrong ?!?
> >
>=20
> That function creates the appropriate notes in the request record to=20
> make the redirect. It does this assuming that the decision has been=20
> made already and that the first one in the list is the end choice.
>=20
> I am not sure how it is working at all the way you have it written. =20
> Since the local server always starts as the first candidate, m_b is=20
> setting up the redirection URL as if the local server is the choice. =

> Removing it later would still confuse things.
>=20
> I think that simply placing HTTPRedirectToName <format> as the _last_ =

> candidacy function will solve your problem.
>=20
> Perhaps the documentation on this should be a little more clear. :-)
>=20
> --
> 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
>=20
> _______________________________________________
> backhand-users mailing list
> backhand-users@lists.backhand.org
> http://lists.backhand.org/mailman/listinfo/backhand-users
AW: [mod_backhand-users] HTTPRedirectToName [ In reply to ]
On Thursday, May 3, 2001, at 09:53 AM, Marcus.Albrecht@sycor.de wrote:
> Now it works even with the redirect format string!
> The only thing that confused me a little is that he does not change the
> name
> to www1.hosting.com when he chooses himself.
> But I think he knows that he serves the page himself and does no
> redirect ?!
>
> Please give me a note on that point.

If a machine chooses itself as the best server, it doesn't redirect or
proxy by default. If you think in the case of a proxy, it would be
silly to proxy to yourself for the answer (except for a few cases). If
you _do_ want a backhand server to redirect even to itself, then turn on
the option:

BackhandSelfRedirect On

I usually put this right after my AcceptStats lines in the global server
configuration.

--
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