<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>JAKERI &#187; sticky</title>
	<atom:link href="http://www.jakeri.net/tag/sticky/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.jakeri.net</link>
	<description>Consulting/Development in Java, Objective-C for web based systems and iPhone</description>
	<lastBuildDate>Sun, 23 May 2010 20:04:21 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Sticky load balance with Apache HTTPD 2.2</title>
		<link>http://www.jakeri.net/2009/03/sticky-load-balance-with-apache-httpd-22/</link>
		<comments>http://www.jakeri.net/2009/03/sticky-load-balance-with-apache-httpd-22/#comments</comments>
		<pubDate>Wed, 18 Mar 2009 21:39:16 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[httpd]]></category>
		<category><![CDATA[loadbalancer]]></category>
		<category><![CDATA[mod_proxy]]></category>
		<category><![CDATA[mod_proxy_balancer]]></category>
		<category><![CDATA[sticky]]></category>

		<guid isPermaLink="false">http://www.jakeri.net/?p=62</guid>
		<description><![CDATA[<p>Apache HTTPD 2.2 includes some interesting features for making a basic load balancer.</p>
<p>This configuration makes a sticky loadbalancer with 3 backend servers. It is not dependant on any specific configuration of the backend server such as JSESSIONID or PHPSESSIONID.
It will create a BALANCEID-cookie with a route to a backend server.</p>
<p>
#You need at least these modules
#Header [...]]]></description>
			<content:encoded><![CDATA[<p>Apache HTTPD 2.2 <a href="http://httpd.apache.org/docs/2.2/mod/mod_proxy.html#proxypass">includes</a> <a href="http://httpd.apache.org/docs/2.2/mod/mod_proxy.html#balancermember">some</a> <a href="http://httpd.apache.org/docs/2.2/mod/mod_proxy_balancer.html#environment">interesting</a> features for making a basic load <a href="http://httpd.apache.org/docs/2.2/mod/mod_proxy_balancer.html">balancer</a>.</p>
<p>This configuration makes a sticky loadbalancer with 3 backend servers. It is <strong>not dependant</strong> on any specific configuration of the <strong>backend</strong> server such as JSESSIONID or PHPSESSIONID.<br />
It will create a BALANCEID-cookie with a route to a backend server.</p>
<p><code><br />
#You need at least these modules<br />
#Header used for setting cookie<br />
LoadModule headers_module ...<br />
#Proxy<br />
LoadModule proxy_module ...<br />
LoadModule proxy_http_module ...<br />
LoadModule proxy_balancer_module ...</p>
<p>#Set a cookie if BALANCER_ROUTE_CHANGED containing BALANCER_WORKER_ROUTE environment variable<br />
Header add Set-Cookie "BALANCEID=hej.%{BALANCER_WORKER_ROUTE}e; path=/;" env=BALANCER_ROUTE_CHANGED</p>
<p>#Show balancer-manager<br />
&lt;Location /balancer-manager&gt;<br />
&nbsp;&nbsp;SetHandler balancer-manager<br />
&nbsp;&nbsp;Order allow,deny<br />
&nbsp;&nbsp;Allow from all<br />
&lt;/Location&gt;</p>
<p>ProxyRequests Off</p>
<p>#Configure members for cluster<br />
&lt;Proxy balancer://jakeri&gt;<br />
&nbsp;&nbsp;BalancerMember http://b1.jakeri.net:80 route=server1<br />
&nbsp;&nbsp;BalancerMember http://b2.jakeri.net:80 route=server2<br />
&nbsp;&nbsp;BalancerMember http://b3.jakeri.net:80 route=server3<br />
&lt;/Proxy&gt;</p>
<p>#Do not proxy balancer-manager<br />
ProxyPass /balancer-manager !</p>
<p>#The actual ProxyPass<br />
ProxyPass / balancer://jakeri/ stickysession=BALANCEID nofailover=Off</p>
<p>#Do not forget ProxyPassReverse for redirects<br />
ProxyPassReverse / http://b1.jakeri.net/<br />
ProxyPassReverse / http://b2.jakeri.net/<br />
ProxyPassReverse / http://b3.jakeri.net/<br />
</code></p>
<p>I believe that this configuration is somewhat better compared to this <a href="http://www.markround.com/archives/33-Apache-mod_proxy-balancing-with-PHP-sticky-sessions.html">guide</a>.</p>
<p><em>I got to fix my css for the &lt;code&gt;&lt;/code&gt; :-/</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.jakeri.net/2009/03/sticky-load-balance-with-apache-httpd-22/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
	</channel>
</rss>
