<?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>Evan Sims &#187; lessn</title>
	<atom:link href="http://evansims.com/tag/lessn/feed/" rel="self" type="application/rss+xml" />
	<link>http://evansims.com</link>
	<description>The life and times of a video game designer and web developer from Chicago.</description>
	<lastBuildDate>Fri, 03 Sep 2010 05:27:44 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
<atom:link rel="hub" href="http://pubsubhubbub.appspot.com" />
	<atom:link rel="hub" href="http://superfeedr.com/hubbub" />
			<item>
		<title>Hack: Getting Lessn to Work on lighttpd</title>
		<link>http://evansims.com/2009/12/hack-getting-lessn-to-work-on-lighttpd/</link>
		<comments>http://evansims.com/2009/12/hack-getting-lessn-to-work-on-lighttpd/#comments</comments>
		<pubDate>Wed, 23 Dec 2009 19:55:24 +0000</pubDate>
		<dc:creator>evan</dc:creator>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[lessn]]></category>
		<category><![CDATA[lighttpd]]></category>
		<category><![CDATA[Shaun Inman]]></category>

		<guid isPermaLink="false">http://www.evansims.com/?p=1405</guid>
		<description><![CDATA[Over the weekend I decided to bite the bullet and move my domains from an Apache setup with Slicehost over to a peppier lighttpd server with Linode. All of my web apps transitioned to the new configuration easily (including WordPress) with a little lighttpd.conf magic, but I had a hard time getting Lessn to work nicely.]]></description>
			<content:encoded><![CDATA[<p>Over the weekend I decided to bite the bullet and move my domains from an Apache setup with Slicehost over to a peppier lighttpd server with Linode. All of my web apps transitioned to the new configuration easily (including WordPress) with a little lighttpd.conf magic, but I had a hard time getting Lessn to work nicely. I tried url.rewrites and url.redirects in all sorts of combinations, but was never able to find a solution for passing the token variable directly. Ultimately I decided to go an easier route and put in a minor hack into Lessn itself.</p>
<p><span id="more-1405"></span></p>
<p>First, here&#8217;s what the related portion of my lighttpd.conf file looks like. We&#8217;re just replicating what Lessn&#8217;s own .htaccess file tells Apache to do.</p>
<pre><code>$HTTP["url"] =~ "^/g/-/" {
	server.error-handler-404 = "/g/-/index.php"
}
$HTTP["url"] =~ "^/g/" {
	server.error-handler-404 = "/g/index.php"
}</code></pre>
<p><strong>Important &#8211;</strong> I have my Lessn installation located at /g, so you&#8217;ll want to tweak these rules to match wherever you installed yours.</p>
<p>Now open up Lessn&#8217;s /index.php. Beneath the includes we&#8217;ll be adding a few lines to grab the token from the request uri, like so:</p>
<pre><code>include('-/config.php');
include('-/db.php');

if(!isset($_GET['token'])) {
	if(isset($_SERVER['REQUEST_URI'])) {
		$_GET['token'] = substr($_SERVER['REQUEST_URI'],
					strrpos($_SERVER['REQUEST_URI'], '/') + 1);
	}
}</code></pre>
<p>There you go: a functioning instance of Lessn on lighttpd. Enjoy.</p>
]]></content:encoded>
			<wfw:commentRss>http://evansims.com/2009/12/hack-getting-lessn-to-work-on-lighttpd/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
