Mailing List Archive

[mod_backhand-users] Different bySessionid identifiers not recognized
Hello,

I tried to integrate a tomcat application in our mod_backhand cluster. As we
make heavy use of php, mod_backhand proxies via the Backhand bySession
directive. The directory which deploys the tomcat application needs a
different identifier (named be_host in our setup) to establish sticky
sessions.
I tried:

<Directory "/bla/htdocs">
(...)
Backhand bySession
</Directory>

<Directory "/bla/htdocs/tomcat-application" >
(...)
Backhand bySession be_host=
</Directory>

...nope.
mod_backhand ignores the second directive. If I put the be_host identifier in
the first bySession statement, the JSP sessions are proxied perfectly
(checked with +dcsnall +mbcsall). But then of course, the PHPSESSID which is
required for all directories except "tomcat-application" is not used anymore.

BTW: No tomcat or php voodo involved here, the front-end-apache does not know
anything about tomcat or php, it simply proxies to the
heavy-duty-multi-module backends.

What am I doing wrong here?

Best regards,

Tilman

--
Tilman Kastner DEVICE/N GmbH
kastner@devicen.de Ilse-ter-Meer-Weg 7
PGP key available 30449 Hannover, Germany
[mod_backhand-users] Different bySessionid identifiers not recognized [ In reply to ]
On Friday, November 23, 2001, at 01:35 PM, Tilman Kastner wrote:
> I tried to integrate a tomcat application in our mod_backhand cluster.
> As we
> make heavy use of php, mod_backhand proxies via the Backhand bySession
> directive. The directory which deploys the tomcat application needs a
> different identifier (named be_host in our setup) to establish sticky
> sessions.
> I tried:
>
> <Directory "/bla/htdocs">
> (...)
> Backhand bySession
> </Directory>
>
> <Directory "/bla/htdocs/tomcat-application" >
> (...)
> Backhand bySession be_host=
> </Directory>
>
> ...nope.
> mod_backhand ignores the second directive. If I put the be_host
> identifier in
> the first bySession statement, the JSP sessions are proxied perfectly
> (checked with +dcsnall +mbcsall). But then of course, the PHPSESSID
> which is
> required for all directories except "tomcat-application" is not used
> anymore.

The configuration your provided looks fine. Can you turn on dcsn3
(+dcsn3) logging and access both PHP and JSP and post back with the
pertinent log lines? That log level should print out each called
candidacy function for every URL and its result.

--
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] Different bySessionid identifiers not recognized [ In reply to ]
Hello Theo,

Thank you for the fast reply!

Ok, here's the details:

This is a request for a page located in the tomcat directory ($DOCUMENT_ROOT/globis). As you can see, be_host is set but is not used, although I set
Backhand bySession be_host=

