mod_backhand wont work with PHP based sessions unless you are using a
network drive... As PHP sessions are file based .. So you will wind up
with missmatching session data as each request is backhanded to another
machine. I've been using PHPLIB sessions that are database based.. And
have had no problems for some time... (About a year?)
On Sat, 20 Jan 2001, Theo E. Schlossnagle wrote:
|Here is where I profess my ignorance about PHP. I am not sure how the PHP
|session vairables are stored. I can image only one of two ways:
|
|(1) in the requested URI (e.g.
|
http://example.com/path/to/script.php?sessionid=<sessionvariable>)
|
|or
|
|(2) in a Cookie (e.g. an HTTP headers like:
| Cookie: sessionid=<sessionvariable>; path=/; domain=.example.com)
|
|Either way, mod_backhand calls the candidacy functions with the Apache
|request_rec structure. This structure contains headers and the URI, so with a
|few lines of C, you will be able to extract the session "key" from either of
|the above embedding mechanisms.
|
|Because each application/site uses a different form of session tracking, there
|isn't a default catch-all. It should be as simple as figuring out how your
|application stores session state, decoding it and making a decision.
|
|For example, store the hex encoded IP address of the server in a variable in
|the sessions state. Then when the request comeback in, get the "Cookie"
|header (out of r->headers_in) and look for the IP address. Hex decode it and
|try to find it in the serversstats, if you find it (n) and it is alive, then
|you just set servers[0].id = n; *n=1; return 1;
|
|Then mod_backhand will choose that server over all others (assuming that this
|candidacy function is called last. If you don't find your server alive in the
|list, don't modify "servers" or "n" and just return *n;.
|
|If anyone sets this up to work with PHP in particular, I would be very
|interested in posting your PHP code and you candidacy function on the mailing
|list and in the FAQ. We get this question alot :-)
|
|Martin Domig wrote:
|> I just came across mod_backhand while searching for a web-clustering
|> solution for my site. mod_packhand looks great and just like the thing
|> i was looking for, only that i haven't tested it yet.
|>
|> The question for I was looking an answer on the homepage is:
|> Can I use mod_backhand with sessions? (PHP session variables)
|>
|> I.e. can mod_backhand be configured to redirect all requests of an
|> established session to the same host over and over again?
|
|