<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.0.12-alpha" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
	<title>Comments on: I have seen the light</title>
	<link>http://www.lshift.net/blog/2006/12/12/i-have-seen-the-light</link>
	<description>What happens at LShift</description>
	<pubDate>Tue, 06 Jan 2009 23:20:41 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.0.12-alpha</generator>

	<item>
		<title>by: Tom Berger</title>
		<link>http://www.lshift.net/blog/2006/12/12/i-have-seen-the-light#comment-22718</link>
		<pubDate>Tue, 12 Dec 2006 23:59:53 +0000</pubDate>
		<guid>http://www.lshift.net/blog/2006/12/12/i-have-seen-the-light#comment-22718</guid>
					<description>&lt;p&gt;@matthew&lt;/p&gt;

&lt;p&gt;Interesting ... at least now we know.&lt;/p&gt;

&lt;p&gt;I hear ya about the lack of documentation, but I'm hopefull - Lighty is a relatively young project, but it's sponsored by a serious vendor and is quickly gaining adoption, so better documentation can't be that far away.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>@matthew</p>
<p>Interesting &#8230; at least now we know.</p>
<p>I hear ya about the lack of documentation, but I&#8217;m hopefull - Lighty is a relatively young project, but it&#8217;s sponsored by a serious vendor and is quickly gaining adoption, so better documentation can&#8217;t be that far away.</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: matthew</title>
		<link>http://www.lshift.net/blog/2006/12/12/i-have-seen-the-light#comment-22709</link>
		<pubDate>Tue, 12 Dec 2006 22:54:48 +0000</pubDate>
		<guid>http://www.lshift.net/blog/2006/12/12/i-have-seen-the-light#comment-22709</guid>
					<description>&lt;p&gt;@tom&lt;/p&gt;

