Forum Moderators: phranque

Message Too Old, No Replies

Apache load balancing and JSON

Apache load balancing JSON issue

         

nsukul

9:08 am on Jan 6, 2009 (gmt 0)

10+ Year Member



Hi All,

I am facing problems configuring mod_proxy_html in this scenario:

Configuration: two amazon instances:

Instance 1:
Apache Server 1 (Load balancer) IP:#*$!#*$!.66 only balancer manager

Apache Child 1 + PHP +Javascript+JSON IP:#*$!#*$!.66:4002 with documentroot with all code

Instance 2:

Apache Child 2+ PHP +Javascript+JSON IP:#*$!#*$!76 with document root with all code

When we configured the load balancer using mod_proxy, the failover scenario works well .

my URL always points to the #*$!#*$!.66/
in case of PHP +Javascript+JSON framework it is #*$!xx.66/xyz

As a failover scenario if Child 1(#*$!xx.66:4002) is stopped the load balancer succesfully redirects to Child 2(#*$!xx.76), but the URLs also gets changed! to #*$!xx.76.
This is overcome by using mod_proxy_html, but
though my main website URL #*$!#*$!.66/ works fine
PHP +Javascript+JSON it is #*$!xx.66/xyz gives Js errors!

I tried lots of configuration changing options but nothing worked.

my configuration settings is for apache server1 (load balancer) is:

ProxyRequests Off
Include /usr/local/apache3/conf/proxy_html.conf

SetOutputFilter proxy-html
#ProxyHTMLDoctype XHTML Legacy
ProxyHTMLLinks option value
#ProxyHTMLCharsetOut iso-8859-1
ProxyHTMLExtended On
ProxyPreserveHost On

<Proxy balancer://mycluster>
BalancerMember [xx.xx.xx.66:4002...] retry=10 loadfactor=1
BalancerMember [xx.xx.xx76...] retry=10 loadfactor=1
</Proxy>

ProxyPassReverse / [xx.xx.xx.66:4002...]
ProxyPassReverse / [xx.xx.xx76...]
ProxyPass /balancer-manager !
ProxyPass / balancer://mycluster/ stickysession=BALANCEID nofailover=On

ProxyHTMLURLMap [xx.xx.xx.66:4002...] [xx.xx.xx.66...]
ProxyHTMLURLMap [xx.xx.xx76...] [xx.xx.xx.66...]

<Location /balancer-manager>
SetHandler balancer-manager
</Location>

Please help me out.