<?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>Code Penguin &#187; Sysadmin</title>
	<atom:link href="http://laurent.bachelier.name/category/sysadmin/feed/" rel="self" type="application/rss+xml" />
	<link>http://laurent.bachelier.name</link>
	<description>Musings on software, internet and technology by Laurent Bachelier</description>
	<lastBuildDate>Sat, 07 Aug 2010 18:02:46 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>chmod 777 is evil</title>
		<link>http://laurent.bachelier.name/2010/07/chmod-777-is-evil/</link>
		<comments>http://laurent.bachelier.name/2010/07/chmod-777-is-evil/#comments</comments>
		<pubDate>Thu, 22 Jul 2010 08:07:20 +0000</pubDate>
		<dc:creator>Laurent</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Symfony]]></category>
		<category><![CDATA[Sysadmin]]></category>

		<guid isPermaLink="false">http://laurent.bachelier.name/?p=131</guid>
		<description><![CDATA[Well, chmod 666 is the true evil obviously, but people who use the chmod 777 trick really don't want to bother with the different signification of x for files and folders, so they mark all files as executables. This makes ls in my terminal quite ugly, and is what motivated me to write yet another [...]]]></description>
			<content:encoded><![CDATA[<div class='microid-mailto+http:sha1:5a49026651bd08aa4e816c1360225ee63973fc01'><p>Well, chmod 666 is the true evil obviously, but people who use the <em>chmod 777 trick</em> really don't want to bother with the different signification of <code>x</code> for files and folders, so they mark all files as executables. This makes <code>ls</code> in my terminal quite ugly, and is what motivated me to write yet another rant!</p>
<p>Traditionally, the web server runs with a special, underprivileged user. Now, this is totally fine — I'll get back to that later. However, when a developer starts a project, he naturally does it with his own account. This is fine, too. When he wants to test it, he installs a web server (let's say Apache and mod_php<sup><a href="http://laurent.bachelier.name/2010/07/chmod-777-is-evil/#footnote_0_131" id="identifier_0_131" class="footnote-link footnote-identifier-link" title="I don&#039;t like much both of them, but more on that later">1</a></sup>), and tells the web server to use the project directory. However, the web server's user can't read, or at least can't write in the directory. And here, our web developers asking for help gets recommended to "chmod 777". Symfony even has a command for doing it, and it is a real shame.</p>
<p>It will work. It will also make an ugly git commit, and an ugly <code>ls</code>. Il will create files owned by the web server, and the developer is likely to use <code>sudo</code> before every command to work around the problems that will ensue, and it just gets insane.</p>
<p>Separation of privileges is what makes UNIX systems great. Let's understand them and use them, please.</p>
<p>The obvious solution here is to run your development server under the development user. There is no need to separate when it's for your own usage. There is a even better solution, embraced by almost every language but PHP: a way to start a web server on demand. I believe it was started by Ruby on Rails with WEBrick, and now every non-PHP framework has it. Python, by using <a href="http://en.wikipedia.org/wiki/Web_Server_Gateway_Interface">WSGI</a> makes it very easy. I simulated this feature for Symfony by writing <a href="http://laurent.bachelier.name/2010/05/reducing-the-gap-between-symfony-and-non-php-frameworks/">symfttpd</a>. It's actually simpler for the developer as there is no configuration or installation at all.</p>
<p>Enough about developers; it's not their job to setup daemons and manage UNIX systems. Let's talk about the real accomplices of the Devil: system administrators.</p>
<p>Yes, there are system administrators that don't use permissions properly. And they are legion. I've seen horrors, up to "sudo svn up" on the production server, because half the files ended being owned by root. And then "chmod 777" on millions of files.</p>
<p>There are many solutions there; group inheritance with the <a href="http://en.wikipedia.org/wiki/Setuid#setuid_and_setgid_on_directories">setgid bit</a>, forcing the users to <code>su</code> as the web server user, or a deployment script (I've used the three of them for different situations).</p>
<p>Why is this important? Because it is often useful to separate users (one should not have access to the other's projects in reading or writing), or to separate projects for security (one hacked project should not give access to the others).</p>
<p>I've seen it… done wrong:</p>
<ul>
<li>safe_mode for PHP. It doesn't work and will disappear in newer versions anyway.</li>
<li>Only allowing FTP access to users, who can still upload a PHP script which will have access to everything (if run through the web server). Oh, and FTP sucks. Same issue with SSH and chroot.</li>
<li>Add the users to the <em>group</em> the web server is running as. Allows SSH access. Nice, but the PHP script trick will, again, defeat it.</li>
</ul>
<p>There is only one solution: use the "group" solution, but run a different PHP instance for each user. It is quite rarely used because the convenience of <em>Apache</em> and <em>mod_php</em>. But running PHP in the same <em>process</em> as the web server feels quite dangerous for me too. I think <em>mod_php</em> is an abomination.</p>
<p>I've done it for years with <em>Lighttpd</em>, <em>PHP</em> and <em>FastCGI</em> with a few alterations to Gentoo's <code>spawn-fgci</code> init script (which is now able to handle multiple configurations without any alteration since a few months). My setup is very similar to <a href="http://redmine.lighttpd.net/wiki/lighttpd/HowToSetupFastCgiIndividualPermissions">that one</a>.</p>
<p>Note that while I mention PHP, this issue is not strictly related to PHP, yet seems widespread in PHP communities.</p>
<ol class="footnotes">
<li id="footnote_0_131" class="footnote">I don't like much both of them, but more on that later</li>
</ol>
</div>]]></content:encoded>
			<wfw:commentRss>http://laurent.bachelier.name/2010/07/chmod-777-is-evil/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Reducing the gap between Symfony and non-PHP frameworks</title>
		<link>http://laurent.bachelier.name/2010/05/reducing-the-gap-between-symfony-and-non-php-frameworks/</link>
		<comments>http://laurent.bachelier.name/2010/05/reducing-the-gap-between-symfony-and-non-php-frameworks/#comments</comments>
		<pubDate>Sun, 23 May 2010 23:01:09 +0000</pubDate>
		<dc:creator>Laurent</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Symfony]]></category>
		<category><![CDATA[Sysadmin]]></category>
		<category><![CDATA[configuration]]></category>
		<category><![CDATA[installation]]></category>
		<category><![CDATA[lighttpd]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[symbolic links]]></category>
		<category><![CDATA[symfttpd]]></category>

		<guid isPermaLink="false">http://laurent.bachelier.name/?p=172</guid>
		<description><![CDATA[Something that always annoyed me is how tedious it is to install a Symfony project on a machine. Since I frequently need to intervene quickly on a project for work, and I was getting a brand-new machine, I really didn't want to create an apache vhost (let alone install Apache: it's painfully slow and its [...]]]></description>
			<content:encoded><![CDATA[<div class='microid-mailto+http:sha1:dff9fd37718ad21821c464daf7fe8459d14517f6'><p>Something that always annoyed me is how tedious it is to install a Symfony project on a machine. Since I frequently need to intervene quickly on a project for work, and I was getting a brand-new machine, I really didn't want to create an apache <em>vhost</em> (let alone install Apache: it's painfully slow and its configuration is obscure and hard to debug), edit my <code>/etc/hosts</code> file, etc. for each project.</p>
<p>Moreover, developers are not system administrators and should not have to do complicated setups, especially when it turns out to be badly set up, and problems are "resolved" by "chmod 777" or "chmod 666" (which is indeed <a href="http://wordpress.org/development/2010/04/file-permissions/">evil</a>), a very sad but true practice promoted even by the developers of Symfony since there is a <code>symfony fix-perms</code><code> command that basically does that. It should have been named </code><code>symfony break-perms</code> or <code>symfony please-make-things-insecure-i-want-to-go-back-to-windows</code> or never been made.</p>
<p>On most non-PHP frameworks, there is a small embedded webserver that you can run on-demand. <strong>No configuration needed.</strong> Moreover, no special rights needed: a simple user can start it.</p>
<p>Since there was no such webserver written in PHP that was able to run Symfony properly, I chose to auto-configure <a href="http://www.lighttpd.net/">lighttpd</a> with a simple tool called <em>symfttpd</em>. The <code>genconf</code> tool was born.</p>
<p>However, I encountered another issue I didn't think of before: for each project, I had to <strong>create symbolic links</strong> to the Symfony source code (another practice of the Symfony community, and there is no proper alternative in the PHP world). Hence, I created <code>mksymlinks</code>. For the developer, it is very simple to use: configure once on the machine, once per project, and that's it.</p>
<p><code>genconf</code> only generates a configuration, which is still very practical for a system administrator; moreover it is flexible and well-tested. But it still required the develop to configure something, and there still was the rights problem.</p>
<p>Hence I created <code>spawn</code> which handles <strong>starting and stopping the webserver, just like non-PHP frameworks do</strong>. As a nice addition, it keeps server and PHP logs in the <code>log</code>folder of the project.</p>
<p><em>symfttpd</em> has even more uses; one I didn't think of at first was that it can automate the installation of a project on a continuous integration platform, and can start a webserver for functional testing (both are used daily at work).</p>
<p>One of the most important aspects of <em>symfttpd</em> is that <strong>all tools are independent</strong>: you can use only <code>mksymlinks</code> or <code>genconf</code> (though <code>spawn</code> more or less requires the use of both, it isn't set in stone). A system administrator will find use in <code>mksymlinks</code> and <code>genconf</code>, and a developer more in <code>mksymlinks</code> and <code>spawn</code>.</p>
<p>You'll find extensive documentation on the <a href="http://github.com/laurentb/symfttpd">project page</a>; what will follow is a quick tutorial for developers.</p>
<p><!-- more --></p>
<p><strong>Install the necessary packages:</strong></p>
<pre class="bash">&nbsp;
<span style="color: #808080; font-style: italic;"># Debian/Ubuntu</span>
aptitude <span style="color: #c20cb9; font-weight: bold;">install</span> php5-cgi php5-cli lighttpd
&nbsp;
<span style="color: #808080; font-style: italic;"># Gentoo</span>
emerge php <span style="color: #808080; font-style: italic;"># with <span style="color: #007800;">USE=</span></span><span style="color: #ff0000;">&quot;cli cgi&quot;</span>
emerge lighttpd <span style="color: #808080; font-style: italic;"># with <span style="color: #007800;">USE=</span></span><span style="color: #ff0000;">&quot;fastcgi&quot;</span>
&nbsp;
<span style="color: #808080; font-style: italic;"># Macports</span>
port <span style="color: #c20cb9; font-weight: bold;">install</span> php5 +fastcgi &amp;&amp; port <span style="color: #c20cb9; font-weight: bold;">install</span> lighttpd
&nbsp;
<span style="color: #808080; font-style: italic;"># Windows</span>
Nice try.
&nbsp;</pre>
<p><strong>Get the symfttpd source code:</strong></p>
<pre class="bash">&nbsp;
<span style="color: #7a0874; font-weight: bold;">cd</span> &amp;&amp; git clone git://github.com/laurentb/symfttpd.git
&nbsp;</pre>
<p>There are also archives you can download <a href="http://github.com/laurentb/symfttpd/downloads">here</a> if you want to avoid <em>git</em> or bleeding-edge changes.</p>
<p><strong>Basic configuration:</strong></p>
<pre class="bash">&nbsp;
<span style="color: #808080; font-style: italic;"># notice the dot before symfftpd.conf.php</span>
<span style="color: #007800;">$EDITOR</span> ~/.symfftpd.conf.php
&nbsp;</pre>
<p>Enter something like that:</p>
<pre class="php">&nbsp;
<span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #0000ff;">$options</span><span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">'sf_path'</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">'1.0'</span><span style="color: #66cc66;">&#93;</span> = <span style="color: #ff0000;">'/home/myuser/symfony/1.0'</span>;
<span style="color: #0000ff;">$options</span><span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">'sf_path'</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">'1.4'</span><span style="color: #66cc66;">&#93;</span> = <span style="color: #ff0000;">'/home/myuser/symfony/1.4'</span>;
&nbsp;</pre>
<p>Of course, you have to have to adapt it to the Symfony versions you have installed and where you put them.</p>
<p><strong>Configure the project:</strong><br />
If the project is using Symfony 1.4 in the <code>lib/vendor/symfony</code>, you don't need to do anything. In case it is different, or to be on the safe side, create the file 	<code>config/symfttpd.conf.php</code> in your project. After, add the file to your project's version control repository. If you're lucky, someone already did it for you.</p>
</pre>
<pre class="bash">&nbsp;
<span style="color: #7a0874; font-weight: bold;">cd</span> ~/myproject
<span style="color: #808080; font-style: italic;"># this <span style="color: #000000; font-weight: bold;">time</span>, no dot</span>
<span style="color: #007800;">$EDITOR</span> config/symfttpd.conf.php
&nbsp;</pre>
<pre class="php">&nbsp;
<span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #0000ff;">$options</span><span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">'want'</span><span style="color: #66cc66;">&#93;</span> = <span style="color: #ff0000;">'1.3'</span>; <span style="color: #808080; font-style: italic;">// The version of Symfony used by your project</span>
<span style="color: #0000ff;">$options</span><span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">'lib_symlink'</span><span style="color: #66cc66;">&#93;</span> = <span style="color: #ff0000;">'lib/vendor/symfony'</span>; <span style="color: #808080; font-style: italic;">// lib/vendor/symfony will lead to the &quot;lib&quot; directory of Symfony</span>
&nbsp;</pre>
</pre>
<pre class="bash">&nbsp;
~/symfttpd/mksymlinks
&nbsp;</pre>
<p>You're done.<br />
It will <strong>create symbolic links for plugins</strong> too, even if the version of Symfony (1.0 for instance) doesn't handle them!</p>
<p>To start the server:</p>
<pre class="bash">&nbsp;
~/symfttpd/spawn
&nbsp;</pre>
<p>It will then tell you how to access it. It's time to stop fighting with old, unpredictable software like Apache and start developing again!</p>
<p><strong>What's coming in future releases:</strong></p>
<ul>
<li>Colors</li>
<li>Interactive configuration</li>
<li>Server/PHP logs displayed in the terminal</li>
<li>Handling "sample" files</li>
<li>Custom configuration support on various places</li>
</ul>
<p>Contributors are welcome.</p>
</div>]]></content:encoded>
			<wfw:commentRss>http://laurent.bachelier.name/2010/05/reducing-the-gap-between-symfony-and-non-php-frameworks/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Symfony and lighttpd</title>
		<link>http://laurent.bachelier.name/2009/04/symfony-and-lighttpd/</link>
		<comments>http://laurent.bachelier.name/2009/04/symfony-and-lighttpd/#comments</comments>
		<pubDate>Sun, 12 Apr 2009 19:29:24 +0000</pubDate>
		<dc:creator>Laurent</dc:creator>
				<category><![CDATA[Symfony]]></category>
		<category><![CDATA[Sysadmin]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[lighttpd]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://laurent.bachelier.name/?p=92</guid>
		<description><![CDATA[Update: I have written a tool than can generate automatically the proper configuration and much more! I've seen some articles on how to configure lighttpd to serve a Symfony project, however they usually did at least one mistake: Assuming that requests with periods ('.') are for static files (the period is a default separator in [...]]]></description>
			<content:encoded><![CDATA[<div class='microid-mailto+http:sha1:87cb62125a7e275147cf0edddf7bc9d4b5ce9e0d'><p><em><strong>Update: I have written a <a href="http://laurent.bachelier.name/2010/05/reducing-the-gap-between-symfony-and-non-php-frameworks/">tool</a> than can generate automatically the proper configuration and much more!</strong></em></p>
<p>I've seen some articles on how to configure lighttpd to serve a Symfony project, however they usually did at least one mistake:</p>
<ul>
<li>Assuming that requests with periods ('<code>.</code>') are for static files (the period is a default separator in Symfony, and is extensively used in the new admin generators).</li>
<li>Ignoring parameters after a '<code>?</code>' (they are not widely used, except... in the new admin generators, and can be very useful if your application)</li>
</ul>
<p>For the first part, there is a much simpler solution to handle static files: most of them are in specific directories, except for a very limited number of ones.</p>
<p>My solution also handles assets published by plugins (you might want to edit the corresponding line to a more liberal one though).</p>
<p>You might want to add your <code>sitemap.xml.gz</code> or <code>robots.txt</code> to this list if you generate them statically.</p>
<p>For the second part, you simply have to match explicitly the '<code>?</code>' part.</p>
<p>Here is the magic:</p>
<pre class="lua">&nbsp;
alias.url = <span style="color: #66cc66;">&#40;</span>
  <span style="color: #ff0000;">&quot;/sf/&quot;</span> =&gt; <span style="color: #ff0000;">&quot;/home/web/symfony_12/data/web/sf/&quot;</span>
<span style="color: #66cc66;">&#41;</span>
&nbsp;
url.rewrite-once = <span style="color: #66cc66;">&#40;</span>
  <span style="color: #ff0000;">&quot;^/css/.+&quot;</span> =&gt; <span style="color: #ff0000;">&quot;$0&quot;</span>, # directories with static files
  <span style="color: #ff0000;">&quot;^/js/.+&quot;</span> =&gt; <span style="color: #ff0000;">&quot;$0&quot;</span>,
  <span style="color: #ff0000;">&quot;^/images/.+&quot;</span> =&gt; <span style="color: #ff0000;">&quot;$0&quot;</span>,
  <span style="color: #ff0000;">&quot;^/uploads/.+&quot;</span> =&gt; <span style="color: #ff0000;">&quot;$0&quot;</span>,
  <span style="color: #ff0000;">&quot;^/favicon<span style="color: #000099; font-weight: bold;">\.</span>ico$&quot;</span> =&gt; <span style="color: #ff0000;">&quot;$0&quot;</span>, # static file example
  <span style="color: #ff0000;">&quot;^/sf[A-z]+Plugin.*&quot;</span> =&gt; <span style="color: #ff0000;">&quot;$0&quot;</span>, # plugins
  <span style="color: #ff0000;">&quot;^/sf/.+&quot;</span> =&gt; <span style="color: #ff0000;">&quot;$0&quot;</span>, # symfony assets
  <span style="color: #ff0000;">&quot;^/backend<span style="color: #000099; font-weight: bold;">\.</span>php(/[^<span style="color: #000099; font-weight: bold;">\?</span>]*)(<span style="color: #000099; font-weight: bold;">\?</span>.*)?&quot;</span> =&gt; <span style="color: #ff0000;">&quot;/backend.php$1$2&quot;</span>, # allow access to another application
  <span style="color: #ff0000;">&quot;^(/[^<span style="color: #000099; font-weight: bold;">\?</span>]*)(<span style="color: #000099; font-weight: bold;">\?</span>.*)?&quot;</span> =&gt; <span style="color: #ff0000;">&quot;/index.php$1$2&quot;</span> # default application
<span style="color: #66cc66;">&#41;</span>
&nbsp;</pre>
<p>I guess the usage of periods in the rules also had the benefit of allowing the access to any alternative application automatically. With my solution you have to add each <code>appname.php</code> file manually, unless you use:</p>
<pre class="lua">&nbsp;
  <span style="color: #ff0000;">&quot;^/([a-z]+)<span style="color: #000099; font-weight: bold;">\.</span>php(/[^<span style="color: #000099; font-weight: bold;">\?</span>]*)(<span style="color: #000099; font-weight: bold;">\?</span>.*)?&quot;</span> =&gt; <span style="color: #ff0000;">&quot;/$1.php$2$3&quot;</span>, # any app <span style="color: #66cc66;">&#40;</span>prod<span style="color: #66cc66;">&#41;</span>
&nbsp;</pre>
<p>Or for allowing any environment:</p>
<pre class="lua">&nbsp;
  <span style="color: #ff0000;">&quot;^/([a-z_]+)<span style="color: #000099; font-weight: bold;">\.</span>php(/[^<span style="color: #000099; font-weight: bold;">\?</span>]*)(<span style="color: #000099; font-weight: bold;">\?</span>.*)?&quot;</span> =&gt; <span style="color: #ff0000;">&quot;/$1.php$2$3&quot;</span>, # any app <span style="color: #66cc66;">&#40;</span>any env<span style="color: #66cc66;">&#41;</span>
&nbsp;</pre>
<p>Note: your application must contain only lowercase letters, but you're free to adapt it to your own usage.</p>
</div>]]></content:encoded>
			<wfw:commentRss>http://laurent.bachelier.name/2009/04/symfony-and-lighttpd/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Switching from BIND to PowerDNS in a few seconds</title>
		<link>http://laurent.bachelier.name/2009/03/switching-from-bind-to-powerdns-in-a-few-seconds/</link>
		<comments>http://laurent.bachelier.name/2009/03/switching-from-bind-to-powerdns-in-a-few-seconds/#comments</comments>
		<pubDate>Sun, 15 Mar 2009 19:39:36 +0000</pubDate>
		<dc:creator>Laurent</dc:creator>
				<category><![CDATA[Sysadmin]]></category>
		<category><![CDATA[bind]]></category>
		<category><![CDATA[config]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[pdns]]></category>
		<category><![CDATA[powerdns]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[zone]]></category>

		<guid isPermaLink="false">http://laurent.bachelier.name/?p=62</guid>
		<description><![CDATA[Seconds, really. First, why stop using BIND? For me it just happened because I couldn't understand why BIND wasn't working (again). However there are many other reasons to make the switch before it's too late. BIND has a bad security history, PowerDNS's code is more "modern" and its various parts are well-separated (for example, you [...]]]></description>
			<content:encoded><![CDATA[<div class='microid-mailto+http:sha1:de057f5c4b013e7a98c9e03132cf8e469a9ee2b1'><p>Seconds, really.</p>
<p>First, why stop using <a href="http://en.wikipedia.org/wiki/BIND">BIND</a>? For me it just happened because I couldn't understand why BIND wasn't working (again). However there are many other reasons to make the switch before it's too late. BIND has a bad security history, <a href="http://en.wikipedia.org/wiki/PowerDNS">PowerDNS</a>'s code is more "modern" and its various parts are well-separated (for example, you are not obligated to even <em>install</em> the recursor, it's another daemon).</p>
<p>PowerDNS now has a <a href="http://doc.powerdns.com/bindbackend.html">BIND zone backend</a>, and it works with both primary (master) and secondary (slave) zones. Before that, only database or other fancy backends were available; for hosting only some small domains it would be overkill and a pain to manage.<br />
However the documentation wasn't really clear. Here is how to do it.</p>
<p><span id="more-62"></span></p>
<h1>How to do it</h1>
<p>You should have this in your <code>pdns.conf</code> file:</p>
<pre class="tcl"><span style="color: #808080; font-style: italic;"># Start the bind backend (you can load multiple backends)</span>
launch=bind
<span style="color: #808080; font-style: italic;"># Path to your BIND named.conf</span>
bind-config=/etc/bind/named.conf
<span style="color: #808080; font-style: italic;"># PowerDNS will check if the zones are modified automatically. No need to reload the daemon!</span>
bind-check-interval=<span style="color: #ff4500;">300</span></pre>
<p>And... that's it, you're done.</p>
<p>But don't forget to set <code>allow-axfr-ips</code> with the IPs of the secondary DNS servers of your primary domains in <code>pdns.conf</code> (that's <code>allow-transfer</code> in <code>named.conf</code>).</p>
<h1>More details</h1>
<p>The only thing needed in <code>named.conf</code> are <code>zone</code> entries, anything else is ignored. For example:</p>
<pre class="tcl">zone <span style="color: #483d8b;">&quot;example.com&quot;</span> IN <span style="color: black;">&#123;</span>
    type slave;
    <span style="color: #008000;">file</span> <span style="color: #483d8b;">&quot;/etc/bind/sec/example.com.zone&quot;</span>;
    masters <span style="color: black;">&#123;</span> <span style="color: #ff4500;">1.3</span><span style="color: #ff4500;">.3</span><span style="color: #ff4500;">.7</span>; <span style="color: black;">&#125;</span>;
<span style="color: black;">&#125;</span>;
&nbsp;
zone <span style="color: #483d8b;">&quot;example.net&quot;</span> IN <span style="color: black;">&#123;</span>
    type master;
    <span style="color: #008000;">file</span> <span style="color: #483d8b;">&quot;/etc/bind/pri/example.net.zone&quot;</span>;
<span style="color: black;">&#125;</span>;</pre>
<p>If you want to create your first zone file, you can use the <a href="http://pgl.yoyo.org/adservers/bind-zone-file-creator.php">BIND zone file creator</a>.</p>
<p>I also encourage you to try out the <code>pdns_control</code>  tool that is bundled with PowerDNS.</p>
</div>]]></content:encoded>
			<wfw:commentRss>http://laurent.bachelier.name/2009/03/switching-from-bind-to-powerdns-in-a-few-seconds/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