(snip)
[Fri Nov 23 21:01:27 2001] [error] mod_backhand: Check 6 -- headers(5)
[Fri Nov 23 21:01:27 2001] [error] mod_backhand: Check 8
[Fri Nov 23 21:01:27 2001] [error] mod_backhand: Request tally 35 [44]
[Fri Nov 23 21:01:28 2001] [notice] (Translate <=) = { /globis/hm2001/html/banner.jsp, (null), (null[Fri Nov 23 21:01:28 2001] [notice] (Translate =>) = { /globis/hm2001/html/banner.jsp, (null), (null[Fri Nov 23 21:01:28 2001] [notice] (Type <=) = { (null), /globis/hm2001/html/banner.jsp, (null) }
[Fri Nov 23 21:01:28 2001] [notice] Func executed for (null) [byAge(NULL)] (2 -> 2)
[Fri Nov 23 21:01:28 2001] [notice] New server list: [ 0 1 ]
[Fri Nov 23 21:01:28 2001] [notice] Func executed for (null) [byBusyChildren(NULL)] (2 -> 2)
[Fri Nov 23 21:01:28 2001] [notice] New server list: [ 0 1 ]
[Fri Nov 23 21:01:28 2001] [notice] Func executed for (null) [bySession(NULL)] (2 -> 2)
[Fri Nov 23 21:01:28 2001] [notice] New server list: [ 0 1 ]
[Fri Nov 23 21:01:28 2001] [notice] All funcs executed -> fox7.test.messe.de
[Fri Nov 23 21:01:28 2001] [notice] (Type =>) = *{ backhand-redirection, backhand:/globis/hm2001/htm[Fri Nov 23 21:01:28 2001] [notice] (Postread =>) = { Backhanding to 0 }
[Fri Nov 23 21:01:28 2001] [notice] (Postread =>) = { backhand:/globis/hm2001/html/banner.jsp, backh[Fri Nov 23 21:01:28 2001] [notice] (Translate <=) = { backhand:/globis/hm2001/html/banner.jsp, back[Fri Nov 23 21:01:28 2001] [notice] (Type <=) = { backhand-redirection, /globis/hm2001/html/banner.j[Fri Nov 23 21:01:28 2001] [notice] (Type =>) = *{ backhand-redirection, /globis/hm2001/html/banner.[Fri Nov 23 21:01:28 2001] [error] mod_backhand: Check 1
[Fri Nov 23 21:01:28 2001] [error] mod_backhand: Check 2
[Fri Nov 23 21:01:28 2001] [error] mod_backhand: Check 3 --

GET /globis/hm2001/html/banner.jsp?sprache=D&kontakt=2085292&veran_jj=2001&veran_nr=001&be_host=0a00Accept: text/xml, application/xml, application/xhtml+xml, text/html;q=0.9, image/png, image/jpeg, imAccept-Charset: ISO-8859-1, utf-8;q=0.66, *;q=0.66
Accept-Encoding: gzip, deflate, compress;q=0.9
Accept-Language: en-us
Cache-Control: max-age=259200
Connection: Keep-Alive
Cookie: be_host=0a00031b; JSESSIONID=074892E8619241B7904318F54119D540
Host: globistest.dmag.messe.de
Keep-Alive: 300
Referer: http://globistest.dmag.messe.de/globis/hm2001/html/aussteller_fs_d.jsp?sprache=D&kontakt=20User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.6) Gecko/20011120
Via: 1.1 some.proxy.somewhere.com:3128 (Squid/2.4.STABLE1)
X-Forwarded-For: 10.0.0.1
BackhandProxied: 192.168.0.1

(snip)


Next try. Now I visited a page in php-land (PHPSESSID is set now) and went back to the same page as above. bySession now makes his (right) decision,
based on PHPSESSID I guess.

(snip)

[Fri Nov 23 21:07:39 2001] [error] mod_backhand: Check 6 -- headers(5)
[Fri Nov 23 21:07:39 2001] [error] mod_backhand: Check 8
[Fri Nov 23 21:07:39 2001] [error] mod_backhand: Request tally 33 [48]
[Fri Nov 23 21:07:39 2001] [notice] (Translate <=) = { /globis/hm2001/html/banner.jsp, (null), (null[Fri Nov 23 21:07:39 2001] [notice] (Translate =>) = { /globis/hm2001/html/banner.jsp, (null), (null[Fri Nov 23 21:07:39 2001] [notice] (Type <=) = { (null), /globis/hm2001/html/banner.jsp, (null) }
[Fri Nov 23 21:07:39 2001] [notice] Func executed for (null) [byAge(NULL)] (2 -> 2)
[Fri Nov 23 21:07:39 2001] [notice] New server list: [ 0 1 ]
[Fri Nov 23 21:07:39 2001] [notice] Func executed for (null) [byBusyChildren(NULL)] (2 -> 2)
[Fri Nov 23 21:07:39 2001] [notice] New server list: [ 0 1 ]
[Fri Nov 23 21:07:39 2001] [notice] Func executed for (null) [bySession(NULL)] (2 -> 1)
[Fri Nov 23 21:07:39 2001] [notice] New server list: [ 0 ]
[Fri Nov 23 21:07:39 2001] [notice] All funcs executed -> fox7.test.messe.de
[Fri Nov 23 21:07:39 2001] [notice] (Type =>) = *{ backhand-redirection, backhand:/globis/hm2001/htm[Fri Nov 23 21:07:39 2001] [notice] (Postread =>) = { Backhanding to 0 }
[Fri Nov 23 21:07:39 2001] [notice] (Postread =>) = { backhand:/globis/hm2001/html/banner.jsp, backh[Fri Nov 23 21:07:39 2001] [notice] (Translate <=) = { backhand:/globis/hm2001/html/banner.jsp, back[Fri Nov 23 21:07:39 2001] [notice] (Type <=) = { backhand-redirection, /globis/hm2001/html/banner.j[Fri Nov 23 21:07:39 2001] [notice] (Type =>) = *{ backhand-redirection, /globis/hm2001/html/banner.[Fri Nov 23 21:07:39 2001] [error] mod_backhand: Check 1
[Fri Nov 23 21:07:39 2001] [error] mod_backhand: Check 2
[Fri Nov 23 21:07:39 2001] [error] mod_backhand: Check 3 --

GET /globis/hm2001/html/banner.jsp?sprache=D&kontakt=2085292&veran_jj=2001&veran_nr=001&be_host=0a00Accept: text/xml, application/xml, application/xhtml+xml, text/html;q=0.9, image/png, image/jpeg, imAccept-Charset: ISO-8859-1, utf-8;q=0.66, *;q=0.66
Accept-Encoding: gzip, deflate, compress;q=0.9
Accept-Language: en-us
Cache-Control: max-age=259200
Connection: Keep-Alive
Cookie: be_host=0a00031b; JSESSIONID=B94174252364058206E602B6E8378618; PHPSESSID=0a00031bbe5f34d5232Host: globistest.dmag.messe.de
Keep-Alive: 300
Referer: http://globistest.dmag.messe.de/globis/hm2001/html/aussteller_fs_d.jsp?sprache=D&kontakt=20User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.6) Gecko/20011120
Via: 1.1 some.proxy.somewhere.com:3128 (Squid/2.4.STABLE1)
X-Forwarded-For: 10.0.0.1
BackhandProxied: 192.168.0.1

(snip)

Now I altered the httpd.conf (be_host identifier now set at the first bySession statement), cleared the cookies and reloaded the page. No PHPSESSID, but be_host.
bySession now also mentions the non-default identifier! Everything works fine now with be_host...


(snip)

[Fri Nov 23 21:12:38 2001] [error] mod_backhand: Check 6 -- headers(5)
[Fri Nov 23 21:12:38 2001] [error] mod_backhand: Check 8
[Fri Nov 23 21:12:38 2001] [error] mod_backhand: Request tally 23 [3]
[Fri Nov 23 21:12:38 2001] [notice] (Translate <=) = { /globis/hm2001/html/banner.jsp, (null), (null[Fri Nov 23 21:12:38 2001] [notice] (Translate =>) = { /globis/hm2001/html/banner.jsp, (null), (null[Fri Nov 23 21:12:38 2001] [notice] (Type <=) = { (null), /globis/hm2001/html/banner.jsp, (null) }
[Fri Nov 23 21:12:38 2001] [notice] Func executed for (null) [byAge(NULL)] (2 -> 2)
[Fri Nov 23 21:12:38 2001] [notice] New server list: [ 0 1 ]
[Fri Nov 23 21:12:38 2001] [notice] Func executed for (null) [byBusyChildren(NULL)] (2 -> 2)
[Fri Nov 23 21:12:38 2001] [notice] New server list: [ 0 1 ]
[Fri Nov 23 21:12:38 2001] [notice] Func executed for (null) [bySession(be_host=)] (2 -> 1)
[Fri Nov 23 21:12:38 2001] [notice] New server list: [ 0 ]
[Fri Nov 23 21:12:38 2001] [notice] All funcs executed -> fox7.test.messe.de
[Fri Nov 23 21:12:38 2001] [notice] (Type =>) = *{ backhand-redirection, backhand:/globis/hm2001/htm[Fri Nov 23 21:12:38 2001] [notice] (Postread =>) = { Backhanding to 0 }
[Fri Nov 23 21:12:38 2001] [notice] (Postread =>) = { backhand:/globis/hm2001/html/banner.jsp, backh[Fri Nov 23 21:12:38 2001] [notice] (Translate <=) = { backhand:/globis/hm2001/html/banner.jsp, back[Fri Nov 23 21:12:38 2001] [notice] (Type <=) = { backhand-redirection, /globis/hm2001/html/banner.j[Fri Nov 23 21:12:38 2001] [notice] (Type =>) = *{ backhand-redirection, /globis/hm2001/html/banner.[Fri Nov 23 21:12:38 2001] [error] mod_backhand: Check 1
[Fri Nov 23 21:12:38 2001] [error] mod_backhand: Check 2
[Fri Nov 23 21:12:38 2001] [error] mod_backhand: Check 3 --

GET /globis/hm2001/html/banner.jsp?sprache=D&kontakt=2085292&veran_jj=2001&veran_nr=001&be_host=0a00Accept: text/xml, application/xml, application/xhtml+xml, text/html;q=0.9, image/png, image/jpeg, imAccept-Charset: ISO-8859-1, utf-8;q=0.66, *;q=0.66
Accept-Encoding: gzip, deflate, compress;q=0.9
Accept-Language: en-us
Cache-Control: max-age=259200
Connection: Keep-Alive
Cookie: be_host=0a00031b; JSESSIONID=E0D46056C48194B27443C53191A6C1F5
Host: globistest.dmag.messe.de
Keep-Alive: 300
Referer: http://globistest.dmag.messe.de/globis/hm2001/html/aussteller_fs_d.jsp?sprache=D&kontakt=20User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.6) Gecko/20011120
Via: 1.1 some.proxy.somewhere.com:3128 (Squid/2.4.STABLE1)
X-Forwarded-For: 10.0.0.1
BackhandProxied: 192.168.0.1

(snip)

but not with PHPSESSID :-(

(snip)

[Fri Nov 23 21:17:09 2001] [notice] (Translate <=) = { /banner-1_0_0.html, (null), (null) }
[Fri Nov 23 21:17:09 2001] [notice] (Translate =>) = { /banner-1_0_0.html, (null), (null) }
[Fri Nov 23 21:17:09 2001] [notice] (Type <=) = { (null), /banner-1_0_0.html, (null) }
[Fri Nov 23 21:17:09 2001] [notice] Func executed for (null) [byAge(NULL)] (2 -> 2)
[Fri Nov 23 21:17:09 2001] [notice] New server list: [ 0 1 ]
[Fri Nov 23 21:17:09 2001] [notice] Func executed for (null) [byBusyChildren(NULL)] (2 -> 2)
[Fri Nov 23 21:17:09 2001] [notice] New server list: [ 1 0 ]
[Fri Nov 23 21:17:09 2001] [notice] Func executed for (null) [bySession(be_host=)] (2 -> 2)
[Fri Nov 23 21:17:09 2001] [notice] New server list: [ 1 0 ]
[Fri Nov 23 21:17:09 2001] [notice] All funcs executed -> fox8.test.messe.de
[Fri Nov 23 21:17:09 2001] [notice] (Type =>) = *{ backhand-redirection, backhand:/banner-1_0_0.html[Fri Nov 23 21:17:09 2001] [notice] (Postread =>) = { Backhanding to 1 }
[Fri Nov 23 21:17:09 2001] [notice] (Postread =>) = { backhand:/banner-1_0_0.html, backhand-redirect[Fri Nov 23 21:17:09 2001] [notice] (Translate <=) = { backhand:/banner-1_0_0.html, backhand-redirec[Fri Nov 23 21:17:09 2001] [notice] (Type <=) = { backhand-redirection, /banner-1_0_0.html, (null) }[Fri Nov 23 21:17:09 2001] [notice] (Type =>) = *{ backhand-redirection, /banner-1_0_0.html, (null)
[Fri Nov 23 21:17:09 2001] [error] mod_backhand: Check 1
[Fri Nov 23 21:17:09 2001] [error] mod_backhand: Check 2
[Fri Nov 23 21:17:09 2001] [error] mod_backhand: Check 3 --

GET /banner-1_0_0.html HTTP/1.0
Accept: text/xml, application/xml, application/xhtml+xml, text/html;q=0.9, image/png, image/jpeg, imAccept-Charset: ISO-8859-1, utf-8;q=0.66, *;q=0.66
Accept-Encoding: gzip, deflate, compress;q=0.9
Accept-Language: en-us
Cache-Control: max-age=259200
Connection: Keep-Alive
Cookie: PHPSESSID=0a00031b2ee4a9b62c9b9b03d74ab04e3995aee3
Host: globistest.dmag.messe.de
Keep-Alive: 300
Referer: http://globistest.dmag.messe.de/1_0_0
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.6) Gecko/20011120
Via: 1.1 some.proxy.somewhere.com:3128 (Squid/2.4.STABLE1)
X-Forwarded-For: 10.0.0.1
BackhandProxied: 192.168.0.1

(snip)


It seems to me that bySession does ignore the identifier after its first ocurrence in the config?!

Best regards,

Tilman
[mod_backhand-users] Different bySessionid identifiers not recognized [ In reply to ]
On Friday, November 23, 2001, at 03:23 PM, Tilman Kastner wrote:
> Thank you for the fast reply!
>
> This is a request for a page located in the tomcat directory
> ($DOCUMENT_ROOT/globis). As you can see, be_host is set but is not
> used, although I set
> Backhand bySession be_host=

This looks like a bug to me.

Can you set one to use different rules than the other. Like one to user
byBusyChildren and another to use byLoad? Run your test again with the
same debugging output and see if it is using the correct list of
candidacy functions for each location. I have a feeling that one
directory is somehow overriding the configuration in the other directory.

--
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] Different bySessionid identifiers not recognized [ In reply to ]
Am Samstag, 8. Dezember 2001 00:13 schrieben Sie:
> On Friday, November 23, 2001, at 03:23 PM, Tilman Kastner wrote:
> > Thank you for the fast reply!
> >
> > This is a request for a page located in the tomcat directory
> > ($DOCUMENT_ROOT/globis). As you can see, be_host is set but is not
> > used, although I set
> > Backhand bySession be_host=
>
> This looks like a bug to me.
>
> Can you set one to use different rules than the other. Like one to user
> byBusyChildren and another to use byLoad? Run your test again with the
> same debugging output and see if it is using the correct list of
> candidacy functions for each location. I have a feeling that one
> directory is somehow overriding the configuration in the other directory.

You are right! This is exactly what happens. I defined a simple rule set for
the directory /htdocs/
Backhand byAge
Backhand byLoad

and a different one for /htdocs/globis/
Backhand byAge
Backhand byBusyChildren
Backhand byCost

(Not that useful, I know, just to have different setups)


As clearly shown in the log, only the first definition ever gets used. All
requests are processed via byAge, byLoad, even if they go into /globis/

Tilman
[mod_backhand-users] Different bySessionid identifiers not recognized [ In reply to ]
On Saturday, December 8, 2001, at 02:26 PM, Tilman Kastner wrote:
> You are right! This is exactly what happens. I defined a simple rule
> set for
> the directory /htdocs/
> Backhand byAge
> Backhand byLoad
>
> and a different one for /htdocs/globis/
> Backhand byAge
> Backhand byBusyChildren
> Backhand byCost
>
> As clearly shown in the log, only the first definition ever gets used.
> All
> requests are processed via byAge, byLoad, even if they go into /globis/

Okay. I can't replicate that here. I am using the latest CVS version
and I define:

BackhandLogLevel +dcsnall
<Directory /path/to/htdocs>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
Allow from all
Backhand byLoad
Backhand bySession topdir=
</Directory>
<Directory /path/to/htdocs/subdir>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
Allow from all
Backhand byBusyChildren
Backhand bySession subdir=
</Directory>
ScriptAlias /cgi-bin/ "/path/to//cgi-bin/"
<Directory "/path/to/cgi-bin">
AllowOverride None
Options None
Order allow,deny
Allow from all
Backhand byRandom
Backhand byLogWindow
Backhand bySession fafafa=
</Directory>

In my error log, I see the following up accesses:
accessing http://hostname/
[notice] Func executed for (null) [byLoad(NULL)] (1 -> 1)
[notice] Func executed for (null) [bySession(topdir=)] (1 -> 1)

accessing http://hostname/subdir/
[notice] Func executed for (null) [byBusyChildren(NULL)] (1 -> 1)
[notice] Func executed for (null) [bySession(subdir=)] (1 -> 1)

accessing http://hostname/cgi-bin/printenv
[notice] Func executed for (null) [byRandom(NULL)] (1 -> 1)
[notice] Func executed for (null) [byLogWindow(NULL)] (1 -> 0)
[notice] Func executed for (null) [bySession(fafafa=)] (1 -> 1)

Everything appears to work as it should.

Do you have any rewrites or aliases set 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] Different bySessionid identifiers not recognized [ In reply to ]
am 09.12.2001 22:49 Uhr schrieb Theo Schlossnagle:

> On Saturday, December 8, 2001, at 02:26 PM, Tilman Kastner wrote:
>> You are right! This is exactly what happens. I defined a simple rule
>> set for
>> the directory /htdocs/
>> Backhand byAge
>> Backhand byLoad
>>
>> and a different one for /htdocs/globis/
>> Backhand byAge
>> Backhand byBusyChildren
>> Backhand byCost
>>
>> As clearly shown in the log, only the first definition ever gets used.
>> All
>> requests are processed via byAge, byLoad, even if they go into /globis/
>
> Okay. I can't replicate that here. I am using the latest CVS version
> and I define:
>
> BackhandLogLevel +dcsnall
> <Directory /path/to/htdocs>
> Options Indexes FollowSymLinks MultiViews
> AllowOverride None
> Order allow,deny
> Allow from all
> Backhand byLoad
> Backhand bySession topdir=
> </Directory>
> <Directory /path/to/htdocs/subdir>
> Options Indexes FollowSymLinks MultiViews
> AllowOverride None
> Order allow,deny
> Allow from all
> Backhand byBusyChildren
> Backhand bySession subdir=
> </Directory>
> ScriptAlias /cgi-bin/ "/path/to//cgi-bin/"
> <Directory "/path/to/cgi-bin">
> AllowOverride None
> Options None
> Order allow,deny
> Allow from all
> Backhand byRandom
> Backhand byLogWindow
> Backhand bySession fafafa=
> </Directory>
>
> In my error log, I see the following up accesses:
> accessing http://hostname/
> [notice] Func executed for (null) [byLoad(NULL)] (1 -> 1)
> [notice] Func executed for (null) [bySession(topdir=)] (1 -> 1)
>
> accessing http://hostname/subdir/
> [notice] Func executed for (null) [byBusyChildren(NULL)] (1 -> 1)
> [notice] Func executed for (null) [bySession(subdir=)] (1 -> 1)
>
> accessing http://hostname/cgi-bin/printenv
> [notice] Func executed for (null) [byRandom(NULL)] (1 -> 1)
> [notice] Func executed for (null) [byLogWindow(NULL)] (1 -> 0)
> [notice] Func executed for (null) [bySession(fafafa=)] (1 -> 1)
>
> Everything appears to work as it should.
>
> Do you have any rewrites or aliases set up?
>

Nope. I checked out the latest CVS code, too, but no change. The Directory
directives appear within a VirtualHost definition, perhaps this is
important?

I could send you my apache config files if that would be of any help.

Thank you in advance!

Tilman


--
Tilman Kastner DEVICE/N GmbH
kastner@devicen.de Ilse-ter-Meer-Weg 7
PGP key available 30449 Hannover, Germany