<?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>Ball Dawg! &#187; .htaccess</title>
	<atom:link href="http://www.balldawg.net/index.php/tag/htaccess/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.balldawg.net</link>
	<description>Just some ninja monkeys, nothing to see here.  Move along.</description>
	<lastBuildDate>Fri, 13 Jan 2012 02:02:53 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Converting to lighttpd and dealing with .htaccess</title>
		<link>http://www.balldawg.net/index.php/2009/05/converting-to-lighttpd-and-dealing-with-htaccess/</link>
		<comments>http://www.balldawg.net/index.php/2009/05/converting-to-lighttpd-and-dealing-with-htaccess/#comments</comments>
		<pubDate>Fri, 08 May 2009 18:26:23 +0000</pubDate>
		<dc:creator>Andrew Rankin</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Lighty]]></category>
		<category><![CDATA[.htaccess]]></category>
		<category><![CDATA[proxy]]></category>

		<guid isPermaLink="false">http://www.balldawg.net/?p=28</guid>
		<description><![CDATA[I recently switched this server to Lighttpd (using PHP through FastCGI) from Apache. It was easy enough and I ended up with much faster serving websites, unfortunately I hit a snag on one of my sites that extensively uses .htaccess file for rewrites &#8211; which Lighttpd does not support. I didn&#8217;t want to bail on [...]]]></description>
			<content:encoded><![CDATA[<p>I recently switched this server to Lighttpd (using PHP through FastCGI) from Apache.  It was easy enough and I ended up with much faster serving websites, unfortunately I hit a snag on one of my sites that extensively uses .htaccess file for rewrites &#8211; which Lighttpd does not support.   I didn&#8217;t want to bail on the whole switch because of a single site, so looked and came up with a simple solution &#8211; proxy to Apache through Lighttpd for items on that site (www.350z.ws).  In lighttpds config, this was very easy to accomplish:</p>
<pre class="brush: php">
# Proxy 350z.ws back to apache
$HTTP[&quot;host&quot;] =~ &quot;www.3(5|7)0z.ws&quot; {
        $HTTP[&quot;url&quot;] !~ &quot;(wp-content|wp-includes|css|js|php$|^/blog/$)&quot; {
                proxy.server = ( &quot;/&quot; =&gt;
                        ( &quot;localhost&quot; =&gt;
                                ( &quot;host&quot; =&gt; &quot;127.0.0.1&quot;, &quot;port&quot; =&gt; 81 )
                        )
                )
        }
}
</pre>
<p>Note one (obvious) draw back is that you have to run Apache as well, but since I&#8217;m stopping most hits at Lighttpd by serving everything in wp-content, wp-includes, anything with css, js or php in the name, I can greatly reduce the number of Apaches I start and maintain.  In my case my Apache prefork config looks like this:</p>
<pre class="brush: php">
&lt;IfModule mpm_prefork_module&gt;
    StartServers          3
    MinSpareServers       2
    MaxSpareServers       5
    MaxClients          15
    MaxRequestsPerChild   10
&lt;/IfModule&gt;
</pre>
<p>You&#8217;ll also notice I&#8217;m not proxying the folder where WordPress lives back either, this is because it contains no rewrites for it specifically and will get the majority of the hits.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.balldawg.net/index.php/2009/05/converting-to-lighttpd-and-dealing-with-htaccess/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

