Keep Server Online
If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.
or
A donation makes a contribution towards the costs, the time and effort that's going in this site and building.
Thank You! Steffen
Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
| |
|
Topic: Simple Revers Proxy works, but Load Balancer fails |
|
Author |
|
DeanWatson
Joined: 19 Dec 2006 Posts: 2
|
Posted: Tue 19 Dec '06 7:52 Post subject: Simple Revers Proxy works, but Load Balancer fails |
|
|
I have installed Apache 2.2.3 with SSL on a WebServer that is designated to be a Proxy Server, pooling in 3 other Servers. The other 3 Servers are currently running 2.0.54 with SSL. I can successfully run the Reverse Proxy to a single machine, but cannot get the Load Balancer to run. I get either "Connection Refused" or "no Protocol Handler was valid" errors.
Question 1. Do I need to upgrade all the pool servers to 2.2.3 also?
Question 2. Do I need to load the mod_proxy module on the pool servers? |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
Posted: Tue 19 Dec '06 22:00 Post subject: |
|
|
I found something in the docs
http://httpd.apache.org/docs/2.2/mod/mod_proxy.html#proxypass
see below!
Code: |
ProxyPass /special-area http://special.example.com/ smax=5 max=10
ProxyPass / balancer://mycluster stickysession=jsessionid nofailover=On
<Proxy balancer://mycluster>
BalancerMember http://1.2.3.4:8009
BalancerMember http://1.2.3.5:8009 smax=10
# Less powerful server, don't send as many requests there
BalancerMember http://1.2.3.6:8009 smax=1 loadfactor=20
</Proxy>
|
In the docs are more examples. |
|
Back to top |
|
DeanWatson
Joined: 19 Dec 2006 Posts: 2
|
Posted: Thu 21 Dec '06 4:51 Post subject: |
|
|
For the benefit of others, the solution to this problem was simple, but annoying! When running a simple Reverse Proxy for a specific directory, a trailing slash is required in the ProxyPass and ProxyPass Reverse directives e.g. /cgi-bin/ whereas for a Load Balancing Reverse Proxy it should not be used e.g /cgi-bin |
|
Back to top |
|
jay_naz
Joined: 19 Mar 2007 Posts: 1
|
Posted: Mon 19 Mar '07 17:46 Post subject: Hi apache gurus |
|
|
I am using apache 224 as a load balancer for oracle application server (oc4j). I have two oc4j containers on different machines.
While the load balancing seems to work, I am not able to make the sticky session work
I have the following configuration in my apache httpd.conf
ProxyPass / balancer://test/ stickysession=JSESSIONID
<Proxy balancer://test>
BalancerMember http://169.105.77.100:12501
BalancerMember http://169.105.77.101:12501
</Proxy>
ProxyPassReverse / http://169.105.77.100:12501/
ProxyPassReverse / http://169.105.77.101:12501/
but the apache server seems to send the http request in a round robin fashion even if the sessionID from the oc4j container is same.
Any tips/suggestions.
Regards,
Jayesh
MCSE, MCSD, SCJP, PMP |
|
Back to top |
|
tdonovan Moderator
Joined: 17 Dec 2005 Posts: 611 Location: Milford, MA, USA
|
Posted: Tue 20 Mar '07 2:33 Post subject: |
|
|
Two suggestions:1. Set a LogLevel debug directive and check logs\error.log for messages containing "proxy: BALANCER:"
2. Ensure you have a J2EE session started, then examine the cookies in your browser.
You should have a cookie named JSESSIONID which the load balancer will use. Note that the stickysession cookie name must be exact, and it is case-sensitive,
so if your cookie is named jsessionid instead of JSESSIONID - it won't work the way you have it.
FYI - the URI is checked for the stickysession value first, then cookies are checked for one with the stickysession name.
-tom- |
|
Back to top |
|
|
|
|
|
|