<?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>-= n8v =- &#187; obscurity</title>
	<atom:link href="http://n8v.enteuxis.org/tags/obscurity/feed/" rel="self" type="application/rss+xml" />
	<link>http://n8v.enteuxis.org</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Tue, 27 Sep 2011 00:52:53 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2-beta2-18055</generator>
		<item>
		<title>Deny access to .svn directories with IIS</title>
		<link>http://n8v.enteuxis.org/2009/11/deny-access-to-svn-directories-with-iis/</link>
		<comments>http://n8v.enteuxis.org/2009/11/deny-access-to-svn-directories-with-iis/#comments</comments>
		<pubDate>Fri, 13 Nov 2009 21:40:38 +0000</pubDate>
		<dc:creator>nathan</dc:creator>
				<category><![CDATA[Figuring IT Out]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[IIS]]></category>
		<category><![CDATA[obscurity]]></category>
		<category><![CDATA[rewrite]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[subversion]]></category>
		<category><![CDATA[svn]]></category>

		<guid isPermaLink="false">http://n8v.enteuxis.org/?p=295</guid>
		<description><![CDATA[The problem: I like using Subversion to deploy web content to production servers. I check in everything while I&#8217;m working on the development copy, then check out onto the server when it&#8217;s ready. Subversion creates a .svn directory contain readable copies of all your files, which is bad for server-processed files like .php or .aspx [...]]]></description>
			<content:encoded><![CDATA[<h3>The problem:</h3>

<p>I like using Subversion to deploy web content to production servers.  I check in everything while I&#8217;m working on the development copy, then check out onto the server when it&#8217;s ready.</p>

<p>Subversion creates a <code>.svn</code> directory contain readable copies of all your files, which is bad for server-processed files like .php or .aspx that you don&#8217;t want readable by, say, <a href="http://en.wikipedia.org/wiki/Google_hacking">Google Hackers</a>.</p>

<p>I have thought about this before but when I went to do it I couldn&#8217;t find any clear guides online.  I did find <a href="http://serverfault.com/questions/23340/ignoring-svn-directories-under-iis/83480#83480">this question at Server Fault</a>, which is a newish sister of <a href="http://stackoverflow.com">Stack Overflow</a>, which reminds me kind of Experts Exchange but without the suck.  Except that in this case the answers sucked.   So I figured it out and added my answer and am posting it here too:
<span id="more-295"></span></p>

<hr />

<p>&#8220;Don&#8217;t do it that way&#8221; does not answer the question.</p>

<p>Practically, I like having a working copy on the production server, because that way I can make quick changes in production (who has never done that?) and check them back in.  It depends on where you want your security/convenience slider, and in many cases this is a good place.</p>

<p>The standard solution in Apacheland is to leave the .svn files there but tell the web server to never serve them.  Here&#8217;s how to do that with IIS 5 through 7 on Windows NT4 through 2008.</p>

<ol>
<li><p>Download and install <a href="http://www.helicontech.com/isapi_rewrite/">ISAPI_Rewrite</a> &#8212; the Lite version will be enough for this purpose.  There are two versions, version 2 and 3.  Use ISAPI_Rewrite3 unless you need to support NT4.    Also, note the extra <a href="http://www.helicontech.com/isapi_rewrite/doc/sysreq.htm">IIS features</a> you need to enable for Win 2008.<br />
<strong>Warning</strong>&#8211; the MSI installer may stop and start IIS.</p></li>
<li><p>Launch the <em>Helicon->ISAPI_Rewrite3->ISAPI_Rewrite Manager</em> app from the Start Menu.  It makes editing the config file (installed in <em>C:\Program Files\Helicon\ISAPI_Rewrite3\httpd.conf</em> by default) easier, but you can also do it by hand.  <strong>note</strong>, the config file in ISAPI_Rewrite2 is named <em>httpd.ini</em> and is read-only by default.</p></li>
<li><p>Add these lines to <em>httpd.conf</em>:</p></li>
</ol>


<div class="wp_syntax"><div class="code"><pre class="apache"><span class="co1"># Deny access to Subversion working copy administrative</span>
<span class="co1">#  directories (.svn) and their contents</span>
<span class="kw1">RewriteRule</span> .*/\.svn\b.* . [F,I,O]</pre></div></div>


<p>Now, any request for a .svn directory or its contents will result in a 404 Not Found from the server.</p>
]]></content:encoded>
			<wfw:commentRss>http://n8v.enteuxis.org/2009/11/deny-access-to-svn-directories-with-iis/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

