<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>A Tempest of Thoughts</title>
	
	<link>http://tempe.st</link>
	<description>aka blog.to_int(:inig)</description>
	<lastBuildDate>Thu, 13 May 2010 09:54:57 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/tempest_intinig" /><feedburner:info uri="tempest_intinig" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>BetterSoftware 2010: Agile Tricks</title>
		<link>http://feedproxy.google.com/~r/tempest_intinig/~3/dv3BXhg21-s/</link>
		<comments>http://tempe.st/2010/05/bettersoftware-2010-agile-tricks/#comments</comments>
		<pubDate>Fri, 07 May 2010 19:52:05 +0000</pubDate>
		<dc:creator>Giovanni Intini</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[bsw2010]]></category>
		<category><![CDATA[css3]]></category>
		<category><![CDATA[doomboard]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[presentation]]></category>

		<guid isPermaLink="false">http://tempe.st/?p=324</guid>
		<description><![CDATA[This week I attended Better Software 2010, where I gave a presentation about the making of the DoomBoard . I had a lot of fun and attended a lot of interesting presentations from great professionals. Here&#8217;s my slides. Agile tricksView more presentations from intinig.]]></description>
			<content:encoded><![CDATA[	<p>This week I attended <a href="http://bettersoftware.it">Better Software 2010</a>, where I gave a presentation about the making of the <a href="https://github.com/mikamai/doomboardhd">DoomBoard</a> . I had a lot of fun and attended a lot of interesting presentations from great professionals.</p>
	<p>Here&#8217;s my slides.</p>
<div style="width:425px" id="__ss_4009306"><strong style="display:block;margin:12px 0 4px"><a href="http://www.slideshare.net/intinig/agile-tricks" title="Agile tricks">Agile tricks</a></strong><object id="__sse4009306" width="425" height="355"><param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=agiletricks-100507140716-phpapp02&#38;rel=0&#38;stripped_title=agile-tricks" /><param name="allowFullScreen" value="true"/><param name="allowScriptAccess" value="always"/><embed name="__sse4009306" src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=agiletricks-100507140716-phpapp02&#38;rel=0&#38;stripped_title=agile-tricks" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"></embed></object><div style="padding:5px 0 12px">View more <a href="http://www.slideshare.net/">presentations</a> from <a href="http://www.slideshare.net/intinig">intinig</a>.</div></div>

 <img src="http://feeds.feedburner.com/~r/tempest_intinig/~4/dv3BXhg21-s" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://tempe.st/2010/05/bettersoftware-2010-agile-tricks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://tempe.st/2010/05/bettersoftware-2010-agile-tricks/</feedburner:origLink></item>
		<item>
		<title>MIKAMAI, most innovative Italian company in 2009?</title>
		<link>http://feedproxy.google.com/~r/tempest_intinig/~3/tpASo4adFho/</link>
		<comments>http://tempe.st/2010/04/mikamai-most-innovative-italian-company-in-2009/#comments</comments>
		<pubDate>Wed, 07 Apr 2010 13:32:01 +0000</pubDate>
		<dc:creator>Giovanni Intini</dc:creator>
				<category><![CDATA[Business]]></category>
		<category><![CDATA[mikamai]]></category>
		<category><![CDATA[buongiorno]]></category>

		<guid isPermaLink="false">http://tempe.st/?p=317</guid>
		<description><![CDATA[I don&#8217;t usually like to post out of pride, but it&#8217;s always a nice feeling when your hard work is recognized by other people. In this case Buongiorno&#8217;s David Casalini, in an interview with nextinnovation.it when asked If you could give the 2009 Prize for Most Innovative Italian Company, you would give it to &#8230;? [...]]]></description>
			<content:encoded><![CDATA[	<p>I don&#8217;t usually like to post out of pride, but it&#8217;s always a nice feeling when your hard work is recognized by other people. </p>
	<p>In this case <a href="http://www.buongiorno.it">Buongiorno</a>&#8217;s David Casalini, in an <a href="http://www.nextinnovation.it/site/events/innovationcafe/intervista57.html">interview with nextinnovation.it</a> when asked <blockquote>If you could give the 2009 Prize for Most Innovative Italian Company, you would give it to &#8230;? And why?</blockquote></p>
	<p>he replied</p>
<blockquote>[...] I really like a Milano based company, Mikamai, a small team but very good, with lots of ideas, focused on people and they have a tech know-how that is frighteningly good.</blockquote>
	<p>Thanks, David!</p>

 <img src="http://feeds.feedburner.com/~r/tempest_intinig/~4/tpASo4adFho" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://tempe.st/2010/04/mikamai-most-innovative-italian-company-in-2009/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://tempe.st/2010/04/mikamai-most-innovative-italian-company-in-2009/</feedburner:origLink></item>
		<item>
		<title>Vhgen 1.1</title>
		<link>http://feedproxy.google.com/~r/tempest_intinig/~3/L-H8YMZHGeM/</link>
		<comments>http://tempe.st/2010/03/vhgen-1-1/#comments</comments>
		<pubDate>Thu, 04 Mar 2010 10:37:06 +0000</pubDate>
		<dc:creator>Giovanni Intini</dc:creator>
				<category><![CDATA[Random Stuff]]></category>
		<category><![CDATA[apache2]]></category>
		<category><![CDATA[vhgen]]></category>
		<category><![CDATA[vhost]]></category>

		<guid isPermaLink="false">http://tempe.st/?p=314</guid>
		<description><![CDATA[Here&#8217;s the latest update to my vhgen script for apache2 vhost templating.]]></description>
			<content:encoded><![CDATA[	<p>Here&#8217;s the latest update to my vhgen script for apache2 vhost templating.</p>
	<p><script src="http://gist.github.com/321613.js?file=vhgen.rb"></script></p>

 <img src="http://feeds.feedburner.com/~r/tempest_intinig/~4/L-H8YMZHGeM" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://tempe.st/2010/03/vhgen-1-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://tempe.st/2010/03/vhgen-1-1/</feedburner:origLink></item>
		<item>
		<title>The importance of being up-to-date</title>
		<link>http://feedproxy.google.com/~r/tempest_intinig/~3/w1EACTClxIc/</link>
		<comments>http://tempe.st/2010/02/the-importance-of-being-up-to-date/#comments</comments>
		<pubDate>Fri, 19 Feb 2010 09:19:34 +0000</pubDate>
		<dc:creator>Giovanni Intini</dc:creator>
				<category><![CDATA[Business]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[mikamai]]></category>
		<category><![CDATA[presentation]]></category>
		<category><![CDATA[rails 3]]></category>

		<guid isPermaLink="false">http://tempe.st/?p=312</guid>
		<description><![CDATA[Since I started working in the web development business the release of Rails 3 has been the first time I really felt I had to understand what was going on because otherwise I would be left behind. There were simpler times where just reading the feeds of the most important blogs allowed me to be [...]]]></description>
			<content:encoded><![CDATA[	<p>Since I started working in the web development business the release of Rails 3 has been the first time I really felt I <em>had</em> to understand what was going on because otherwise I would be left behind.</p>
	<p>There were simpler times where just reading the feeds of the most important blogs allowed me to be up-to-date, but either I&#8217;m getting old or the information has become too fractioned, because this time the only reason for me (and everyone in MIKAMAI) to get started with Rails 3 was to resume a practice that unfortunately we left behind in the past year: the internal presentations.</p>
	<p>Starting last thursday, and hopefully never stopping, thursday afternoons aren&#8217;t about working for others, but are about everyone sharing his knoweledge with the others.</p>
	<p>Last thursday was obviously all about Rails 3, so a couple of us connected their macs to the big screen and demoed new features of Rails 3.</p>
	<p>It was nice, interesting questions were asked during the demos, and the overall mood was pretty good. I look forward to the next session.</p>

 <img src="http://feeds.feedburner.com/~r/tempest_intinig/~4/w1EACTClxIc" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://tempe.st/2010/02/the-importance-of-being-up-to-date/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://tempe.st/2010/02/the-importance-of-being-up-to-date/</feedburner:origLink></item>
		<item>
		<title>Continous Integration with RunCodeRun</title>
		<link>http://feedproxy.google.com/~r/tempest_intinig/~3/KeGOS4_R_Gw/</link>
		<comments>http://tempe.st/2010/02/continous-integration-with-runcoderun/#comments</comments>
		<pubDate>Sun, 07 Feb 2010 14:09:36 +0000</pubDate>
		<dc:creator>Giovanni Intini</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[mikamai]]></category>
		<category><![CDATA[rsc]]></category>
		<category><![CDATA[rspec]]></category>
		<category><![CDATA[ruby social club]]></category>
		<category><![CDATA[runcoderun]]></category>
		<category><![CDATA[Testing]]></category>

		<guid isPermaLink="false">http://tempe.st/?p=308</guid>
		<description><![CDATA[Last thursday MIKAMAI hosted a Ruby Social Club meeting. Here&#8217;s the slides for my presentation. Continous Integration For The Lazy ProgrammerView more presentations from intinig.]]></description>
			<content:encoded><![CDATA[	<p>Last thursday MIKAMAI hosted a Ruby Social Club meeting. Here&#8217;s the slides for my presentation. </p>
<div style="width:425px;text-align:left" id="__ss_3074998"><a style="font:14px Helvetica,Arial,Sans-serif;display:block;margin:12px 0 3px 0;text-decoration:underline;" href="http://www.slideshare.net/intinig/continous-integration-for-the-lazy-programmer" title="Continous Integration For The Lazy Programmer">Continous Integration For The Lazy Programmer</a><object style="margin:0px" width="425" height="355"><param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=continousintegrationforthelazyprogrammer-100204174823-phpapp02&#38;rel=0&#38;stripped_title=continous-integration-for-the-lazy-programmer" /><param name="allowFullScreen" value="true"/><param name="allowScriptAccess" value="always"/><embed src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=continousintegrationforthelazyprogrammer-100204174823-phpapp02&#38;rel=0&#38;stripped_title=continous-integration-for-the-lazy-programmer" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"></embed></object><div style="font-size:11px;font-family:tahoma,arial;height:26px;padding-top:2px;">View more <a style="text-decoration:underline;" href="http://www.slideshare.net/">presentations</a> from <a style="text-decoration:underline;" href="http://www.slideshare.net/intinig">intinig</a>.</div></div>

 <img src="http://feeds.feedburner.com/~r/tempest_intinig/~4/KeGOS4_R_Gw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://tempe.st/2010/02/continous-integration-with-runcoderun/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://tempe.st/2010/02/continous-integration-with-runcoderun/</feedburner:origLink></item>
		<item>
		<title>WordPress + Lighttpd + WP-Supercache + Mobile Support</title>
		<link>http://feedproxy.google.com/~r/tempest_intinig/~3/R_R_sVaO5Os/</link>
		<comments>http://tempe.st/2009/11/wordpress-lighttpd-wp-supercache-mobile-support/#comments</comments>
		<pubDate>Sat, 28 Nov 2009 16:35:10 +0000</pubDate>
		<dc:creator>Giovanni Intini</dc:creator>
				<category><![CDATA[Lua]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[lighttpd]]></category>
		<category><![CDATA[wp-supercache]]></category>

		<guid isPermaLink="false">http://tempe.st/?p=305</guid>
		<description><![CDATA[Last year I made some work on lighttpd support for wp-supercache. It instantly became very popular and basically anyone running wordpress on lighttpd uses it, even if it lacks support for wp-supercache newest features. The amazing Jean Pierre Wenzel has recently released an updated version that adds a much needed mobile support. You can check [...]]]></description>
			<content:encoded><![CDATA[	<p>Last year I made <a href="http://tempe.st/2008/05/lightning-speed-wordpress-with-lighttpd-and-supercache-part-ii/">some work</a> on lighttpd support for wp-supercache. It instantly became very popular and basically anyone  running wordpress on lighttpd uses it, even if it lacks support for wp-supercache newest features.</p>
	<p>The amazing <a href="http://github.com/jpwenzel">Jean Pierre Wenzel</a> has recently released an updated version that adds a much needed mobile support.</p>
	<p>You can check it out <a href="http://github.com/jpwenzel/wp-lighttpd-rewrite">here.</a></p>
	<p>Thanks Jean Pierre!</p>


 <img src="http://feeds.feedburner.com/~r/tempest_intinig/~4/R_R_sVaO5Os" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://tempe.st/2009/11/wordpress-lighttpd-wp-supercache-mobile-support/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://tempe.st/2009/11/wordpress-lighttpd-wp-supercache-mobile-support/</feedburner:origLink></item>
		<item>
		<title>Updated Language Redirect Extension for Radiant</title>
		<link>http://feedproxy.google.com/~r/tempest_intinig/~3/6p9g8WO3Zm4/</link>
		<comments>http://tempe.st/2009/08/updated-language-redirect-extension-for-radiant/#comments</comments>
		<pubDate>Tue, 25 Aug 2009 10:41:34 +0000</pubDate>
		<dc:creator>Giovanni Intini</dc:creator>
				<category><![CDATA[Radiant]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[extensions]]></category>
		<category><![CDATA[github]]></category>
		<category><![CDATA[language redirect]]></category>

		<guid isPermaLink="false">http://tempe.st/?p=301</guid>
		<description><![CDATA[Thanks to the great work of netzpirat, the good old Language Redirect Extension has been updated to work with Radiant 0.8.0. Thanks netzpirat!]]></description>
			<content:encoded><![CDATA[	<p>Thanks to the great work of <a href="http://github.com/netzpirat">netzpirat</a>, the good old <a href="http://github.com/intinig/radiant_language_redirect_extension/tree/master">Language Redirect Extension</a> has been updated to work with Radiant 0.8.0.</p>
	<p>Thanks netzpirat!</p>

 <img src="http://feeds.feedburner.com/~r/tempest_intinig/~4/6p9g8WO3Zm4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://tempe.st/2009/08/updated-language-redirect-extension-for-radiant/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://tempe.st/2009/08/updated-language-redirect-extension-for-radiant/</feedburner:origLink></item>
		<item>
		<title>Deploy Drupal with Capistrano, a year later</title>
		<link>http://feedproxy.google.com/~r/tempest_intinig/~3/lg6yKBRMnLw/</link>
		<comments>http://tempe.st/2009/06/deploy-drupal-with-capistrano-a-year-later/#comments</comments>
		<pubDate>Thu, 18 Jun 2009 14:07:52 +0000</pubDate>
		<dc:creator>Giovanni Intini</dc:creator>
				<category><![CDATA[Capistrano]]></category>
		<category><![CDATA[Drupal]]></category>
		<category><![CDATA[mikamai]]></category>
		<category><![CDATA[deployment]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://tempe.st/?p=295</guid>
		<description><![CDATA[Here&#8217;s the slides for the presentation I gave at the latest Ruby Social Club in Milano. Deploy Drupal With Capistrano A Year LaterView more PDF documents from intinig.]]></description>
			<content:encoded><![CDATA[	<p>Here&#8217;s the slides for the presentation I gave at the latest Ruby Social Club in Milano.</p>
<div style="width:425px;text-align:left" id="__ss_1603333"><a style="font:14px Helvetica,Arial,Sans-serif;display:block;margin:12px 0 3px 0;text-decoration:underline;" href="http://www.slideshare.net/intinig/deploy-drupal-with-capistrano-a-year-later?type=presentation" title="Deploy Drupal With Capistrano A Year Later">Deploy Drupal With Capistrano A Year Later</a><object style="margin:0px" width="425" height="355"><param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=deploydrupalwithcapistranoayearlater-090618090126-phpapp02&#38;rel=0&#38;stripped_title=deploy-drupal-with-capistrano-a-year-later" /><param name="allowFullScreen" value="true"/><param name="allowScriptAccess" value="always"/><embed src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=deploydrupalwithcapistranoayearlater-090618090126-phpapp02&#38;rel=0&#38;stripped_title=deploy-drupal-with-capistrano-a-year-later" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"></embed></object><div style="font-size:11px;font-family:tahoma,arial;height:26px;padding-top:2px;">View more <a style="text-decoration:underline;" href="http://www.slideshare.net/">PDF documents</a> from <a style="text-decoration:underline;" href="http://www.slideshare.net/intinig">intinig</a>.</div></div>

 <img src="http://feeds.feedburner.com/~r/tempest_intinig/~4/lg6yKBRMnLw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://tempe.st/2009/06/deploy-drupal-with-capistrano-a-year-later/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://tempe.st/2009/06/deploy-drupal-with-capistrano-a-year-later/</feedburner:origLink></item>
		<item>
		<title>Stacktrace and FB Garage</title>
		<link>http://feedproxy.google.com/~r/tempest_intinig/~3/PF-J41cbjm4/</link>
		<comments>http://tempe.st/2009/05/stacktrace-and-fb-garage/#comments</comments>
		<pubDate>Wed, 13 May 2009 19:13:14 +0000</pubDate>
		<dc:creator>Giovanni Intini</dc:creator>
				<category><![CDATA[Random Stuff]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[fb garage]]></category>
		<category><![CDATA[mikamai]]></category>
		<category><![CDATA[Stacktrace]]></category>

		<guid isPermaLink="false">http://tempe.st/?p=292</guid>
		<description><![CDATA[For those of you who understand Italian, Stacktrace has published one article of mine, regarding the planning of FB Garage Milano. It was a fun event both to plan, execute and attend, I hope the article transmits the action that happened behind the lines.]]></description>
			<content:encoded><![CDATA[	<p>For those of you who understand Italian, <a href="http://stacktrace.it">Stacktrace</a> has published one article of mine, regarding the planning of <a href="http://stacktrace.it/2009/05/dietro-le-quinte-del-facebook-developer-garage-di-milano/">FB Garage Milano</a>.</p>
	<p>It was a fun event both to plan, execute and attend, I hope the article transmits the action that happened behind the lines.</p>

 <img src="http://feeds.feedburner.com/~r/tempest_intinig/~4/PF-J41cbjm4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://tempe.st/2009/05/stacktrace-and-fb-garage/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://tempe.st/2009/05/stacktrace-and-fb-garage/</feedburner:origLink></item>
		<item>
		<title>Apache Vhost Templating</title>
		<link>http://feedproxy.google.com/~r/tempest_intinig/~3/boFw-zPDP8s/</link>
		<comments>http://tempe.st/2009/04/apache-vhost-templating/#comments</comments>
		<pubDate>Sun, 26 Apr 2009 12:24:06 +0000</pubDate>
		<dc:creator>Giovanni Intini</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[apache2]]></category>

		<guid isPermaLink="false">http://tempe.st/?p=288</guid>
		<description><![CDATA[In Mikamai our deployment platform of choice is Ubuntu Linux. I like a lot the way Apache is set up on Debian based distributions, with the sites-available directory, but nonetheless creating new virtual hosts is a royal PITA. Today I finally solved the problem once and for all via a super simple ruby templating script. [...]]]></description>
			<content:encoded><![CDATA[	<p>In <a href="http://mikamai.com">Mikamai</a> our deployment platform of choice is Ubuntu Linux. I like a lot the way Apache is set up on Debian based distributions, with the sites-available directory, but nonetheless creating new virtual hosts is a royal PITA.</p>
	<p>Today I finally solved the problem once and for all via a super simple ruby templating script. Here it is, it uses a nice gem, optiflags, to parse the commandline arguments:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#008000; font-style:italic;">#!/usr/bin/env ruby</span>
&nbsp;
<span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'rubygems'</span>
<span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'optiflag'</span>
&nbsp;
<span style="color:#9966CC; font-weight:bold;">module</span> MyOptions extend OptiFlagSet
  flag <span style="color:#996600;">&quot;d&quot;</span> <span style="color:#9966CC; font-weight:bold;">do</span>
    description <span style="color:#996600;">&quot;The domain name the vhost should serve&quot;</span>
    long_form <span style="color:#996600;">&quot;domain&quot;</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
  optional_flag <span style="color:#996600;">&quot;a&quot;</span> <span style="color:#9966CC; font-weight:bold;">do</span>
    description <span style="color:#996600;">&quot;Email of the admin. If not specified defaults to info@domain&quot;</span>
    long_form <span style="color:#996600;">&quot;admin&quot;</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
  optional_switch_flag <span style="color:#996600;">&quot;w&quot;</span> <span style="color:#9966CC; font-weight:bold;">do</span>
    description <span style="color:#996600;">&quot;Adds www to non www redirection&quot;</span>
    long_form <span style="color:#996600;">&quot;www_redirect&quot;</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
  and_process!
<span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
flags = MyOptions.<span style="color:#9900CC;">flags</span>
&nbsp;
admin = flags.<span style="color:#9900CC;">a</span> ? flags.<span style="color:#9900CC;">a</span> : <span style="color:#996600;">&quot;info@#{flags.d}&quot;</span>
domain = flags.<span style="color:#9900CC;">d</span>
quoted_domain = flags.<span style="color:#9900CC;">d</span>.<span style="color:#CC0066; font-weight:bold;">gsub</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">/</span>\.<span style="color:#006600; font-weight:bold;">/</span>, <span style="color:#996600;">&quot;<span style="color:#000099;">\\</span>.&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
&nbsp;
TEMPLATE=<span style="color:#006600; font-weight:bold;">&lt;&lt;-</span>EOT
<span style="color:#006600; font-weight:bold;">&lt;</span>VirtualHost <span style="color:#006600; font-weight:bold;">*</span>:<span style="color:#006666;">80</span><span style="color:#006600; font-weight:bold;">&gt;</span>
        ServerName <span style="color:#008000; font-style:italic;">#{domain}</span>
        ServerAdmin <span style="color:#008000; font-style:italic;">#{admin} </span>
&nbsp;
        DocumentRoot <span style="color:#006600; font-weight:bold;">/</span>var<span style="color:#006600; font-weight:bold;">/</span>apps<span style="color:#006600; font-weight:bold;">/</span><span style="color:#008000; font-style:italic;">#{domain}</span>
        <span style="color:#006600; font-weight:bold;">&lt;</span>Directory <span style="color:#006600; font-weight:bold;">/&gt;</span>
                Options FollowSymLinks
                AllowOverride None
        <span style="color:#006600; font-weight:bold;">&lt;/</span>Directory<span style="color:#006600; font-weight:bold;">&gt;</span>
        <span style="color:#006600; font-weight:bold;">&lt;</span>Directory <span style="color:#006600; font-weight:bold;">/</span>var<span style="color:#006600; font-weight:bold;">/</span>apps<span style="color:#006600; font-weight:bold;">/</span><span style="color:#008000; font-style:italic;">#{domain}&gt;</span>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride All 
                Order allow,deny
                allow from all
        <span style="color:#006600; font-weight:bold;">&lt;/</span>Directory<span style="color:#006600; font-weight:bold;">&gt;</span>
&nbsp;
        ErrorLog <span style="color:#006600; font-weight:bold;">/</span>var<span style="color:#006600; font-weight:bold;">/</span>log<span style="color:#006600; font-weight:bold;">/</span>apache2<span style="color:#006600; font-weight:bold;">/</span><span style="color:#008000; font-style:italic;">#{domain}.log</span>
&nbsp;
        <span style="color:#008000; font-style:italic;"># Possible values include: debug, info, notice, warn, error, crit,</span>
        <span style="color:#008000; font-style:italic;"># alert, emerg.</span>
        LogLevel warn
&nbsp;
        CustomLog <span style="color:#006600; font-weight:bold;">/</span>var<span style="color:#006600; font-weight:bold;">/</span>log<span style="color:#006600; font-weight:bold;">/</span>apache2<span style="color:#006600; font-weight:bold;">/</span><span style="color:#008000; font-style:italic;">#{domain}.log combined</span>
&nbsp;
<span style="color:#006600; font-weight:bold;">&lt;/</span>VirtualHost<span style="color:#006600; font-weight:bold;">&gt;</span>
EOT
&nbsp;
REDIRECTION=<span style="color:#006600; font-weight:bold;">&lt;&lt;-</span>EOT
<span style="color:#006600; font-weight:bold;">&lt;</span>VirtualHost <span style="color:#006600; font-weight:bold;">*</span>:<span style="color:#006666;">80</span><span style="color:#006600; font-weight:bold;">&gt;</span>
  ServerName www.<span style="color:#008000; font-style:italic;">#{domain}</span>
  ServerAdmin <span style="color:#008000; font-style:italic;">#{admin} </span>
&nbsp;
  RewriteEngine On
  RewriteCond <span style="color:#006600; font-weight:bold;">%</span><span style="color:#006600; font-weight:bold;">&#123;</span>HTTP_HOST<span style="color:#006600; font-weight:bold;">&#125;</span> ^www\\.<span style="color:#008000; font-style:italic;">#{quoted_domain}</span>
  RewriteRule <span style="color:#006600; font-weight:bold;">&#40;</span>.<span style="color:#006600; font-weight:bold;">*</span><span style="color:#006600; font-weight:bold;">&#41;</span> http:<span style="color:#006600; font-weight:bold;">//</span><span style="color:#008000; font-style:italic;">#{domain}/$1 [R=301,L]</span>
<span style="color:#006600; font-weight:bold;">&lt;/</span>VirtualHost<span style="color:#006600; font-weight:bold;">&gt;</span>
EOT
&nbsp;
<span style="color:#CC0066; font-weight:bold;">puts</span> TEMPLATE
<span style="color:#CC0066; font-weight:bold;">puts</span> REDIRECTION <span style="color:#9966CC; font-weight:bold;">if</span> flags.<span style="color:#9900CC;">w</span>?</pre></div></div>

	<p>I use it like this:</p>
<pre>
$ vhgen -d domain.com -w &gt; /etc/apache2/sites-available/my_vhost
$ a2ensite my_vhost
</pre>

 <img src="http://feeds.feedburner.com/~r/tempest_intinig/~4/boFw-zPDP8s" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://tempe.st/2009/04/apache-vhost-templating/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://tempe.st/2009/04/apache-vhost-templating/</feedburner:origLink></item>
	</channel>
</rss><!-- Dynamic page generated in 0.768 seconds. --><!-- Cached page generated by WP-Super-Cache on 2010-07-05 11:56:04 --><!-- Compression = gzip -->
