<?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>Martin Ottenwaelter</title>
	<atom:link href="http://martinottenwaelter.fr/feed/" rel="self" type="application/rss+xml" />
	<link>http://martinottenwaelter.fr</link>
	<description>Just another WordPress site</description>
	<lastBuildDate>Thu, 30 Dec 2010 13:53:04 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.1</generator>
		<item>
		<title>Ruby 1.9 and the SSL error</title>
		<link>http://martinottenwaelter.fr/2010/12/ruby19-and-the-ssl-error/</link>
		<comments>http://martinottenwaelter.fr/2010/12/ruby19-and-the-ssl-error/#comments</comments>
		<pubDate>Thu, 30 Dec 2010 13:53:04 +0000</pubDate>
		<dc:creator>martin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[ssl]]></category>

		<guid isPermaLink="false">http://martinottenwaelter.fr/?p=63</guid>
		<description><![CDATA[After switching to Ruby 1.9 on Mac OS X 10.6, the following code which makes a https request to encrypted.google.com: require 'net/https' https = Net::HTTP.new('encrypted.google.com', 443) https.use_ssl = true https.verify_mode = OpenSSL::SSL::VERIFY_PEER https.request_get('/') fails with the following error: /opt/local/lib/ruby1.9/1.9.1/net/http.rb:677: in `connect': SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (OpenSSL::SSL::SSLError) The problem [...]]]></description>
			<content:encoded><![CDATA[<p>After switching to Ruby 1.9 on Mac OS X 10.6, the following code which makes a <code>https</code> request to <code>encrypted.google.com</code>:</p>
<pre>require 'net/https'
https = Net::HTTP.new('encrypted.google.com', 443)
https.use_ssl = true
https.verify_mode = OpenSSL::SSL::VERIFY_PEER
https.request_get('/')</pre>
<p>fails with the following error:</p>
<pre>/opt/local/lib/ruby1.9/1.9.1/net/http.rb:677:
  in `connect':
  SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (OpenSSL::SSL::SSLError)</pre>
<p>The problem comes from the fact that the new Ruby 1.9 installation doesn&#8217;t find the certification authority certificates (CA Certs) used to verify the authenticity of secured web servers.</p>
<p>The solution is to install the <code>curl-ca-bundle</code> port which contains the same root certificates used by Firefox:</p>
<pre>sudo port install curl-ca-bundle</pre>
<p>and tell your <code>https</code> object to use it:</p>
<pre>https.ca_file = '/opt/local/share/curl/curl-ca-bundle.crt'</pre>
<p>Note that if you want your code to run on Ubuntu, you need to set the <code>ca_path</code> attribute instead, with the default certificates location <code>/etc/ssl/certs</code>.</p>
<p>In the end, that&#8217;s what will work on both Mac OS X and Ubuntu:</p>
<pre>require 'net/https'
https = Net::HTTP.new('encrypted.google.com', 443)
https.use_ssl = true
https.verify_mode = OpenSSL::SSL::VERIFY_PEER
https.ca_path = '/etc/ssl/certs' if File.exists?('/etc/ssl/certs') # Ubuntu
https.ca_file = '/opt/local/share/curl/curl-ca-bundle.crt' if File.exists?('/opt/local/share/curl/curl-ca-bundle.crt') # Mac OS X
https.request_get('/')
</pre>
]]></content:encoded>
			<wfw:commentRss>http://martinottenwaelter.fr/2010/12/ruby19-and-the-ssl-error/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Lighttpd, MacPorts and the SSL error</title>
		<link>http://martinottenwaelter.fr/2010/08/lighttpd-macports-and-the-ssl-error/</link>
		<comments>http://martinottenwaelter.fr/2010/08/lighttpd-macports-and-the-ssl-error/#comments</comments>
		<pubDate>Thu, 05 Aug 2010 07:50:22 +0000</pubDate>
		<dc:creator>martin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[lighttpd]]></category>
		<category><![CDATA[macports]]></category>

		<guid isPermaLink="false">http://martinottenwaelter.fr/?p=45</guid>
		<description><![CDATA[After installing lighttpd on my Mac via MacPorts with the following command: sudo port install lighttpd +ssl +cml I get the following error: (network.c.529) SSL: error:00000000:lib(0):func(0):reason(0) The fix is to patch lighttpd before MacPorts compiles it: sudo port uninstall lighttpd +ssl +cml sudo port fetch lighttpd +ssl +cml sudo port -d extract lighttpd +ssl +cml [...]]]></description>
			<content:encoded><![CDATA[<p>After installing <code>lighttpd</code> on my Mac via MacPorts with the following command:</p>
<pre>sudo port install lighttpd +ssl +cml</pre>
<p>I get the following error:</p>
<pre>(network.c.529) SSL: error:00000000:lib(0):func(0):reason(0)</pre>
<p>The fix is to <a href="http://redmine.lighttpd.net/attachments/1095/08-ssl-retval-fix.patch">patch</a> lighttpd before MacPorts compiles it:</p>
<pre>
sudo port uninstall lighttpd +ssl +cml
sudo port fetch lighttpd +ssl +cml
sudo port -d extract lighttpd +ssl +cml
cd  /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_www_lighttpd/work/lighttpd-1.4.26
curl http://redmine.lighttpd.net/attachments/download/1095/08-ssl-retval-fix.patch | sudo patch -p1
cd / &#038;&#038; sudo port install lighttpd +ssl +cml</pre>
<p>The SSL error is now gone!</p>
]]></content:encoded>
			<wfw:commentRss>http://martinottenwaelter.fr/2010/08/lighttpd-macports-and-the-ssl-error/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SC.$ doesn&#8217;t support complex selectors</title>
		<link>http://martinottenwaelter.fr/2010/07/sc-dot-dollar-doesnt-support-complex-selectors/</link>
		<comments>http://martinottenwaelter.fr/2010/07/sc-dot-dollar-doesnt-support-complex-selectors/#comments</comments>
		<pubDate>Mon, 12 Jul 2010 08:46:49 +0000</pubDate>
		<dc:creator>martin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[sproutcore]]></category>

		<guid isPermaLink="false">http://martinottenwaelter.fr/?p=42</guid>
		<description><![CDATA[SC.$ doesn&#8217;t support complex selectors for performance reasons. For example, the following queries will return an empty or incorrect result set: SC.$('.foo .bar:first-child') SC.$(':empty') SC.$('foo > bar') If you don&#8217;t need your application to be compatible with IE 7 and Firefox 3.0, you can use the querySelectorAll method to overcome that limitation: MyApp.$ = function(str) [...]]]></description>
			<content:encoded><![CDATA[<p><code>SC.$</code> doesn&#8217;t support complex selectors for performance reasons. For example, the following queries will return an empty or incorrect result set:</p>
<pre>SC.$('.foo .bar:first-child')
SC.$(':empty')
SC.$('foo > bar')</pre>
<p>If you don&#8217;t need your application to be <a href="http://www.quirksmode.org/dom/w3c_core.html#gettingelements">compatible</a> with IE 7 and Firefox 3.0, you can use the <a href="http://www.w3.org/TR/selectors-api/#queryselectorall">querySelectorAll</a> method to overcome that limitation:</p>
<pre>MyApp.$ = function(str) {
  return SC.$(document.querySelectorAll(str));
}</pre>
]]></content:encoded>
			<wfw:commentRss>http://martinottenwaelter.fr/2010/07/sc-dot-dollar-doesnt-support-complex-selectors/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Capitaine Train</title>
		<link>http://martinottenwaelter.fr/2010/06/capitaine-train/</link>
		<comments>http://martinottenwaelter.fr/2010/06/capitaine-train/#comments</comments>
		<pubDate>Sun, 06 Jun 2010 11:32:40 +0000</pubDate>
		<dc:creator>martin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[capitainetrain]]></category>

		<guid isPermaLink="false">http://martinottenwaelter.fr/?p=35</guid>
		<description><![CDATA[Capitaine Train is the Internet travel agency I co-founded a year ago in Paris, France. Capitaine Train only sells train tickets and is focused on providing a great user experience with a simple yet effective SproutCore-based web application. We haven&#8217;t launched yet, but here is a preview. Stay tuned!]]></description>
			<content:encoded><![CDATA[<p><a title="Capitaine Train" href="http://www.capitainetrain.com">Capitaine Train</a> is the Internet travel agency I co-founded a year ago in Paris, France. Capitaine Train only sells train tickets and is focused on providing a great user experience with a simple yet effective SproutCore-based web application.</p>
<p>We haven&#8217;t launched yet, but here is a preview. Stay tuned!</p>
<p><video width="512" height="320" controls><br />
    <source src="http://www.capitainetrain.com/media/capitaine_train_apercu.m4v" type="video/mp4" /><br />
    <source src="http://www.capitainetrain.com/media/capitaine_train_apercu.ogv" type="video/ogg" /><br />
</video></p>
]]></content:encoded>
			<wfw:commentRss>http://martinottenwaelter.fr/2010/06/capitaine-train/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://www.capitainetrain.com/media/capitaine_train_apercu.m4v" length="1270957" type="video/mp4" />
<enclosure url="http://www.capitainetrain.com/media/capitaine_train_apercu.ogv" length="1146119" type="video/ogg" />
		</item>
		<item>
		<title>Testing and auto-generated ids in SproutCore</title>
		<link>http://martinottenwaelter.fr/2010/01/testing-and-auto-generated-ids-in-sproutcore/</link>
		<comments>http://martinottenwaelter.fr/2010/01/testing-and-auto-generated-ids-in-sproutcore/#comments</comments>
		<pubDate>Wed, 27 Jan 2010 08:55:00 +0000</pubDate>
		<dc:creator>martin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[sproutcore]]></category>

		<guid isPermaLink="false">http://martinottenwaelter.fr/post/355872976</guid>
		<description><![CDATA[If you’re trying to automate tests of your SproutCore application with Selenium, for example, you’ll realise that the HTML element ids are automatically generated. They change every now and then and break all your tests. To get rid of this problem, you can override the layerId method of certain view classes to generate a stable, [...]]]></description>
			<content:encoded><![CDATA[<p>If you’re trying to automate tests of your <a href="http://sproutcore.com">SproutCore</a> application with <a href="http://seleniumhq.org/">Selenium</a>, for example, you’ll realise that the HTML element ids are automatically generated. They change every now and then and break all your tests.</p>
<p>To get rid of this problem, you can override the <code>layerId</code> method of certain view classes to generate a stable, and human readable, id.</p>
<p>The following code takes the view hierarchy, and generates an id based on the parents’ names. For example, the <code>mainPage.mainView.someOtherView.theTargetView</code> view will be given the <code>mmsome.theTargetView</code> id.</p>
<pre>CT._ct_layerId = function() {
  var k1, k2, k3, k4, guid;

  if (!this._ct_layerId_cache) {
    guid = SC.guidFor(this);

    // Compute the new value
    k1 = this.get('keyForParentView');

    // If k1 is null, defer the computation to later...
    if (!k1) return SC.guidFor(this);

    // Finish the computation
    k2 = this.getPath('parentView.keyForParentView') || '';
    k3 = this.getPath('parentView.parentView.keyForParentView') || '';
    k4 = this.getPath('parentView.parentView.parentView.keyForParentView') || '';

    // Cache the result
    this._ct_layerId_cache = k4.substr(0,1) + k3.substr(0,1) + k2.substr(0,4) + '.' + k1;

    // If the id is already taken, fallback to guid
    if (SC.View.views[this._ct_layerId_cache]) {
      this._ct_layerId_cache = guid;

    // else, update the SC.View.views hash with the new value
    } else {
      delete SC.View.views[guid];
      SC.View.views[this._ct_layerId_cache] = this;
    }
  }

  return this._ct_layerId_cache;
}.property();

SC.View.prototype.mixin({

  keyForParentView: function() {
    var parentView = this.get('parentView'),
        key;
    for (key in parentView) {
      if (this === parentView[key]) return key;
    }
    return null;
  }.property()

});

SC.TextFieldView.prototype.mixin({
  layerId: CT._ct_layerId
});

SC.LabelView.prototype.mixin({
  layerId: CT._ct_layerId
});

SC.ImageView.prototype.mixin({
  layerId: CT._ct_layerId
});
</pre>
]]></content:encoded>
			<wfw:commentRss>http://martinottenwaelter.fr/2010/01/testing-and-auto-generated-ids-in-sproutcore/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Monkey patching SproutCore</title>
		<link>http://martinottenwaelter.fr/2009/11/monkey-patching-sproutcore/</link>
		<comments>http://martinottenwaelter.fr/2009/11/monkey-patching-sproutcore/#comments</comments>
		<pubDate>Mon, 16 Nov 2009 15:22:05 +0000</pubDate>
		<dc:creator>martin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[sproutcore]]></category>

		<guid isPermaLink="false">http://martinottenwaelter.fr/post/246077079</guid>
		<description><![CDATA[You can add or overwrite a class property using the mixin method on the class prototype. The following example dynamically adds a keyForParentView method on the SC.View class without modifying SproutCore’s source code: SC.View.prototype.mixin({ keyForParentView: function() { var parentView = this.get('parentView'), key; for (key in parentView) { if (this === parentView[key]) return key; } return [...]]]></description>
			<content:encoded><![CDATA[<p>You can add or overwrite a class property using the <code>mixin</code> method on the class <code>prototype</code>. The following example dynamically adds a <code>keyForParentView</code> method on the SC.View class without modifying SproutCore’s source code:</p>
<pre>SC.View.prototype.mixin({
  keyForParentView: function() {
    var parentView = this.get('parentView'),
        key;
    for (key in parentView) {
      if (this === parentView[key]) return key;
    }
    return null;
  }
});
</pre>
]]></content:encoded>
			<wfw:commentRss>http://martinottenwaelter.fr/2009/11/monkey-patching-sproutcore/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SC.Response and JSON</title>
		<link>http://martinottenwaelter.fr/2009/11/sc-response-and-json/</link>
		<comments>http://martinottenwaelter.fr/2009/11/sc-response-and-json/#comments</comments>
		<pubDate>Fri, 13 Nov 2009 16:15:00 +0000</pubDate>
		<dc:creator>martin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[sproutcore]]></category>

		<guid isPermaLink="false">http://martinottenwaelter.fr/post/242665340</guid>
		<description><![CDATA[SproutCore’s SC.Response was recently rewritten and I patched it to avoid an exception to be thrown when a malformed JSON string was parsed. The standard way to write your data source didFetch method is now: didFetch: function(response, params) { var results, query = params.query; if (SC.ok(response) &#038;&#038; SC.ok(results = response.get('body'))) { ... } else { [...]]]></description>
			<content:encoded><![CDATA[<p>SproutCore’s <code>SC.Response</code> was <a href="http://github.com/sproutit/sproutcore/commit/3ac172b2559e85a0a7c8a260fcf5f1dab2de9773">recently rewritten</a> and I <a href="http://github.com/sproutit/sproutcore/commit/d380ed008e0cd42b6b05e21a179a4de390550c1d">patched</a> it to avoid an exception to be thrown when a malformed JSON string was parsed. The standard way to write your data source <code>didFetch</code> method is now:</p>
<pre>didFetch: function(response, params) {
  var results, query = params.query;
  if (SC.ok(response) &#038;&#038; SC.ok(results = response.get('body'))) {
    ...
  } else {
    store.dataSourceDidErrorQuery(query);
  }
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://martinottenwaelter.fr/2009/11/sc-response-and-json/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Alternate row colors in SC.ListViews</title>
		<link>http://martinottenwaelter.fr/2009/09/alternate-row-colors-in-sc-listviews/</link>
		<comments>http://martinottenwaelter.fr/2009/09/alternate-row-colors-in-sc-listviews/#comments</comments>
		<pubDate>Tue, 01 Sep 2009 14:16:00 +0000</pubDate>
		<dc:creator>martin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[sproutcore]]></category>

		<guid isPermaLink="false">http://martinottenwaelter.fr/post/177117947</guid>
		<description><![CDATA[This post will show you how to create a SproutCore ListView with alternate row colors. Let’s add alternate row colors to the Todos tutorial’s list view. Clone the source code, then switch to the step-5 branch. It should look like this: The code that’s actually responsible for the ListView is in main_page.js:46: middleView: SC.ScrollView.design({ hasHorizontalScroller: [...]]]></description>
			<content:encoded><![CDATA[<p>This post will show you how to create a SproutCore ListView with alternate row colors.</p>
<p>Let’s add alternate row colors to the <a href="http://wiki.sproutcore.com/Todos%C2%A0Intro">Todos tutorial</a>’s list view. Clone the source code, then switch to the <code>step-5</code> branch. It should look like this:</p>
<p><img src="http://s3.amazonaws.com/ember/ATyKlpt9YbqQm9rfvjF7pEtYVDMOqY8q_o.png" alt="Todos, Step 5"/></p>
<p>The code that’s actually responsible for the ListView is in <code>main_page.js:46</code>:</p>
<pre>middleView: SC.ScrollView.design({
  hasHorizontalScroller: NO,
  layout: { top: 36, bottom: 32, left: 0, right: 0 },
  backgroundColor: 'white',
  contentView: SC.ListView.design({
    contentBinding: 'Todos.tasksController.arrangedObjects',
    selectionBinding: 'Todos.tasksController.selection',
    contentValueKey: "description",
    contentCheckboxKey: "isDone",
    canEditContent: YES,
    canReorderContent: YES,
    canDeleteContent: YES,
    destroyOnRemoval: YES,
    rowHeight: 21
  })
}),
</pre>
<p>This creates a standard list view whose rows are instances of the SC.ListItemView class. We want to customize the appearance of these rows, so we are going to subclass the SC.ListItemView class and override the <code>render</code> method:</p>
<pre>Todos.ListItemView = SC.ListItemView.extend({
  render: function(context, firstTime) {
    if (this.get('contentIndex') % 2 === 0) {
      context.addClass('even');
    } else {
      context.addClass('odd');
    }
    return sc_super();
  }
});
</pre>
<p>Let go through this code snippet step by step:</p>
<ul>
<li>
<code>Todos.ListItemView</code> is the subclass’ name</li>
<li>
<code>SC.ListItemView.extend</code> is the SproutCore syntax for subclassing</li>
<li>
<code>render: function(context, firstTime)</code> is the method defined in <code>view.js</code> that we need to override to customize the view’s appearance</li>
<li>now, we need to determine the index of the current row and add an ‘odd’ or ‘even’ css class name to the underlying HTML element
<ul>
<li>by looking at SproutCore’s source code, you’ll notice that a ListViewItem has a <code>contentIndex</code> property, which is exactly the row’s index. The property is obtained by calling the <code>get</code> method.</li>
<li>SproutCore renders things using a <code>context</code> object, instance of <code>SC.RenderContext</code>. It has an <code>addClass</code> which adds a css class name to the current HTML element.</li>
</ul>
</li>
<li>finally, we need to call the superclass’ implementation. This is done with <code>sc_super()</code>.</li>
</ul>
<p>Now, we need to tell the <code>contentView</code> that it should use the <code>Todos.ListItemView</code> class for rows. This is done by adding the following line to the <code>contentView</code>’s parameters:</p>
<pre>exampleView: Todos.ListItemView,
</pre>
<p>Finally, we need to add some css code to style the odd and even rows. Create a <code>list_item.css</code> file in your <code>english.lproj</code> folder:</p>
<pre>.sc-list-item-view.even {
  background-color: #E4E4E4;
}
</pre>
<p>Reload your browser, it should look like that:</p>
<p><img src="http://s3.amazonaws.com/ember/ReXNNrPuZ4wu8MoetPZ1KOKw4WVgFgzx_o.png" alt="Todos, with alternate row colors"/></p>
<p><strong>EDIT:</strong> As <em>nexneo</em> points out, there is a simpler way to get the current row index. I’ve replaced <code>this.owner.contentIndexForLayerId(this.layerId)</code> by <code>this.get('contentIndex')</code>. Thanks!</p>
]]></content:encoded>
			<wfw:commentRss>http://martinottenwaelter.fr/2009/09/alternate-row-colors-in-sc-listviews/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Safari AdBlock on Snow Leopard</title>
		<link>http://martinottenwaelter.fr/2009/08/safari-adblock-on-snow-leopard/</link>
		<comments>http://martinottenwaelter.fr/2009/08/safari-adblock-on-snow-leopard/#comments</comments>
		<pubDate>Thu, 27 Aug 2009 17:59:00 +0000</pubDate>
		<dc:creator>martin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[safariadblock]]></category>

		<guid isPermaLink="false">http://martinottenwaelter.fr/post/173126110</guid>
		<description><![CDATA[Safari AdBlock 0.4.0 RC3 now works on Snow Leopard. To make it work, though, you have to run Safari in 32-bit mode. To do so, select Safari.app in the Applications folder, hit ⌘-I to show the “Get Info” window, and check the “Open in 32-bit mode” checkbox: I’m looking into an alternative solution to allow [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://burgersoftware.com/safariadblock">Safari AdBlock</a> 0.4.0 RC3 now works on Snow Leopard.</p>
<p>To make it work, though, you have to run Safari in 32-bit mode. To do so, select <code>Safari.app</code> in the <code>Applications</code> folder, hit ⌘-I to show the “Get Info” window, and check the “Open in 32-bit mode” checkbox:</p>
<p><img src="http://s3.amazonaws.com/ember/tBw2fv8NuLm2fq3ImawVW1l835mnyZDT_o.png" alt="Open in 32-bit mode" title="Open in 32-bit mode"/></p>
<p>I’m looking into an alternative solution to allow Safari to run in 64-bit with AdBlock (and any InputManager) enabled.</p>
]]></content:encoded>
			<wfw:commentRss>http://martinottenwaelter.fr/2009/08/safari-adblock-on-snow-leopard/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Lighttpd, mod_magnet and MacPorts</title>
		<link>http://martinottenwaelter.fr/2009/08/lighttpd-mod_magnet-and-macports/</link>
		<comments>http://martinottenwaelter.fr/2009/08/lighttpd-mod_magnet-and-macports/#comments</comments>
		<pubDate>Sun, 16 Aug 2009 10:37:00 +0000</pubDate>
		<dc:creator>martin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[lighttpd]]></category>
		<category><![CDATA[macports]]></category>

		<guid isPermaLink="false">http://martinottenwaelter.fr/post/164088284</guid>
		<description><![CDATA[I installed lighttpd with MacPorts using the usual command sudo port install lighttpd But when I try to start it with a custom configuration file, I get the following error: (plugin.c.213) mod_magnet plugin init failed (server.c.614) loading plugins finally failed It looks like the default MacPorts installation didn’t install everything needed for mod_magnet to work. [...]]]></description>
			<content:encoded><![CDATA[<p>I installed <a href="http://www.lighttpd.net/">lighttpd</a> with <a href="http://www.macports.org/">MacPorts</a> using the usual command</p>
<pre>sudo port install lighttpd
</pre>
<p>But when I try to start it with a custom configuration file, I get the following error:</p>
<pre>(plugin.c.213) mod_magnet plugin init failed
(server.c.614) loading plugins finally failed
</pre>
<p>It looks like the default MacPorts installation didn’t install everything needed for <code>mod_magnet</code> to work. Ports actually come in different flavours called <a href="http://guide.macports.org/#using.variants"><em>variants</em></a>. You can either do</p>
<pre>port variants lighttpd
</pre>
<p>to see the different variants of a port, or directly read <a href="http://trac.macports.org/browser/trunk/dports/www/lighttpd/Portfile">lighttpd’s portfile</a> which has more info in it. You see on line 85 that the <code>cml</code> variant builds lighttpd with lua, which is the scripting language used by mod_magnet:</p>
<pre>variant cml {
    depends_lib-append   port:lua \
                         port:libmemcache \
                         port:memcached \
                         port:pkgconfig

     configure.args-append --with-lua \
                           --with-memcache
}
</pre>
<p>The <code>cml</code> variant is probably just what we need. While we’re at it, we are also going to add ssl support to our lighttpd installation.</p>
<p>Now, we first need to remove the previous installation</p>
<pre>sudo port uninstall lighttpd
</pre>
<p>then do the new installation with the <code>cml</code> and <code>ssl</code> variants:</p>
<pre>sudo port install lighttpd +cml +ssl
</pre>
<p>Lighttpd now starts without any error.</p>
]]></content:encoded>
			<wfw:commentRss>http://martinottenwaelter.fr/2009/08/lighttpd-mod_magnet-and-macports/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/


Served from: martinottenwaelter.fr @ 2012-05-18 23:29:29 -->
