<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="/stylesheets/rss.css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>lighty's life: Tag lighttpd</title>
    <link>http://blog.lighttpd.net/articles/tag/lighttpd</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description></description>
    <item>
      <title>Growing the team</title>
      <description>The dev team has gotten some new members recently that you might not know of. Here&amp;#8217;s a heads up (in alphabetical order):
	&lt;ul&gt;
	&lt;li&gt;hoffie&lt;/li&gt;
		&lt;li&gt;icy&lt;/li&gt;
		&lt;li&gt;nitrox&lt;/li&gt;
		&lt;li&gt;stbuehler&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;If you hang out in #lighttpd, you will already know these names.&lt;/p&gt;


	&lt;p&gt;That being said, there is also some news about the state of the development of lighty.&lt;/p&gt;


	&lt;p&gt;Lighty is a great webserver and we all love it. But if you use it for quite some time, you&amp;#8217;ll eventually find out that it&amp;#8217;s not perfect. There are some oddities and shortcomings that cannot be ironed out without rewriting a significant part of the core.&lt;/p&gt;


	&lt;p&gt;This is where I had the idea to start all over.
With lessons learned from the past, we could write a new version of lighty that fixes the design issues the current versions have. But at the same time keep all the good stuff and remain fairly compatible.
The main idea to be fast and lightweight is still valid and if you are familiar with 1.4.x or 1.5, you will have no problems with the new version.&lt;/p&gt;


	&lt;p&gt;Jan had the idea to use glib for stuff like strings/buffers and arrays. He wanted to rewrite the corresponding parts and did so in a branch of his.
I proposed to take this even further and use glib throughout the source. It makes coding easier, faster and in the end more secure because you can rely on proven and well tested source.&lt;/p&gt;


	&lt;p&gt;stbuehler jumped in and created a new branch where he started to hack on an all new lighty using the ideas from above. The following days we discussed a lot &amp;#8211; and still do so &amp;#8211; about the new design. What we could do better, what shortcomings we wanted to fix.&lt;/p&gt;


	&lt;p&gt;The result is nothing less but a more flexible and faster design for lighty.&lt;/p&gt;


	&lt;p&gt;This sounds awesome but where is the catch you might think.
Well, currently we have not too much code ready but we are actively hacking on it. Do not ask when it will be released, there is no estimated date. We are still at the very beginning of the new version but hope to have it some day become the official Lighttpd 2.0&lt;/p&gt;


	&lt;p&gt;We created a &lt;a href="http://redmine.stbuehler.de/wiki/lighttpd-sandbox/Plans_for_2_0"&gt;page&lt;/a&gt; that lists some of the (technical) plans we currently have. You might find some of them interesting.&lt;/p&gt;


	&lt;p&gt;This is it for today folks. Hope you like the route we are taking and maybe drop us a line in #lighttpd (freenode) or in the comments.&lt;/p&gt;
</description>
      <pubDate>Wed, 23 Jul 2008 14:43:00 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:530e6f8c-284b-41a6-b5f1-00639abb707d</guid>
      <author>icy</author>
      <link>http://blog.lighttpd.net/articles/2008/07/23/a-new-beginning</link>
      <category>lighttpd</category>
      <category>lighttpd</category>
      <category>2.0</category>
      <category>lighty</category>
      <trackback:ping>http://blog.lighttpd.net/articles/trackback/5428</trackback:ping>
    </item>
    <item>
      <title>1.4.12 becomes 1.5.0</title>
      <description>&lt;p&gt;moo poked me today and was so right: &amp;#8220;With all the changes going into &lt;span class="caps"&gt;SVN&lt;/span&gt; we shouldn&amp;#8217;t call the next release 1.4.12, but 1.5.0&amp;#8221;. Lifting the restriction on &amp;#8216;try to stay compatible to the 1.4.x plugin-API I started right away on ripping the internals apart and put them together sliglty different.&lt;/p&gt;


	&lt;p&gt;If you are developing a plugin for 1.4.x right now, be asured that it won&amp;#8217;t work without changes in 1.5.0. Let me explain what is changing.&lt;/p&gt;
