<?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"
	>

<channel>
	<title>Oremj's Blog</title>
	<atom:link href="http://blog.mozilla.com/oremj/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.mozilla.com/oremj</link>
	<description>Just another Blog.mozilla.com weblog</description>
	<pubDate>Fri, 14 Mar 2008 17:36:18 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
	<language>en</language>
			<item>
		<title>Efficiently Updating Web Sites on Web Clusters</title>
		<link>http://blog.mozilla.com/oremj/2008/03/14/efficiently-updating-web-sites-on-web-clusters/</link>
		<comments>http://blog.mozilla.com/oremj/2008/03/14/efficiently-updating-web-sites-on-web-clusters/#comments</comments>
		<pubDate>Fri, 14 Mar 2008 17:29:00 +0000</pubDate>
		<dc:creator>oremj</dc:creator>
		
		<category><![CDATA[Linux]]></category>

		<category><![CDATA[System Administration]]></category>

		<guid isPermaLink="false">http://blog.mozilla.com/oremj/2008/03/14/efficiently-updating-web-sites-on-web-clusters/</guid>
		<description><![CDATA[Recently, we ran in to a problem with our web content sync setup.
Old Setup:

Host all web bits on two admin servers
Pull via rsync  from admin01 server to the apache servers on 5 min staggered cron

That setup worked fairly well for us for quite a long time, but it doesn&#8217;t scale.  At about 18 [...]]]></description>
			<content:encoded><![CDATA[<p>Recently, we ran in to a problem with our web content sync setup.</p>
<p><strong>Old Setup</strong>:</p>
<ul>
<li>Host all web bits on two admin servers</li>
<li>Pull via rsync  from admin01 server to the apache servers on 5 min staggered cron</li>
</ul>
<p>That setup worked fairly well for us for quite a long time, but <strong>it doesn&#8217;t scale</strong>.  At about 18 or 20 apache servers pulling at 5 min intervals the admin server was constantly pegged from all the rsync processes scanning the file system.</p>
<p>We needed something with state, but something that was simple.  Revision control has state, but would the operations be quick enough to be useful?  It turns out <a href="http://git.or.cz/" class="extlink">Git</a> was pretty well suited for the task.</p>
<p><strong>New setup</strong>:</p>
<ul>
<li>Host all bits on admin servers</li>
<li>Commit bits on admin01 on a 5 minute cron in to git</li>
<li>Pull commits via Git to apache servers</li>
</ul>
<p>This new setup scales very well, because we only need one file system scan per 5 minutes instead of 20+.  The Git fetches are very fast.</p>
<p><strong>Initial installation</strong>:</p>
<p><strong>admin01:/etc/xinetd.d/git-daemon</strong>:<br />
<code><br />
service git<br />
{<br />
disable = no<br />
type            = UNLISTED<br />
port            = 9418<br />
socket_type     = stream<br />
wait            = no<br />
user            = nobody<br />
server          = /usr/bin/git-daemon<br />
server_args     = --inetd --export-all --verbose /www<br />
log_on_failure  += USERID<br />
}<br />
</code></p>
<p><strong>Admin01: Import /www</strong>:<br />
<code><br />
cd /www<br />
git-init<br />
git-add .<br />
git-commit -m 'Initial Import'<br />
</code></p>
<p><strong>Apache Servers initial setup</strong>:<br />
<code><br />
git-clone git://admin01/www<br />
</code></p>
<p><strong>Commit Cron on admin01</strong> (add any new files and delete any removed files from the repo):<br />
<code><br />
#!/bin/bash<br />
lockfile=&#8221;/tmp/git.lock&#8221;<br />
if [ -f $lockfile ]; then<br />
if kill -0 $(cat $lockfile); then<br />
echo &#8220;$0 appears to be already running.&#8221;<br />
exit 1<br />
fi<br />
fi<br />
echo $$ &gt; $lockfile<br />
cd /www<br />
/usr/bin/git-add .<br />
/usr/bin/git-commit -a -m &#8220;AUTO COMMIT: `date +%FT%T`&#8221;<br />
rm -f $lockfile<br />
</code><br />
<strong>Fetch Cron on the apache servers</strong> (fetches origin and then resets the /www to origin):</p>
<p><code><br />
#!/bin/bash<br />
cd /www;<br />
/usr/bin/git-fetch &amp;&amp; /usr/bin/git-reset &#8211;hard origin;<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mozilla.com/oremj/2008/03/14/efficiently-updating-web-sites-on-web-clusters/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Libc Man Pages</title>
		<link>http://blog.mozilla.com/oremj/2007/05/17/libc-man-pages/</link>
		<comments>http://blog.mozilla.com/oremj/2007/05/17/libc-man-pages/#comments</comments>
		<pubDate>Thu, 17 May 2007 18:58:41 +0000</pubDate>
		<dc:creator>oremj</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.mozilla.com/oremj/2007/05/17/libc-man-pages/</guid>
		<description><![CDATA[I spend about 5 minutes searching for the libc man pages every time I install Debian or Ubuntu.
The package is &#8216;manpages-dev&#8217;; now I won&#8217;t forget!
]]></description>
			<content:encoded><![CDATA[<p>I spend about 5 minutes searching for the libc man pages every time I install <a href="http://www.debian.org/" class="extlink">Debian</a> or <a href="http://www.ubuntu.com/" class="extlink">Ubuntu</a>.</p>
<p>The package is &#8216;manpages-dev&#8217;; now I won&#8217;t forget!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mozilla.com/oremj/2007/05/17/libc-man-pages/feed/</wfw:commentRss>
		</item>
		<item>
		<title>MediaWiki: HttpAuth Plugin</title>
		<link>http://blog.mozilla.com/oremj/2007/01/29/mediawiki-httpauth-plugin/</link>
		<comments>http://blog.mozilla.com/oremj/2007/01/29/mediawiki-httpauth-plugin/#comments</comments>
		<pubDate>Tue, 30 Jan 2007 03:29:59 +0000</pubDate>
		<dc:creator>oremj</dc:creator>
		
		<category><![CDATA[MediaWiki]]></category>

		<guid isPermaLink="false">http://blog.mozilla.com/oremj/2007/01/29/mediawiki-httpauth-plugin/</guid>
		<description><![CDATA[Using MediaWiki behind http authetication was always slightly annoying in the past.  One would have to:

 Login with their htpasswd credentials
Create account if it did not exist already
Login with their wiki credentials
Remember both sets of credentials

This extension reduces the previous four steps into one simple step.

Login with htpasswd credentials

The extension can be downloaded at [...]]]></description>
			<content:encoded><![CDATA[<p>Using MediaWiki behind http authetication was always slightly annoying in the past.  One would have to:</p>
<ol>
<li> Login with their htpasswd credentials</li>
<li>Create account if it did not exist already</li>
<li>Login with their wiki credentials</li>
<li>Remember both sets of credentials</li>
</ol>
<p>This extension reduces the previous four steps into one simple step.</p>
<ol>
<li>Login with htpasswd credentials</li>
</ol>
<p>The extension can be downloaded at <a href="http://people.mozilla.com/~oremj/HttpAuthPlugin.php">http://people.mozilla.com/~oremj/HttpAuthPlugin.php</a> and setup instructions at <a href="http://www.mediawiki.org/wiki/Extension:HttpAuth" class="extlink">MediaWiki</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mozilla.com/oremj/2007/01/29/mediawiki-httpauth-plugin/feed/</wfw:commentRss>
		</item>
		<item>
		<title>SimpleCaptcha Plugin</title>
		<link>http://blog.mozilla.com/oremj/2006/12/28/simplecaptcha-plugin/</link>
		<comments>http://blog.mozilla.com/oremj/2006/12/28/simplecaptcha-plugin/#comments</comments>
		<pubDate>Thu, 28 Dec 2006 22:46:03 +0000</pubDate>
		<dc:creator>oremj</dc:creator>
		
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://blog.mozilla.com/oremj/2006/12/28/simplecaptcha-plugin/</guid>
		<description><![CDATA[The other day spent several hours searching for a Wordpress MU(WPMU) compatible captcha plugin with no success.  I didn&#8217;t care about a robust spam fighting packages with Bayesian filtering etc;  all I wanted was very simple and accessible plugin.  Yesterday, I came up with SimpleCaptcha.  So far SimpleCaptcha seems to be [...]]]></description>
			<content:encoded><![CDATA[<p>The other day spent several hours searching for a Wordpress MU(WPMU) compatible captcha plugin with no success.  I didn&#8217;t care about a robust spam fighting packages with Bayesian filtering etc;  all I wanted was very simple and accessible plugin.  Yesterday, I came up with <a href="http://blog.mozilla.com/oremj/simplecaptcha-plugin/" title="SimpleCaptcha">SimpleCaptcha</a>.  So far SimpleCaptcha seems to be working very well against spam bots.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mozilla.com/oremj/2006/12/28/simplecaptcha-plugin/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
