<?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: advanced configuration in up upcoming 1.4.x</title>
    <link>http://blog.lighttpd.net/articles/2005/05/07/advanced-configuration-in-up-upcoming-1-4-x</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description></description>
    <item>
      <title>advanced configuration in up upcoming 1.4.x</title>
      <description>&lt;p&gt;i&amp;#8217;m moo, new to lighttpd&lt;/p&gt;


	&lt;p&gt;As many of you might ask: &amp;#8220;how do i write cond1 &lt;span class="caps"&gt;AND&lt;/span&gt; cond2&amp;#8221;. we have the answer in 1.4&lt;/p&gt;


	&lt;p&gt;i focused on the configuration of the upcoming lighttpd1.4. i made many improvements to her.&lt;/p&gt;


One of the most noticeable change is nesting and chaining, as you might already known as &amp;#8220;and&amp;#8221; / &amp;#8220;else&amp;#8221;:
&lt;pre&gt;
cond_a {
  cond_b {
  }
}
else cond_c {
}
&lt;/pre&gt;
cond_b will match only if cond_a match first, and cond_c will not match if cond_a match first. the order the condition checked/patched is same as other programming language, c, perl, php etc.

also, &amp;#8220;user-defined&amp;#8221; variable and &amp;#8220;include&amp;#8221; is impemented. if you used to copy/paste many of your config for each vhost, u can now put them into a sub config file, and even use the variable:
&lt;pre&gt;
. in lighttpd.conf
$HTTP["host"] == "t1.lighttpd.net"{
  var.name="t1" 
  include "myvhost.conf" 
}
$HTTP["host"] == "t2.lighttpd.net"{
  var.name="t2" 
  include "myvhost.conf" 
}
. in myvhost.conf
server.name = var.name + ".lighttpd.net" 
server.document-root = "/mydocroot/" + var.name + "/public_html/" 
&lt;/pre&gt;

	&lt;p&gt;you can also use config values such as server.name + &amp;#8221;/...&amp;#8221;, and even use env.* to get &lt;a herf="http://trac.lighttpd.net/trac/ticket/20"&gt;environment variable&lt;/a&gt;&lt;/p&gt;


i&amp;#8217;ve also implemented(but not commited yet) &amp;#8220;include_shell&amp;#8221;, which parse the output of  program which convert some on the fly. for example:
&lt;pre&gt;
include "mysub.conf" 
# compare the above line to the following
include_shell "/usr/bin/convmimetype /etc/mime.types" 
# same as mime.assign = array(...)
&lt;/pre&gt;

	&lt;p&gt;notice the above is all at config parsing time(when loading config), so no performance lost. runtime variable isn&amp;#8217;t implemented yet. i have no idea how it should be implemented exactly, nor do i know how to avoid hurting performance.&lt;/p&gt;


	&lt;p&gt;there are more, optimization for runtime condition checking, pcre_study speed up for regex matching, new command line options(check with -h).&lt;/p&gt;


	&lt;p&gt;&lt;span class="caps"&gt;FIY&lt;/span&gt;, before i implement these things. i myself use m4, a macro language to write the config. it&amp;#8217;s powerful but ugly and dirty, and is just a brain dead game. i can use variable/include in m4, but not output &amp;#8220;else&amp;#8221; &amp;#8220;and&amp;#8221;. but i can now do all what i needed in lighttpd alone without m4.&lt;/p&gt;


	&lt;p&gt;check news when 1.4 is out, or check svn :)&lt;/p&gt;
</description>
      <pubDate>Sat, 07 May 2005 13:07:00 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:5b9b0779fba4296e991ae7e1339cddd8</guid>
      <author>moo</author>
      <link>http://blog.lighttpd.net/articles/2005/05/07/advanced-configuration-in-up-upcoming-1-4-x</link>
      <trackback:ping>http://blog.lighttpd.net/articles/trackback/4</trackback:ping>
    </item>
    <item>
      <title>"advanced configuration in up upcoming 1.4.x" by free cingular cell phone ringtone</title>
      <description>Beauty ringtones for you!</description>
      <pubDate>Sun, 18 Jun 2006 15:51:52 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:431dbbbf-3641-4cbc-b0f4-f753feb8844c</guid>
      <link>http://blog.lighttpd.net/articles/2005/05/07/advanced-configuration-in-up-upcoming-1-4-x#comment-1589</link>
    </item>
    <item>
      <title>"advanced configuration in up upcoming 1.4.x" by Michele</title>
      <description>Very useful! good job guy.</description>
      <pubDate>Fri, 16 Jun 2006 12:01:50 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:71b9f2cc-e330-46f6-9a56-7fd5a72b7ff0</guid>
      <link>http://blog.lighttpd.net/articles/2005/05/07/advanced-configuration-in-up-upcoming-1-4-x#comment-1455</link>
    </item>
  </channel>
</rss>