&lt;p&gt;The major change for the plugin developers are 3 or 4 things:&lt;/p&gt;


	&lt;ol&gt;
	&lt;li&gt;the fdevent-handling interface is simpler now and hides the nasty details. You only provide a iosocket&lt;/li&gt;
		&lt;li&gt;chunkqueues everywhere and no direct call to &lt;kbd&gt;write()&lt;/kbd&gt; or &lt;kbd&gt;read()&lt;/kbd&gt; on a socket. This is all done through the &lt;kbd&gt;network_*&lt;/kbd&gt; interface. You don&amp;#8217;t have to care about platform dependent functions.&lt;/li&gt;
		&lt;li&gt;there is a lemon-based &lt;span class="caps"&gt;HTTP&lt;/span&gt;-Response parser (see mod_proxy_core)&lt;/li&gt;
		&lt;li&gt;&lt;kbd&gt;TRACE ( )&lt;/kbd&gt; and &lt;kbd&gt;ERROR ( )&lt;/kbd&gt; instead of &lt;kbd&gt;log_error_write(...)&lt;/kbd&gt;&lt;/li&gt;
	&lt;/ol&gt;


	&lt;p&gt;All this is in &lt;span class="caps"&gt;SVN&lt;/span&gt; already. Some other changes are coming up right now and are mostly around the central state-engine and how a request is steps through the server. Currently we have these steps:&lt;/p&gt;


	&lt;ol&gt;
	&lt;li&gt;accept connection&lt;/li&gt;
		&lt;li&gt;read request header + request content&lt;/li&gt;
		&lt;li&gt;call backend and send all the data&lt;/li&gt;
		&lt;li&gt;read backend response and prepare response header&lt;/li&gt;
		&lt;li&gt;send response to the client&lt;/li&gt;
		&lt;li&gt;on keep-alive go to 2, otherwise close the connection&lt;/li&gt;
	&lt;/ol&gt;


	&lt;p&gt;What I currently implement is slightly different:&lt;/p&gt;


	&lt;ol&gt;
	&lt;li&gt;accept connection&lt;/li&gt;
		&lt;li&gt;read the request header&lt;/li&gt;
		&lt;li&gt;set up the request-handling filter-chain&lt;/li&gt;
		&lt;li&gt;forward request content to the backend&lt;/li&gt;
		&lt;li&gt;read the backend response header&lt;/li&gt;
		&lt;li&gt;set up the the response-handling filter-chain&lt;/li&gt;
		&lt;li&gt;forward the response content to the client&lt;/li&gt;
		&lt;li&gt;on keep-alive go to 2 otherwise close the connection&lt;/li&gt;
	&lt;/ol&gt;


	&lt;p&gt;This follows a simple idea: &amp;#8216;After parsing the &lt;span class="caps"&gt;HTTP&lt;/span&gt;-headers you have all the information on how you want to continue to handle the request.&amp;#8217; All plugins will get called and can hook into the filter-chain.&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;mod_uploadprogress will hook into the request-filter-chain to track to progress of connections&lt;/li&gt;
		&lt;li&gt;mod_deflate will replace content in the response-filter-chain&lt;/li&gt;
		&lt;li&gt;mod_demux will split a proxy-response into multiple client responses&lt;/li&gt;
		&lt;li&gt;mod_http_chunking will provide generic &lt;span class="caps"&gt;HTTP&lt;/span&gt;/1.1 chunking&lt;/li&gt;
	&lt;/ul&gt;


It will be left to backend when they want to make the connection to the backend: 
	&lt;ul&gt;
	&lt;li&gt;when they have the request header&lt;/li&gt;
		&lt;li&gt;when they have a part of the request-content (POST body)&lt;/li&gt;
		&lt;li&gt;when they have the full request-content as now&lt;/li&gt;
	&lt;/ul&gt;


&lt;h3&gt;What else will change ?&lt;/h3&gt;

	&lt;ul&gt;
	&lt;li&gt;the hand-written &lt;span class="caps"&gt;HTTP&lt;/span&gt;-request parser will get kicked out in favour of a lemon based one. We already have one for the &lt;span class="caps"&gt;HTTP&lt;/span&gt;-responses and can use most of its code.&lt;/li&gt;
	&lt;/ul&gt;</description>
      <pubDate>Wed, 26 Jul 2006 22:41:00 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:a5feccfb-59d2-40e3-8be0-4b5d683143e0</guid>
      <author>jan</author>
      <link>http://blog.lighttpd.net/articles/2006/07/26/1-4-12-becomes-1-5-0</link>
      <category>lighttpd</category>
      <trackback:ping>http://blog.lighttpd.net/articles/trackback/1850</trackback:ping>
    </item>
    <item>
      <title>lighttpd unleashed - part two</title>
      <description>&lt;p&gt;The big thing of lighttpd 1.4.0 were the nested conditionals, but how can they be used ? And what are includes ?&lt;/p&gt;
