Discussion:
Looking for some help...
Jim Jagielski
2005-08-19 16:10:11 UTC
Permalink
I am trying to add a test for the proxy balancer stuff. In extra.conf.in
I have:

<IfModule mod_proxy_balancer.c>
<VirtualHost proxy_http_bal1>
DocumentRoot @SERVERROOT@/htdocs/modules/proxy
</VirtualHost>

<VirtualHost proxy_http_bal2>
DocumentRoot @SERVERROOT@/htdocs/modules/proxy
</VirtualHost>
</IfModule>

to define the 2 balanced proxies

Now I also have in proxy.conf.in:

<IfModule mod_proxy_balancer.c>

<VirtualHost _default_:mod_proxy_balancer>
<Proxy balancer://foo>
BalancerMember http://proxy_http_bal1 loadfactor=1
BalancerMember http://proxy_http_bal2 loadfactor=1
</Proxy>

ProxySet balancer://foo lbmethod=bytraffic

<Location /baltest>
ProxyPass balancer://foo/
</Location>

</VirtualHost>
</IfModule>

Now, the rub is that those 2 BalancerMember lines (http:// ...)
should actually have the url for the 2 balanced proxies
(localhost:port)... But I can't for the life of me figure
out how to obtain what the auto-gen'ed port numbers for those
2 balanced vhosts will be.

Any ideas?
Joe Orton
2005-08-19 16:24:06 UTC
Permalink
Post by Jim Jagielski
I am trying to add a test for the proxy balancer stuff.
yay! :)
Post by Jim Jagielski
<IfModule mod_proxy_balancer.c>
<VirtualHost proxy_http_bal1>
</VirtualHost>
<VirtualHost proxy_http_bal2>
</VirtualHost>
</IfModule>
to define the 2 balanced proxies
<IfModule mod_proxy_balancer.c>
<VirtualHost _default_:mod_proxy_balancer>
<Proxy balancer://foo>
BalancerMember http://proxy_http_bal1 loadfactor=1
BalancerMember http://proxy_http_bal2 loadfactor=1
</Proxy>
ProxySet balancer://foo lbmethod=bytraffic
<Location /baltest>
ProxyPass balancer://foo/
</Location>
</VirtualHost>
</IfModule>
Now, the rub is that those 2 BalancerMember lines (http:// ...)
should actually have the url for the 2 balanced proxies
(localhost:port)... But I can't for the life of me figure
out how to obtain what the auto-gen'ed port numbers for those
2 balanced vhosts will be.
Hmm - do you really need the special vhosts if they will just behave the
same as the default server? You can use @SERVERNAME@:@PORT@ to get that
vhost name out.

joe
Joe Orton
2005-08-19 16:37:35 UTC
Permalink
Post by Jim Jagielski
<IfModule mod_proxy_balancer.c>
<VirtualHost _default_:mod_proxy_balancer>
<Proxy balancer://foo>
BalancerMember http://proxy_http_bal1 loadfactor=1
BalancerMember http://proxy_http_bal2 loadfactor=1
</Proxy>
I tweaked Apache::Test to make this possible: try

<VirtualHost proxy_http_bal1>
...
</VirtualHost>

<VirtualHost mod_proxy_balancer>
<Proxy balancer://foo>
BalancerMember http://@SERVERNAME@:@PROXY_HTTP_BAL1_PORT@ ...

etc - you must ensure that the referenced vhost is defined before you
use the corresponding _PORT variable; i.e. put them in the same .conf.in
file in that order.

joe
Jim Jagielski
2005-08-19 16:41:29 UTC
Permalink
Post by Joe Orton
Post by Jim Jagielski
<IfModule mod_proxy_balancer.c>
<VirtualHost _default_:mod_proxy_balancer>
<Proxy balancer://foo>
BalancerMember http://proxy_http_bal1 loadfactor=1
BalancerMember http://proxy_http_bal2 loadfactor=1
</Proxy>
I tweaked Apache::Test to make this possible: try
<VirtualHost proxy_http_bal1>
...
</VirtualHost>
<VirtualHost mod_proxy_balancer>
<Proxy balancer://foo>
etc - you must ensure that the referenced vhost is defined before you
use the corresponding _PORT variable; i.e. put them in the same .conf.in
file in that order.
YES!

Thanks! :)
--
===========================================================================
Jim Jagielski [|] ***@jaguNET.com [|] http://www.jaguNET.com/
"Sith happens" - Yoda
Jim Jagielski
2005-08-19 16:38:35 UTC
Permalink
Post by Joe Orton
Hmm - do you really need the special vhosts if they will just behave the
vhost name out.
Well, to be as close to the usual use, yeah, we do.
--
===========================================================================
Jim Jagielski [|] ***@jaguNET.com [|] http://www.jaguNET.com/
"Sith happens" - Yoda
Loading...