&lt;p&gt;Within the same:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$HTTP["host"] == "blah" {
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;block, if you want to map urls to more than one separate fastcgi instance, the resulting configuration is not explained by the documentation and is fragile. Take the following working config snippet:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$HTTP["host"] == "hikij.wellquite.org" {
    server.document-root = "/home/matthew/hikijInstall/web/"

    $HTTP["url"] == "/Wiki.hs" {
        fastcgi.server = (
            "/Wiki.hs" =&#62;
              ((
                "bin-path" =&#62; "/home/matthew/hikijInstall/fcgi/Wiki.fcgi",
                "socket" =&#62; "/tmp/hikij.fcgi.socket",
                "check-local" =&#62; "disable",
                "min-procs" =&#62; 1,
                "max-procs" =&#62; 1,
              ))
        )
    }

    $HTTP["url"] == "/private/Wiki.hs" {
        fastcgi.server = (
            "/private/Wiki.hs" =&#62;
              ((
                "bin-path" =&#62; "/home/matthew/hikijInstall/fcgi/Wiki-toa-mft-ms.fcgi",
                "socket" =&#62; "/tmp/hikij-toa-mft-ms.fcgi.socket",
                "check-local" =&#62; "disable",
                "min-procs" =&#62; 1,
                "max-procs" =&#62; 1,
              ))
        )
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Now if you &lt;a href="http://trac.lighttpd.net/trac/wiki/Docs%3AModFastCGI" rel="nofollow"&gt;look at the documentation&lt;/a&gt; there is absolutely no way you'd believe that was necessary. The closest from the docs is probably:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;fastcgi.server = ( ".php" =&#62;
  (( "host" =&#62; "127.0.0.1",
     "port" =&#62; 1026,
     "bin-path" =&#62; "/usr/local/bin/php"
  )),
  ".php4" =&#62;
  (( "host" =&#62; "127.0.0.1",
     "port" =&#62; 1026
  ))
)
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Which, you might think, as it maps different extensions to different destinations, might be a suitable template. You would also, from that snipped, notice that "php" comes first and "php4" second, so clearly in converting the extension to a regexp, it's putting a $ at the end. In prefix form you might therefore expect that it puts a ^ at the start. It turns out that with enough thought, this snippet can be used as a template. For example:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;    fastcgi.server = (
        "/private/Wiki.hs" =&#62;
          ((
            "bin-path" =&#62; "/home/matthew/hikijInstall/fcgi/Wiki-toa-mft-ms.fcgi",
            "socket" =&#62; "/tmp/hikij-toa-mft-ms.fcgi.socket",
            "check-local" =&#62; "disable",
            "min-procs" =&#62; 1,
            "max-procs" =&#62; 1,
          )),

        "/Wiki.hs" =&#62;
          ((
            "bin-path" =&#62; "/home/matthew/hikijInstall/fcgi/Wiki.fcgi",
            "socket" =&#62; "/tmp/hikij.fcgi.socket",
            "check-local" =&#62; "disable",
            "min-procs" =&#62; 1,
            "max-procs" =&#62; 1,
          ))
    )
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;works fine. But reverse the order of the two stanzas and you'll only ever hit the first. The problem is that &lt;em&gt;extension&lt;/em&gt; in the documentation is nicely converted into a regexp with a $ at the end, anchoring it. But with the &lt;em&gt;prefix&lt;/em&gt; form (i.e. starting it with a '/'), there is no ^ prefixed so you get unexpected matching going on. This would be ok, if it was documented suitably. The fact that their &lt;a href="http://trac.lighttpd.net/trac/wiki/" rel="nofollow"&gt;trac wiki&lt;/a&gt; contains endless wrong links and the documentation is poor and often out of date only emphasises how much of a mess apache is in given the popularity of lighttpd. From their &lt;a href="http://trac.lighttpd.net/trac/wiki/" rel="nofollow"&gt;wiki home page&lt;/a&gt; try actually finding the fastcgi documentation...&lt;/p&gt;

&lt;p&gt;@matthias&lt;/p&gt;

&lt;p&gt;The libapache2-mod-fastcgi package is non-free and does not exist for 64-bit linux. Thus should be discounted forever more.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>@tom</p>
<p>Within the same:</p>
<pre><code>$HTTP["host"] == "blah" {
}
</code></pre>
<p>block, if you want to map urls to more than one separate fastcgi instance, the resulting configuration is not explained by the documentation and is fragile. Take the following working config snippet:</p>
<pre><code>$HTTP["host"] == "hikij.wellquite.org" {
    server.document-root = "/home/matthew/hikijInstall/web/"

    $HTTP["url"] == "/Wiki.hs" {
        fastcgi.server = (
            "/Wiki.hs" =&gt;
              ((
                "bin-path" =&gt; "/home/matthew/hikijInstall/fcgi/Wiki.fcgi",
                "socket" =&gt; "/tmp/hikij.fcgi.socket",
                "check-local" =&gt; "disable",
                "min-procs" =&gt; 1,
                "max-procs" =&gt; 1,
              ))
        )
    }

    $HTTP["url"] == "/private/Wiki.hs" {
        fastcgi.server = (
            "/private/Wiki.hs" =&gt;
              ((
                "bin-path" =&gt; "/home/matthew/hikijInstall/fcgi/Wiki-toa-mft-ms.fcgi",
                "socket" =&gt; "/tmp/hikij-toa-mft-ms.fcgi.socket",
                "check-local" =&gt; "disable",
                "min-procs" =&gt; 1,
                "max-procs" =&gt; 1,
              ))
        )
    }
}
</code></pre>
<p>Now if you <a href="http://trac.lighttpd.net/trac/wiki/Docs%3AModFastCGI" rel="nofollow">look at the documentation</a> there is absolutely no way you&#8217;d believe that was necessary. The closest from the docs is probably:</p>
<pre><code>fastcgi.server = ( ".php" =&gt;
  (( "host" =&gt; "127.0.0.1",
     "port" =&gt; 1026,
     "bin-path" =&gt; "/usr/local/bin/php"
  )),
  ".php4" =&gt;
  (( "host" =&gt; "127.0.0.1",
     "port" =&gt; 1026
  ))
)
</code></pre>
<p>Which, you might think, as it maps different extensions to different destinations, might be a suitable template. You would also, from that snipped, notice that &#8220;php&#8221; comes first and &#8220;php4&#8243; second, so clearly in converting the extension to a regexp, it&#8217;s putting a $ at the end. In prefix form you might therefore expect that it puts a ^ at the start. It turns out that with enough thought, this snippet can be used as a template. For example:</p>
<pre><code>    fastcgi.server = (
        "/private/Wiki.hs" =&gt;
          ((
            "bin-path" =&gt; "/home/matthew/hikijInstall/fcgi/Wiki-toa-mft-ms.fcgi",
            "socket" =&gt; "/tmp/hikij-toa-mft-ms.fcgi.socket",
            "check-local" =&gt; "disable",
            "min-procs" =&gt; 1,
            "max-procs" =&gt; 1,
          )),

        "/Wiki.hs" =&gt;
          ((
            "bin-path" =&gt; "/home/matthew/hikijInstall/fcgi/Wiki.fcgi",
            "socket" =&gt; "/tmp/hikij.fcgi.socket",
            "check-local" =&gt; "disable",
            "min-procs" =&gt; 1,
            "max-procs" =&gt; 1,
          ))
    )
</code></pre>
<p>works fine. But reverse the order of the two stanzas and you&#8217;ll only ever hit the first. The problem is that <em>extension</em> in the documentation is nicely converted into a regexp with a $ at the end, anchoring it. But with the <em>prefix</em> form (i.e. starting it with a &#8216;/&#8217;), there is no ^ prefixed so you get unexpected matching going on. This would be ok, if it was documented suitably. The fact that their <a href="http://trac.lighttpd.net/trac/wiki/" rel="nofollow">trac wiki</a> contains endless wrong links and the documentation is poor and often out of date only emphasises how much of a mess apache is in given the popularity of lighttpd. From their <a href="http://trac.lighttpd.net/trac/wiki/" rel="nofollow">wiki home page</a> try actually finding the fastcgi documentation&#8230;</p>
<p>@matthias</p>
<p>The libapache2-mod-fastcgi package is non-free and does not exist for 64-bit linux. Thus should be discounted forever more.</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: tom</title>
		<link>http://www.lshift.net/blog/2006/12/12/i-have-seen-the-light#comment-22707</link>
		<pubDate>Tue, 12 Dec 2006 22:12:05 +0000</pubDate>
		<guid>http://www.lshift.net/blog/2006/12/12/i-have-seen-the-light#comment-22707</guid>
					<description>&lt;p&gt;@matthew&lt;/p&gt;

&lt;p&gt;&lt;i&gt;running multiple fastcgis within the same host is one of those endless “trial and error”&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;Do you mean 'running more than one FastCGI application on the same host' or 'running multiple instances of a FastCGI application on the same host'? If the former, that's quite serious - care to elaborate? Otherwise, why would I care?&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>@matthew</p>
<p><i>running multiple fastcgis within the same host is one of those endless “trial and error”</i></p>
<p>Do you mean &#8216;running more than one FastCGI application on the same host&#8217; or &#8216;running multiple instances of a FastCGI application on the same host&#8217;? If the former, that&#8217;s quite serious - care to elaborate? Otherwise, why would I care?</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: tom</title>
		<link>http://www.lshift.net/blog/2006/12/12/i-have-seen-the-light#comment-22705</link>
		<pubDate>Tue, 12 Dec 2006 22:08:35 +0000</pubDate>
		<guid>http://www.lshift.net/blog/2006/12/12/i-have-seen-the-light#comment-22705</guid>
					<description>&lt;p&gt;@matthias&lt;/p&gt;

&lt;p&gt;Apache2's FastCGI support isn't very good. One problem I've had with it is that it doesn't report itself to be what it is, so applications that take advantage of a middleware layer must explicitly be told to behave as a FastCGI server (and can't guess it for themselves). I heard other complaints about the correctness and quality of mod-fastcgi (but nothing I ran into myself).&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>@matthias</p>
<p>Apache2&#8217;s FastCGI support isn&#8217;t very good. One problem I&#8217;ve had with it is that it doesn&#8217;t report itself to be what it is, so applications that take advantage of a middleware layer must explicitly be told to behave as a FastCGI server (and can&#8217;t guess it for themselves). I heard other complaints about the correctness and quality of mod-fastcgi (but nothing I ran into myself).</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: matthias</title>
		<link>http://www.lshift.net/blog/2006/12/12/i-have-seen-the-light#comment-22677</link>
		<pubDate>Tue, 12 Dec 2006 20:20:09 +0000</pubDate>
		<guid>http://www.lshift.net/blog/2006/12/12/i-have-seen-the-light#comment-22677</guid>
					<description>&lt;blockquote&gt;
  &lt;p&gt;FastCGI ... Apache2 doesn’t really have any good solution&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Can you elaborate? All I had to do on my debian system was to install the libapache2-mod-fastcgi package and make some minor tweaks to the apache config.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<blockquote>
<p>FastCGI &#8230; Apache2 doesn’t really have any good solution</p>
</blockquote>
<p>Can you elaborate? All I had to do on my debian system was to install the libapache2-mod-fastcgi package and make some minor tweaks to the apache config.</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: matthew</title>
		<link>http://www.lshift.net/blog/2006/12/12/i-have-seen-the-light#comment-22676</link>
		<pubDate>Tue, 12 Dec 2006 20:15:33 +0000</pubDate>
		<guid>http://www.lshift.net/blog/2006/12/12/i-have-seen-the-light#comment-22676</guid>
					<description>&lt;p&gt;Actually, I find lighttpd's fastcgi configuration quite confusing as soon as you're doing anything non-standard, for example running multiple fastcgis within the same host is one of those endless "trial and error" configurations.&lt;/p&gt;

&lt;p&gt;Also, the documentation is pretty terrible: apache has &lt;em&gt;much&lt;/em&gt; better documentation which is also much closer to being complete than lighttpd's. The reverse http proxy in lighttpd is particularly awful, only supporting http 1.0 at the last check.&lt;/p&gt;

&lt;p&gt;Having said all that, I do use lighttpd because it's lighter than apache and under 64-bit linux is pretty much the only choice for unencumbered fastcgi. Just for the record, the excellant "Pound" reverse http proxy is the best solution to that limitation of lighty, plus it can do SSL termination  which is very useful.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Actually, I find lighttpd&#8217;s fastcgi configuration quite confusing as soon as you&#8217;re doing anything non-standard, for example running multiple fastcgis within the same host is one of those endless &#8220;trial and error&#8221; configurations.</p>
<p>Also, the documentation is pretty terrible: apache has <em>much</em> better documentation which is also much closer to being complete than lighttpd&#8217;s. The reverse http proxy in lighttpd is particularly awful, only supporting http 1.0 at the last check.</p>
<p>Having said all that, I do use lighttpd because it&#8217;s lighter than apache and under 64-bit linux is pretty much the only choice for unencumbered fastcgi. Just for the record, the excellant &#8220;Pound&#8221; reverse http proxy is the best solution to that limitation of lighty, plus it can do SSL termination  which is very useful.</p>
]]></content:encoded>
				</item>
</channel>
</rss>
