<?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>Glen Lumanau &#187; ubuntu</title>
	<atom:link href="http://lumanau.web.id/tag/ubuntu/feed" rel="self" type="application/rss+xml" />
	<link>http://lumanau.web.id</link>
	<description>About Glen Lumanau</description>
	<lastBuildDate>Fri, 23 Jul 2010 10:08:00 +0000</lastBuildDate>
	<language></language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Building nginx package with upstream hash module on Debian/Ubuntu</title>
		<link>http://lumanau.web.id/2008/10/18/building-nginx-package-with-upstream-hash-module-on-debianubuntu.html</link>
		<comments>http://lumanau.web.id/2008/10/18/building-nginx-package-with-upstream-hash-module-on-debianubuntu.html#comments</comments>
		<pubDate>Sat, 18 Oct 2008 06:22:14 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Unix]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[recompile]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[upstream hash]]></category>

		<guid isPermaLink="false">http://www.lumanau.web.id/?p=101</guid>
		<description><![CDATA[This’s how to recompile nginx with upstream hash module We need to recompile nginx to support upstream hash module. Because debian based nginx, doesn’t have this module loaded. And we need to download the module from here First of all, we need to install the software that’s needed to recompile a .deb packages apt-get install [...]]]></description>
			<content:encoded><![CDATA[<div class="post-content">
<p>This’s how to recompile nginx with <a href="http://wiki.codemongers.com/NginxHttpUpstreamRequestHashModule">upstream hash module</a></p>
<p>We need to recompile nginx to support upstream hash module. Because debian based nginx, doesn’t have this module loaded. And we need to download the module from <a href="http://www.lumanau.web.id/sources/nginx_upstream_hash-0.3.tar.gz">here</a></p>
<p>First of all, we need to install the software that’s needed to recompile a .deb packages</p>
<blockquote><p><em>apt-get install build-essential debhelper fakeroot</em></p></blockquote>
<p>Then go to /usr/local/src directory</p>
<blockquote><p><em>cd /usr/local/src</em></p></blockquote>
<p>Now we need to download the source package of nginx</p>
<blockquote><p><em>apt-get source nginx</em></p>
<p><em>apt-get build-dep nginx</em></p></blockquote>
<p>Before we go to the next step, we need to patch nginx with the patch given</p>
<blockquote><p><em>cd /usr/local/src/nginx-0.6.32/</em></p>
<p><em>patch -p0 &lt; /path/to/upstream/hash/directory/nginx.patch</em></p></blockquote>
<p>Then we go to nginx directory</p>
<blockquote><p><em>cd /usr/local/src/nginx-0.6.32/debian</em></p></blockquote>
<p>Edit rules to add upstream hash module</p>
<blockquote><p><em>vim rules</em></p></blockquote>
<p>Add <em>&#8211;add-module=/path/to/upstream/hash/directory</em></p>
<p>Go back to nginx directory</p>
<blockquote><p><em>cd ..</em></p></blockquote>
<p>Now it’s time for us to compile nginx and take a glass of coffee while waiting</p>
<blockquote><p><em>dpkg-buildpackage -rfakeroot</em></p></blockquote>
<p>If you found error like</p>
<blockquote><p><em>(WARNING: Failed to sign .dsc and .changes file)</em></p></blockquote>
<p>That means normal. Just ignore the error msg</p>
<p>Now go back to /usr/src directory</p>
<blockquote><p><em>cd /usr/src</em></p></blockquote>
<p>You should see a file called <strong><em>nginx_0.6.32-3_i386.deb</em></strong></p>
<p>Then install our new compiled nginx package</p>
<blockquote><p><em>dpkg -i </em><em>nginx_0.6.32-3_i386.deb</em></p></blockquote>
<p>Then lastly we add “fair” module on our nginx.conf</p>
<p>Example</p>
<blockquote><p><em>upstream backend {<br />
server server1;<br />
server server2;<br />
hash $http_cookie_username;<br />
}</em></p></blockquote>
<p>Congratulations that you have install nginx with fair proxy module on your debian <img class="wp-smiley" src="../wp-includes/images/smilies/icon_smile.gif" alt=":)" /></p>
<p>If you don&#8217;t want to do that installation, you can <a href="http://www.lumanau.web.id/debian/nginx_0.6.32-3_i386.deb">download directly</a> precompiled debian nginx package that&#8217;s already patched for upstream hash module</div>
]]></content:encoded>
			<wfw:commentRss>http://lumanau.web.id/2008/10/18/building-nginx-package-with-upstream-hash-module-on-debianubuntu.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
