logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

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.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: Need Help with balancer-manager
Author
VoodooMill



Joined: 11 Jan 2007
Posts: 60

PostPosted: Wed 13 Oct '10 23:30    Post subject: Need Help with balancer-manager Reply with quote

Hey there,

Using Apache 2.2.15...

It's been a while since I've had to bang my head with Apache (she's been very good to me), but I have a new project of creating a reverse proxy load balancer.

I've been taking it in small steps and it actually seems to be working well. Now I'm trying to enable the balancer-manager and having no luck.

If I setup the ProxyPass for anything other than / pages don't come through properly. But, with ProxyPass being / the balancer-manager doesn't work properly.

Here is the portion of my virtual host related to the reverse proxy/balancer:
<VirtualHost 127.0.0.1:443>
# MAIN
ServerName localhost
DocumentRoot "f:/www/hosting/localhost"

# REVERSE PROXY/BALANCER CONFIGURATION
ProxyRequests Off
SSLProxyEngine On
AllowCONNECT 443
RewriteEngine On

<Proxy *>
Order deny,allow
Allow from all
</Proxy>

Header add Set-Cookie "ROUTEID=.%{BALANCER_WORKER_ROUTE}e; path=/" env=BALANCER_ROUTE_CHANGED

<Proxy balancer://mycluster>
BalancerMember https://server1.domain.com:443 loadfactor=1 route=1
BalancerMember https://server2.domain.com:443 loadfactor=1 route=2
ProxySet stickysession=ROUTEID
</Proxy>

ProxyPass / balancer://mycluster/
ProxyPassReverse / balancer://mycluster/

# OTHER
<Location /server-status>
SetHandler server-status
Order deny,allow
Deny from all
Allow from 127.0.0.1
</Location>

<Location /balancer-manager>
SetHandler balancer-manager
Order deny,allow
Deny from all
Allow from 127.0.0.1
</Location>
</VirtualHost>

Any help would be appreciated!
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7371
Location: Germany, Next to Hamburg

PostPosted: Thu 14 Oct '10 0:34    Post subject: Re: Need Help with balancer-manager Reply with quote

VoodooMill wrote:

If I setup the ProxyPass for anything other than / pages don't come through properly.


Did you try to fix that with mod_proxy_html? Well that doesn't work on javascript and css files :-/

VoodooMill wrote:

But, with ProxyPass being / the balancer-manager doesn't work properly.


What is the error log about it?

What kinda software do you use on the backend servers that you have to create your own cookie instead of the one from your scripts? e.g.
Code:

stickysession=PHPSESSID
Back to top
VoodooMill



Joined: 11 Jan 2007
Posts: 60

PostPosted: Thu 14 Oct '10 1:40    Post subject: Re: Need Help with balancer-manager Reply with quote

James Blond wrote:

Did you try to fix that with mod_proxy_html? Well that doesn't work on javascript and css files :-/


I'm not sure what you mean by try to fix it with mod_proxy_html, but that module is loaded. And you hit it on the head, the CSS is precisely what's not coming through.

JamesBlond wrote:

What is the error log about it?

What kinda software do you use on the backend servers that you have to create your own cookie instead of the one from your scripts? e.g.
Code:

stickysession=PHPSESSID


The error is 404 in the browser. Makes sense since balancer-manager isn't configured on the backend servers. I also confirmed in the backend server logs that attempts were made to access balancer-manager on them. The balancer is passing the request for balancer-manager to the backend servers.

For this first phase I'm keeping things simple and testing against a couple Apache servers over both HTTP and HTTPS. But in the next phase of testing and production the backend servers will be running a purchased enterprise application (load balanced app servers (starting with 2, but can scale up as high as we need t0 - that's what the Apache lb is for - along with a db and storage server) that when a user visits a server they will need to maintain use of that server until they finish their session.
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7371
Location: Germany, Next to Hamburg

PostPosted: Thu 14 Oct '10 11:18    Post subject: Re: Need Help with balancer-manager Reply with quote

VoodooMill wrote:
James Blond wrote:

Did you try to fix that with mod_proxy_html? Well that doesn't work on javascript and css files :-/


I'm not sure what you mean by try to fix it with mod_proxy_html, but that module is loaded. And you hit it on the head, the CSS is precisely what's not coming through.


Well mod_proxy fixes the pathes in the html (like links) if configured. But it doesn't fix the pathes in css. Best is to use absolut paths in the css for images and so on and also absolut paths in the html.
You might check the error logs in both. Backend server and loadbalancer.
Back to top
VoodooMill



Joined: 11 Jan 2007
Posts: 60

PostPosted: Thu 14 Oct '10 17:01    Post subject: Re: Need Help with balancer-manager Reply with quote

James Blond wrote:
VoodooMill wrote:
James Blond wrote:

Did you try to fix that with mod_proxy_html? Well that doesn't work on javascript and css files :-/


I'm not sure what you mean by try to fix it with mod_proxy_html, but that module is loaded. And you hit it on the head, the CSS is precisely what's not coming through.


Well mod_proxy fixes the pathes in the html (like links) if configured. But it doesn't fix the pathes in css. Best is to use absolut paths in the css for images and so on and also absolut paths in the html.
You might check the error logs in both. Backend server and loadbalancer.


Unfortunately I have no control over the links placed in HTML docs since we have literally 100 webmasters enterprise wide all doing their own thing and my department has no authority over anything. We simply provide the service and "make things go" so to speak.

At any rate, what I need to work proxy and balancing wise seems to work, what I'm unable to figure out is how to get a request to balancer-manager from being passed along to the backend servers when ProxyPass/PassReverse is configured for /.

Any ideas?
Back to top
elthamare



Joined: 22 Oct 2010
Posts: 1

PostPosted: Fri 22 Oct '10 10:42    Post subject: Reply with quote

I don't know if this is what you're asking for, but using this:
Code:
ProxyPass /balancer-manager !

Right before the ProxyPass directive works for me.

Hope it helps.
Back to top
VoodooMill



Joined: 11 Jan 2007
Posts: 60

PostPosted: Fri 22 Oct '10 19:03    Post subject: Reply with quote

elthamare wrote:
I don't know if this is what you're asking for, but using this:
Code:
ProxyPass /balancer-manager !

Right before the ProxyPass directive works for me.

Hope it helps.


Outstanding, this works! I completely ProxyPassed (bad pun) over the ! in the documentation. I've gone back and read it.

"The ! directive is useful in situations where you don't want to reverse-proxy a subdirectory"

Thanks for the assistance all!
Back to top


Reply to topic   Topic: Need Help with balancer-manager View previous topic :: View next topic
Post new topic   Forum Index -> Apache