&lt;p&gt;A example for nested confitionals went already into the announcement:&lt;/p&gt;


&lt;pre&gt;
$HTTP["host"] == "www.example.org" {
  $HTTP["url"] =~ "^/dav($|/)" {
    webdav.activate = "enable" 
  }
  $HTTP["remoteip"] != "10.0.0.0/16" {
    auth.require = ( "" =&amp;gt; ( "method" =&amp;gt; "basic",
                             "realm" =&amp;gt; "webdav",
                             "require" =&amp;gt; "valid-user" ) )
  }
}
&lt;/pre&gt;

	&lt;p&gt;But what are includes for ? For a start we want to go the mass-hosting way and want to create a generic pattern for virtual hosts without using mod_simple_vhost or similar modules.&lt;/p&gt;


	&lt;p&gt;We have a simple webserver structure:&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;all servers are under /var/www/servers/&lt;/li&gt;
		&lt;li&gt;the part is the hostname of the server&lt;/li&gt;
		&lt;li&gt;and logs and public files are at logs/ and pages/&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;resulting in &lt;code&gt;/var/www/servers/www.example.org/pages/&lt;/code&gt;.&lt;/p&gt;


	&lt;p&gt;In lighttpd 1.3.x you had to copy the conditionals for all host including all the options. There was no way to do some interpretation of the config file.&lt;/p&gt;


	&lt;p&gt;In lighttpd 1.4.0 this has changed and we can use expressions and includes:&lt;/p&gt;


&lt;pre&gt;
server.document-root = "/tmp" 
server.port = 1025

server.modules = ( "mod_access" )

access.deny = ( "~", ".inc" )

$HTTP["host"] == "www.example.org" {
  var.hostname = "www.example.org" 
  include "baseconfig.conf" 
}

$HTTP["host"] == "www2.example.org" {
  var.hostname = "www2.example.org" 
  include "baseconfig.conf" 
}
&lt;/pre&gt;

	&lt;p&gt;and a baseconfig.conf&lt;/p&gt;


&lt;pre&gt;
server.document-root = "/var/www/servers/" + hostname + "/pages/" 
access.logfile = "/var/www/servers/" + hostname + "/logs/accesslog" 
&lt;/pre&gt;

	&lt;p&gt;With &lt;code&gt;var.hostname&lt;/code&gt; you can set a user-variable in the configuration which can be used everywhere in the config to pass data around. We use it here to substiture the parts of the baseconfig for each host and set the document-root and the location of the accesslog for each host.&lt;/p&gt;


	&lt;p&gt;But how does the config look like that is used by lighttpd ? The option &lt;code&gt;-p&lt;/code&gt; will tell us:&lt;/p&gt;


&lt;pre&gt;
$ /lighttpd -p -f ./lighttpd-includes.conf
config {
    server.document-root = "/tmp" 
    server.port          = 1025
    server.modules       = ("mod_indexfile", "mod_access", "mod_dirlisting", "mod_staticfile")
    access.deny          = ("~", ".inc")

    $HTTP["host"] == "www.example.org" {
        # block 1
        var.hostname         = "www.example.org" 
        server.document-root = "/var/www/servers/www.example.org/pages/" 
        access.logfile       = "/var/www/servers/www.example.org/logs/accesslog" 

    } # end of $HTTP["host"] == "www.example.org" 

    $HTTP["host"] == "www2.example.org" {
        # block 2
        var.hostname         = "www2.example.org" 
        server.document-root = "/var/www/servers/www2.example.org/pages/" 
        access.logfile       = "/var/www/servers/www2.example.org/logs/accesslog" 

    } # end of $HTTP["host"] == "www2.example.org" 
}
&lt;/pre&gt;

	&lt;p&gt;Nice, isn&amp;#8217;t it ? :)&lt;/p&gt;</description>
      <pubDate>Wed, 24 Aug 2005 09:24:00 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:3c9ab0d9f35165920c5de806b90f0ab1</guid>
      <author>jan</author>
      <link>http://blog.lighttpd.net/articles/2005/08/24/lighttpd-unleashed-part-two</link>
      <category>lighttpd</category>
      <category>lighttpd</category>
      <category>nested</category>
      <category>conditionals</category>
      <category>configuration</category>
      <trackback:ping>http://blog.lighttpd.net/articles/trackback/16</trackback:ping>
    </item>
  </channel>
</rss>
