<?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>Etienne Lachance &#187; mysql</title>
	<atom:link href="http://etiennelachance.com/tag/mysql/feed/" rel="self" type="application/rss+xml" />
	<link>http://etiennelachance.com</link>
	<description></description>
	<lastBuildDate>Mon, 21 Jun 2010 15:33:06 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Installer un serveur DNS(bind) avec un backend MySQL sous Ubuntu 10.04</title>
		<link>http://etiennelachance.com/2010/06/installer-un-serveur-dnsbind-avec-un-backend-mysql-sous-ubuntu-10-04/</link>
		<comments>http://etiennelachance.com/2010/06/installer-un-serveur-dnsbind-avec-un-backend-mysql-sous-ubuntu-10-04/#comments</comments>
		<pubDate>Thu, 10 Jun 2010 18:53:46 +0000</pubDate>
		<dc:creator>estheban</dc:creator>
				<category><![CDATA[Tutoriel]]></category>
		<category><![CDATA[10.04]]></category>
		<category><![CDATA[bind]]></category>
		<category><![CDATA[dlz]]></category>
		<category><![CDATA[dns]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://etiennelachance.com/?p=138</guid>
		<description><![CDATA[But Installation d&#8217;un serveur DNS(bind9) avec un backend MySQL sous Ubuntu 10.04 Pré-requis Préparer l&#8217;environement en exécutant : mkdir -p /usr/local/src/bind9 cd /usr/local/src/bind9 Installer les pacquets nessécaires : apt-get update -y apt-get install -y build-essential mysql-server fakeroot bison libmysqlclient15-dev \ libkrb5-dev libkrb5-dev libssl-dev libtool libdb-dev libldap2-dev libldap2-dev libcap2-dev \ hardening-wrapper debhelper libxml2-dev libgeoip-dev apt-get source [...]]]></description>
			<content:encoded><![CDATA[<h2>But</h2>

<p>Installation d&#8217;un serveur DNS(bind9) avec un backend MySQL sous Ubuntu 10.04</p>

<h2>Pré-requis</h2>

<ol>
    <li>Préparer l&#8217;environement en exécutant :


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #660033;">-p</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>bind9
<span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>bind9</pre></div></div>



</li>
    <li>Installer les pacquets nessécaires :


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">apt-get</span> update <span style="color: #660033;">-y</span>
<span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> <span style="color: #660033;">-y</span> build-essential mysql-server fakeroot <span style="color: #c20cb9; font-weight: bold;">bison</span> libmysqlclient15-dev \
 libkrb5-dev libkrb5-dev libssl-dev libtool libdb-dev libldap2-dev libldap2-dev libcap2-dev \
 hardening-wrapper debhelper libxml2-dev libgeoip-dev
<span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #7a0874; font-weight: bold;">source</span> <span style="color: #660033;">-y</span> bind9</pre></div></div>



</li>
</ol>

<h2>BIND</h2>

<h3>Préparation</h3>

<ol>
    <li>Récupurer le nom du répertoire (varie selon la version)


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">ls</span> <span style="color: #660033;">-1</span></pre></div></div>



Voici un exemple de résultat, le nom recherché est marqué en <strong>gras</strong>
<blockquote><strong>bind9-9.5.1.dfsg.P2</strong> bind9_9.5.1.dfsg.P2-1.diff.gz  bind9_9.5.1.dfsg.P2-1.dsc bind9_9.5.1.dfsg.P2.orig.tar.gz</blockquote>
</li>
    <li>Entrer dans le répertoire


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> bind9-9.5.1.dfsg.P2</pre></div></div>



</li>
    <li>Éditer le fichier des règles de compilation


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">vi</span> debian<span style="color: #000000; font-weight: bold;">/</span>rules</pre></div></div>



Et changer la ligne <strong>&#8211;with-dlz-mysql=no</strong> par    <strong>&#8211;with-dlz-mysql=yes</strong> ou vous pouvez exécuter la commande  suivante dans <strong>vi</strong> :


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">:<span style="color: #000000; font-weight: bold;">%</span>s<span style="color: #000000; font-weight: bold;">/</span>dlz-mysql=no<span style="color: #000000; font-weight: bold;">/</span>dlz-mysql=yes<span style="color: #000000; font-weight: bold;">/</span>g</pre></div></div>



Enregistrer le fichier et quitter


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">:wq</pre></div></div>



</li>
</ol>

<h3>Compilation</h3>

<p>Pour compiler l&#8217;application exécuter la commande suivante :</p>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">dpkg-buildpackage <span style="color: #660033;">-rfakeroot</span> <span style="color: #660033;">-b</span></pre></div></div>


<table border="0" cellspacing="0" cellpadding="2" width="701" bgcolor="#ffcccc"><col width="22"></col> <col width="671"></col>
<tbody>
<tr>
<td width="22" valign="TOP"></td>
<td width="671">Si <strong>dpkg-buildpackage</strong> vous spécifie qu&#8217;il manque des           dépendances (<em>unmet dependencies</em>) Installer les            dépendances avec la commande <strong>apt-get install</strong> et           réessailler.</td>
</tr>
</tbody>
</table>

<h3>Installation</h3>

<ol>
    <li>Reculer d&#8217;un répertoire :


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> ..
<span style="color: #c20cb9; font-weight: bold;">ls</span> <span style="color: #660033;">-l</span></pre></div></div>



<blockquote>bind9-9.5.1.dfsg.P2 bind9_9.5.1.dfsg.P2-1_amd64.changes     bind9_9.5.1.dfsg.P2-1_amd64.deb bind9_9.5.1.dfsg.P2-1.diff.gz   bind9_9.5.1.dfsg.P2-1.dsc bind9_9.5.1.dfsg.P2.orig.tar.gz   bind9-doc_9.5.1.dfsg.P2-1_all.deb   bind9-host_9.5.1.dfsg.P2-1_amd64.deb    bind9utils_9.5.1.dfsg.P2-1_amd64.deb    dnsutils_9.5.1.dfsg.P2-1_amd64.de   libbind9-40_9.5.1.dfsg.P2-1_amd64.deb   libbind-dev_9.5.1.dfsg.P2-1_amd64.deb   libdns45_9.5.1.dfsg.P2-1_amd64.deb  libisc45_9.5.1.dfsg.P2-1_amd64.deb  libisccc40_9.5.1.dfsg.P2-1_amd64.deb    libisccfg40_9.5.1.dfsg.P2-1_amd64.deb   liblwres40_9.5.1.dfsg.P2-1_amd64.deb    lwresd_9.5.1.dfsg.P2-1_amd64.deb</blockquote>
</li>
    <li>Installer les pacquets sur votre système.


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">dpkg</span> <span style="color: #660033;">-i</span> <span style="color: #000000; font-weight: bold;">*</span>.deb</pre></div></div>



</li>
</ol>

<h3>Configuration</h3>

<ol>
    <li>Forcer bind a être exécuter en    un seul <em>thread</em>. Éditier le fichier <strong>/etc/default/bind9</strong><strong>/etc/default/bind9</strong>
<ol>
    <li>run resolvconf? RESOLVCONF=yes</li>
    <li>startup options for the server      OPTIONS=&#8221;-u bind <strong>-n 1</strong>&#8221;
<table border="0" cellspacing="0" cellpadding="2" width="654" bgcolor="#ffffce"><col width="22"></col> <col width="624"></col>
<tbody>
<tr>
<td width="22" valign="TOP"></td>
<td width="624">Bind semble avoir un problème lorsque qu&#8217;il est exécuter en                   <em>multithread</em>. L&#8217;erreur <em>&#8220;mysql driver unable to                  return result set for findzone query&#8221;</em> apparait dans                    les fichier de log et bind fini par arrêter.</td>
</tr>
</tbody>
</table>
</li>
</ol>

<p></li>
    <li>Voici un exemple pour le fichier    <strong>/etc/bind/named.conf.local</strong><strong>cat  /etc/bind/named.conf.local</strong></p>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">dlz <span style="color: #ff0000;">&quot;Mysql zone&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
   database <span style="color: #ff0000;">&quot;mysql
   {host=localhost dbname=Nom_de_la_Base_de_Donnee user=Nom_d_utilisateur pass=Mot_de_passe ssl=false}
   {select zone from dns_records where zone = '<span style="color: #007800;">$zone</span>$'}
   {select ttl, type, mx_priority, case when lower(type)='txt' then concat('<span style="color: #000099; font-weight: bold;">\&quot;</span>', data, '<span style="color: #000099; font-weight: bold;">\&quot;</span>')
        when lower(type) = 'soa' then concat_ws(' ', data, resp_person, serial, refresh, retry, expire, minimum)
        else data end from dns_records where zone = '<span style="color: #007800;">$zone</span>$' and host = '<span style="color: #007800;">$record</span>$'}&quot;</span>;
<span style="color: #7a0874; font-weight: bold;">&#125;</span>;</pre></div></div>


<p></li>
</ol></p>

<h2><span id="more-138"></span></h2>

<h2>MySQL</h2>

<h3>Creation d&#8217;un utilisateur et d&#8217;une base de données</h3>


<div class="wp_syntax"><div class="code"><pre class="mysql" style="font-family:monospace;"><span style="color: #990099; font-weight: bold;">CREATE</span> <span style="color: #000099;">USER</span> <span style="color: #008000;">'Nom<span style="color: #008080; font-weight: bold;">_</span>d<span style="color: #008080; font-weight: bold;">_</span>Utilisateur'</span>@<span style="color: #008000;">'localhost'</span> IDENTIFIED BY  <span style="color: #008000;">'***'</span><span style="color: #000033;">;</span>
<span style="color: #990099; font-weight: bold;">GRANT</span> <span style="color: #990099; font-weight: bold;">USAGE</span> <span style="color: #990099; font-weight: bold;">ON</span> <span style="color: #CC0099;">*</span> . <span style="color: #CC0099;">*</span> <span style="color: #990099; font-weight: bold;">TO</span>  <span style="color: #008000;">'Nom<span style="color: #008080; font-weight: bold;">_</span>d<span style="color: #008080; font-weight: bold;">_</span>Utilisateur'</span>@<span style="color: #008000;">'localhost'</span> IDENTIFIED BY  <span style="color: #008000;">'***'</span> <span style="color: #990099; font-weight: bold;">WITH</span> MAX_QUERIES_PER_HOUR <span style="color: #008080;">0</span> MAX_CONNECTIONS_PER_HOUR <span style="color: #008080;">0</span> MAX_UPDATES_PER_HOUR <span style="color: #008080;">0</span> MAX_USER_CONNECTIONS <span style="color: #008080;">0</span> <span style="color: #000033;">;</span>
&nbsp;
<span style="color: #990099; font-weight: bold;">CREATE</span> <span style="color: #990099; font-weight: bold;">DATABASE</span> <span style="color: #990099; font-weight: bold;">IF <span style="color: #CC0099; font-weight: bold;">NOT</span> EXISTS</span>  <span style="color: #008000;">`Nom<span style="color: #008080; font-weight: bold;">_</span>de<span style="color: #008080; font-weight: bold;">_</span>la<span style="color: #008080; font-weight: bold;">_</span>base<span style="color: #008080; font-weight: bold;">_</span>de<span style="color: #008080; font-weight: bold;">_</span>donnée`</span> <span style="color: #000033;">;</span>
&nbsp;
<span style="color: #990099; font-weight: bold;">GRANT</span> <span style="color: #990099; font-weight: bold;">ALL</span> <span style="color: #990099; font-weight: bold;">PRIVILEGES</span> <span style="color: #990099; font-weight: bold;">ON</span>  <span style="color: #008000;">`Nom<span style="color: #008080; font-weight: bold;">_</span>de<span style="color: #008080; font-weight: bold;">_</span>la<span style="color: #008080; font-weight: bold;">_</span>base<span style="color: #008080; font-weight: bold;">_</span>de<span style="color: #008080; font-weight: bold;">_</span>donnée`</span>.<span style="color: #CC0099;">*</span> <span style="color: #990099; font-weight: bold;">TO</span>  <span style="color: #008000;">'Nom<span style="color: #008080; font-weight: bold;">_</span>d<span style="color: #008080; font-weight: bold;">_</span>Utilisateur'</span>@<span style="color: #008000;">'localhost'</span><span style="color: #000033;">;</span></pre></div></div>


<h3>Création du schéma</h3>

<p>Exécuter sur le serveur SQL :</p>


<div class="wp_syntax"><div class="code"><pre class="mysql" style="font-family:monospace;"><span style="color: #990099; font-weight: bold;">CREATE</span> <span style="color: #990099; font-weight: bold;">TABLE</span> <span style="color: #990099; font-weight: bold;">IF <span style="color: #CC0099; font-weight: bold;">NOT</span> EXISTS</span> <span style="color: #008000;">`dns<span style="color: #008080; font-weight: bold;">_</span>records`</span> <span style="color: #FF00FF;">&#40;</span>
  <span style="color: #008000;">`id`</span> <span style="color: #999900; font-weight: bold;">int</span><span style="color: #FF00FF;">&#40;</span><span style="color: #008080;">11</span><span style="color: #FF00FF;">&#41;</span> <span style="color: #CC0099; font-weight: bold;">NOT</span> <span style="color: #9900FF; font-weight: bold;">NULL</span> <span style="color: #FF9900; font-weight: bold;">AUTO_INCREMENT</span><span style="color: #000033;">,</span>
  <span style="color: #008000;">`zone`</span> <span style="color: #999900; font-weight: bold;">varchar</span><span style="color: #FF00FF;">&#40;</span><span style="color: #008080;">64</span><span style="color: #FF00FF;">&#41;</span> <span style="color: #990099; font-weight: bold;">DEFAULT</span> <span style="color: #9900FF; font-weight: bold;">NULL</span><span style="color: #000033;">,</span>
  <span style="color: #008000;">`host`</span> <span style="color: #999900; font-weight: bold;">varchar</span><span style="color: #FF00FF;">&#40;</span><span style="color: #008080;">64</span><span style="color: #FF00FF;">&#41;</span> <span style="color: #990099; font-weight: bold;">DEFAULT</span> <span style="color: #9900FF; font-weight: bold;">NULL</span><span style="color: #000033;">,</span>
  <span style="color: #008000;">`type`</span> <span style="color: #999900; font-weight: bold;">varchar</span><span style="color: #FF00FF;">&#40;</span><span style="color: #008080;">8</span><span style="color: #FF00FF;">&#41;</span> <span style="color: #990099; font-weight: bold;">DEFAULT</span> <span style="color: #9900FF; font-weight: bold;">NULL</span><span style="color: #000033;">,</span>
  <span style="color: #008000;">`data`</span> <span style="color: #999900; font-weight: bold;">varchar</span><span style="color: #FF00FF;">&#40;</span><span style="color: #008080;">64</span><span style="color: #FF00FF;">&#41;</span> <span style="color: #990099; font-weight: bold;">DEFAULT</span> <span style="color: #9900FF; font-weight: bold;">NULL</span><span style="color: #000033;">,</span>
  <span style="color: #008000;">`ttl`</span> <span style="color: #999900; font-weight: bold;">int</span><span style="color: #FF00FF;">&#40;</span><span style="color: #008080;">11</span><span style="color: #FF00FF;">&#41;</span> <span style="color: #CC0099; font-weight: bold;">NOT</span> <span style="color: #9900FF; font-weight: bold;">NULL</span> <span style="color: #990099; font-weight: bold;">DEFAULT</span> <span style="color: #008000;">'3600'</span><span style="color: #000033;">,</span>
  <span style="color: #008000;">`mx<span style="color: #008080; font-weight: bold;">_</span>priority`</span> <span style="color: #999900; font-weight: bold;">int</span><span style="color: #FF00FF;">&#40;</span><span style="color: #008080;">11</span><span style="color: #FF00FF;">&#41;</span> <span style="color: #990099; font-weight: bold;">DEFAULT</span> <span style="color: #9900FF; font-weight: bold;">NULL</span><span style="color: #000033;">,</span>
  <span style="color: #008000;">`refresh`</span> <span style="color: #999900; font-weight: bold;">int</span><span style="color: #FF00FF;">&#40;</span><span style="color: #008080;">11</span><span style="color: #FF00FF;">&#41;</span> <span style="color: #CC0099; font-weight: bold;">NOT</span> <span style="color: #9900FF; font-weight: bold;">NULL</span> <span style="color: #990099; font-weight: bold;">DEFAULT</span> <span style="color: #008000;">'3600'</span><span style="color: #000033;">,</span>
  <span style="color: #008000;">`retry`</span> <span style="color: #999900; font-weight: bold;">int</span><span style="color: #FF00FF;">&#40;</span><span style="color: #008080;">11</span><span style="color: #FF00FF;">&#41;</span> <span style="color: #CC0099; font-weight: bold;">NOT</span> <span style="color: #9900FF; font-weight: bold;">NULL</span> <span style="color: #990099; font-weight: bold;">DEFAULT</span> <span style="color: #008000;">'3600'</span><span style="color: #000033;">,</span>
  <span style="color: #008000;">`expire`</span> <span style="color: #999900; font-weight: bold;">int</span><span style="color: #FF00FF;">&#40;</span><span style="color: #008080;">11</span><span style="color: #FF00FF;">&#41;</span> <span style="color: #CC0099; font-weight: bold;">NOT</span> <span style="color: #9900FF; font-weight: bold;">NULL</span> <span style="color: #990099; font-weight: bold;">DEFAULT</span> <span style="color: #008000;">'86400'</span><span style="color: #000033;">,</span>
  <span style="color: #008000;">`minimum`</span> <span style="color: #999900; font-weight: bold;">int</span><span style="color: #FF00FF;">&#40;</span><span style="color: #008080;">11</span><span style="color: #FF00FF;">&#41;</span> <span style="color: #CC0099; font-weight: bold;">NOT</span> <span style="color: #9900FF; font-weight: bold;">NULL</span> <span style="color: #990099; font-weight: bold;">DEFAULT</span> <span style="color: #008000;">'3600'</span><span style="color: #000033;">,</span>
  <span style="color: #008000;">`serial`</span> <span style="color: #999900; font-weight: bold;">bigint</span><span style="color: #FF00FF;">&#40;</span><span style="color: #008080;">20</span><span style="color: #FF00FF;">&#41;</span> <span style="color: #CC0099; font-weight: bold;">NOT</span> <span style="color: #9900FF; font-weight: bold;">NULL</span> <span style="color: #990099; font-weight: bold;">DEFAULT</span> <span style="color: #008000;">'2008082700'</span><span style="color: #000033;">,</span>
  <span style="color: #008000;">`resp<span style="color: #008080; font-weight: bold;">_</span>person`</span> <span style="color: #999900; font-weight: bold;">varchar</span><span style="color: #FF00FF;">&#40;</span><span style="color: #008080;">64</span><span style="color: #FF00FF;">&#41;</span> <span style="color: #CC0099; font-weight: bold;">NOT</span> <span style="color: #9900FF; font-weight: bold;">NULL</span> <span style="color: #990099; font-weight: bold;">DEFAULT</span> <span style="color: #008000;">'resp.person.email'</span><span style="color: #000033;">,</span>
  <span style="color: #008000;">`primary<span style="color: #008080; font-weight: bold;">_</span>ns`</span> <span style="color: #999900; font-weight: bold;">varchar</span><span style="color: #FF00FF;">&#40;</span><span style="color: #008080;">64</span><span style="color: #FF00FF;">&#41;</span> <span style="color: #CC0099; font-weight: bold;">NOT</span> <span style="color: #9900FF; font-weight: bold;">NULL</span> <span style="color: #990099; font-weight: bold;">DEFAULT</span> <span style="color: #008000;">'ns1.yourdns.here'</span><span style="color: #000033;">,</span>
  <span style="color: #008000;">`data<span style="color: #008080; font-weight: bold;">_</span>count`</span> <span style="color: #999900; font-weight: bold;">int</span><span style="color: #FF00FF;">&#40;</span><span style="color: #008080;">11</span><span style="color: #FF00FF;">&#41;</span> <span style="color: #CC0099; font-weight: bold;">NOT</span> <span style="color: #9900FF; font-weight: bold;">NULL</span> <span style="color: #990099; font-weight: bold;">DEFAULT</span> <span style="color: #008000;">'0'</span><span style="color: #000033;">,</span>
  <span style="color: #990099; font-weight: bold;">PRIMARY KEY</span> <span style="color: #FF00FF;">&#40;</span><span style="color: #008000;">`id`</span><span style="color: #FF00FF;">&#41;</span><span style="color: #000033;">,</span>
  <span style="color: #990099; font-weight: bold;">KEY</span> <span style="color: #008000;">`host`</span> <span style="color: #FF00FF;">&#40;</span><span style="color: #008000;">`host`</span><span style="color: #FF00FF;">&#41;</span><span style="color: #000033;">,</span>
  <span style="color: #990099; font-weight: bold;">KEY</span> <span style="color: #008000;">`zone`</span> <span style="color: #FF00FF;">&#40;</span><span style="color: #008000;">`zone`</span><span style="color: #FF00FF;">&#41;</span><span style="color: #000033;">,</span>
  <span style="color: #990099; font-weight: bold;">KEY</span> <span style="color: #008000;">`type`</span> <span style="color: #FF00FF;">&#40;</span><span style="color: #008000;">`type`</span><span style="color: #FF00FF;">&#41;</span>
<span style="color: #FF00FF;">&#41;</span> <span style="color: #990099; font-weight: bold;">ENGINE</span><span style="color: #CC0099;">=</span>MyISAM  <span style="color: #990099; font-weight: bold;">DEFAULT</span> <span style="color: #FF9900; font-weight: bold;">CHARSET</span><span style="color: #CC0099;">=</span>latin1<span style="color: #000033;">;</span></pre></div></div>


<h3>Donnée d&#8217;exemple</h3>


<div class="wp_syntax"><div class="code"><pre class="mysql" style="font-family:monospace;"><span style="color: #990099; font-weight: bold;">INSERT</span> <span style="color: #990099; font-weight: bold;">INTO</span> <span style="color: #008000;">`dns<span style="color: #008080; font-weight: bold;">_</span>records`</span> <span style="color: #FF00FF;">&#40;</span><span style="color: #008000;">`id`</span><span style="color: #000033;">,</span> <span style="color: #008000;">`zone`</span><span style="color: #000033;">,</span> <span style="color: #008000;">`host`</span><span style="color: #000033;">,</span> <span style="color: #008000;">`type`</span><span style="color: #000033;">,</span> <span style="color: #008000;">`data`</span><span style="color: #000033;">,</span> <span style="color: #008000;">`ttl`</span><span style="color: #000033;">,</span> <span style="color: #008000;">`mx<span style="color: #008080; font-weight: bold;">_</span>priority`</span><span style="color: #000033;">,</span> <span style="color: #008000;">`refresh`</span><span style="color: #000033;">,</span> <span style="color: #008000;">`retry`</span><span style="color: #000033;">,</span> <span style="color: #008000;">`expire`</span><span style="color: #000033;">,</span> <span style="color: #008000;">`minimum`</span><span style="color: #000033;">,</span> <span style="color: #008000;">`serial`</span><span style="color: #000033;">,</span> <span style="color: #008000;">`resp<span style="color: #008080; font-weight: bold;">_</span>person`</span><span style="color: #000033;">,</span> <span style="color: #008000;">`primary<span style="color: #008080; font-weight: bold;">_</span>ns`</span><span style="color: #000033;">,</span> <span style="color: #008000;">`data<span style="color: #008080; font-weight: bold;">_</span>count`</span><span style="color: #FF00FF;">&#41;</span> <span style="color: #990099; font-weight: bold;">VALUES</span>
<span style="color: #FF00FF;">&#40;</span><span style="color: #008080;">1</span><span style="color: #000033;">,</span> <span style="color: #008000;">'test.cat.io'</span><span style="color: #000033;">,</span> <span style="color: #008000;">'www'</span><span style="color: #000033;">,</span> <span style="color: #008000;">'A'</span><span style="color: #000033;">,</span> <span style="color: #008000;">'1.2.3.4'</span><span style="color: #000033;">,</span> <span style="color: #008080;">3600</span><span style="color: #000033;">,</span> <span style="color: #9900FF; font-weight: bold;">NULL</span><span style="color: #000033;">,</span> <span style="color: #008080;">3600</span><span style="color: #000033;">,</span> <span style="color: #008080;">3600</span><span style="color: #000033;">,</span> <span style="color: #008080;">86400</span><span style="color: #000033;">,</span> <span style="color: #008080;">3600</span><span style="color: #000033;">,</span> <span style="color: #008080;">2008082700</span><span style="color: #000033;">,</span> <span style="color: #008000;">'resp.person.email'</span><span style="color: #000033;">,</span> <span style="color: #008000;">'ns1.yourdns.here'</span><span style="color: #000033;">,</span> <span style="color: #008080;">0</span><span style="color: #FF00FF;">&#41;</span><span style="color: #000033;">,</span>
<span style="color: #FF00FF;">&#40;</span><span style="color: #008080;">2</span><span style="color: #000033;">,</span> <span style="color: #008000;">'test.cat.io'</span><span style="color: #000033;">,</span> <span style="color: #008000;">'patate'</span><span style="color: #000033;">,</span> <span style="color: #008000;">'A'</span><span style="color: #000033;">,</span> <span style="color: #008000;">'245.241.2.1'</span><span style="color: #000033;">,</span> <span style="color: #008080;">3600</span><span style="color: #000033;">,</span> <span style="color: #9900FF; font-weight: bold;">NULL</span><span style="color: #000033;">,</span> <span style="color: #008080;">3600</span><span style="color: #000033;">,</span> <span style="color: #008080;">3600</span><span style="color: #000033;">,</span> <span style="color: #008080;">86400</span><span style="color: #000033;">,</span> <span style="color: #008080;">3600</span><span style="color: #000033;">,</span> <span style="color: #008080;">2008082700</span><span style="color: #000033;">,</span> <span style="color: #008000;">'resp.person.email'</span><span style="color: #000033;">,</span> <span style="color: #008000;">'ns1.yourdns.here'</span><span style="color: #000033;">,</span> <span style="color: #008080;">0</span><span style="color: #FF00FF;">&#41;</span><span style="color: #000033;">,</span>
<span style="color: #FF00FF;">&#40;</span><span style="color: #008080;">3</span><span style="color: #000033;">,</span> <span style="color: #008000;">'test.cat.io'</span><span style="color: #000033;">,</span> <span style="color: #008000;">'@'</span><span style="color: #000033;">,</span> <span style="color: #008000;">'A'</span><span style="color: #000033;">,</span> <span style="color: #008000;">'1.2.3.4'</span><span style="color: #000033;">,</span> <span style="color: #008080;">3600</span><span style="color: #000033;">,</span> <span style="color: #9900FF; font-weight: bold;">NULL</span><span style="color: #000033;">,</span> <span style="color: #008080;">3600</span><span style="color: #000033;">,</span> <span style="color: #008080;">3600</span><span style="color: #000033;">,</span> <span style="color: #008080;">86400</span><span style="color: #000033;">,</span> <span style="color: #008080;">3600</span><span style="color: #000033;">,</span> <span style="color: #008080;">2008082700</span><span style="color: #000033;">,</span> <span style="color: #008000;">'resp.person.email'</span><span style="color: #000033;">,</span> <span style="color: #008000;">'ns1.yourdns.here'</span><span style="color: #000033;">,</span> <span style="color: #008080;">0</span><span style="color: #FF00FF;">&#41;</span><span style="color: #000033;">,</span>
<span style="color: #FF00FF;">&#40;</span><span style="color: #008080;">4</span><span style="color: #000033;">,</span> <span style="color: #008000;">'test.cat.io'</span><span style="color: #000033;">,</span> <span style="color: #008000;">'www2'</span><span style="color: #000033;">,</span> <span style="color: #008000;">'CNAME'</span><span style="color: #000033;">,</span> <span style="color: #008000;">'www.domain.com.'</span><span style="color: #000033;">,</span> <span style="color: #008080;">3600</span><span style="color: #000033;">,</span> <span style="color: #9900FF; font-weight: bold;">NULL</span><span style="color: #000033;">,</span> <span style="color: #008080;">3600</span><span style="color: #000033;">,</span> <span style="color: #008080;">3600</span><span style="color: #000033;">,</span> <span style="color: #008080;">86400</span><span style="color: #000033;">,</span> <span style="color: #008080;">3600</span><span style="color: #000033;">,</span> <span style="color: #008080;">2008082700</span><span style="color: #000033;">,</span> <span style="color: #008000;">'resp.person.email'</span><span style="color: #000033;">,</span> <span style="color: #008000;">'ns1.yourdns.here'</span><span style="color: #000033;">,</span> <span style="color: #008080;">0</span><span style="color: #FF00FF;">&#41;</span><span style="color: #000033;">,</span>
<span style="color: #FF00FF;">&#40;</span><span style="color: #008080;">5</span><span style="color: #000033;">,</span> <span style="color: #008000;">'test.cat.io'</span><span style="color: #000033;">,</span> <span style="color: #008000;">'@'</span><span style="color: #000033;">,</span> <span style="color: #008000;">'MX'</span><span style="color: #000033;">,</span> <span style="color: #008000;">'domain.com.'</span><span style="color: #000033;">,</span> <span style="color: #008080;">3600</span><span style="color: #000033;">,</span> <span style="color: #008080;">0</span><span style="color: #000033;">,</span> <span style="color: #008080;">3600</span><span style="color: #000033;">,</span> <span style="color: #008080;">3600</span><span style="color: #000033;">,</span> <span style="color: #008080;">86400</span><span style="color: #000033;">,</span> <span style="color: #008080;">3600</span><span style="color: #000033;">,</span> <span style="color: #008080;">2008082700</span><span style="color: #000033;">,</span> <span style="color: #008000;">'resp.person.email'</span><span style="color: #000033;">,</span> <span style="color: #008000;">'ns1.yourdns.here'</span><span style="color: #000033;">,</span> <span style="color: #008080;">0</span><span style="color: #FF00FF;">&#41;</span><span style="color: #000033;">;</span></pre></div></div>


<h2>Redémarrer et tester</h2>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">reboot</pre></div></div>


<h2>References</h2>

<ul>
    <li><a href="http://diaryproducts.net/about/operating_systems/unix/installing_bind9_with_dlz_and_mysql_backend_on_ubuntu_jaunty_9_04">http://diaryproducts.net/about/operating_systems/unix/installing_bind9_with_dlz_and_mysql_backend_on_ubuntu_jaunty_9_04</a></li>
    <li><a href="http://bind-dlz.sourceforge.net/mysql_driver.html">http://bind-dlz.sourceforge.net/mysql_driver.html</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://etiennelachance.com/2010/06/installer-un-serveur-dnsbind-avec-un-backend-mysql-sous-ubuntu-10-04/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Asterisk 1.6 : Installation, compilation et configuration du CDR via MySQL</title>
		<link>http://etiennelachance.com/2009/11/asterisk-cdr-mysql/</link>
		<comments>http://etiennelachance.com/2009/11/asterisk-cdr-mysql/#comments</comments>
		<pubDate>Fri, 20 Nov 2009 20:54:53 +0000</pubDate>
		<dc:creator>estheban</dc:creator>
				<category><![CDATA[Tutoriel]]></category>
		<category><![CDATA[asterisk]]></category>
		<category><![CDATA[cdr]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[pbx]]></category>

		<guid isPermaLink="false">http://etiennelachance.com/?p=86</guid>
		<description><![CDATA[Introduction Pour continuer la série d&#8217;article sur asterisk, celuis-ci vous expliquera comment compiler et installer les modules complémentaire (addons) d&#8217;asterisk. Ainsi comment configurer le CDR (Call Detail Record, registre des appels en français). Bonne lecture. Veuiller prendre note que les versions spécifier dans cet artricle sont les derniers versions stables disponible lors de la création [...]]]></description>
			<content:encoded><![CDATA[<h2 id="Pré-requis">Introduction</h2>

<p>Pour continuer la série d&#8217;article sur asterisk, celuis-ci vous expliquera comment compiler et installer les modules complémentaire (addons) d&#8217;asterisk.  Ainsi comment configurer le CDR (<em>Call Detail Record</em>, registre des appels en français).  Bonne lecture.
Veuiller prendre note que les versions spécifier dans cet artricle sont les derniers versions stables disponible lors de la création de celui-ci.</p>

<h2 id="Pré-requis"><span id="more-86"></span></h2>

<h2>Description</h2>

<p>Les modules complémentaire d&#8217;asterisk comprend ceci :</p>

<ul>
    <li>Applications
<ul>
    <li>app_addon_sql_mysql (Interface pour MySQL)</li>
    <li>app_saycountpl (gadget selon moi)</li>
</ul>

<p></li>
    <li>Call Detail Recording</p>

<ul>
    <li>cdr_addon_mysql (pour enregistrer le registre des appels dans MySQL, le but de l&#8217;article)</li>
</ul>

<p></li>
    <li>Channel Drivers</p>

<ul>
    <li>chan_mobile (Pilote pour les périphérique Bluetooth)</li>
    <li>chan_ooh323 (<a href="http://www.obj-sys.com/open/html/index.shtml" target="_blank">Objective Open H.323</a>)</li>
</ul>

<p></li>
    <li>Format Interpreters</p>

<ul>
    <li>format_mp3 (ça le dit, supporter le format MP3)</li>
</ul>

<p></li>
    <li>Ressource Modules</p>

<ul>
    <li>res_config_mysql (pour la configuration en temps réel )</li>
</ul>

<p></li>
</ul></p>

<h2 id="Pré-requis">Pré-requis</h2>

<p>Avoir installé une Debian de Base, <a title="Asterisk" href="/2009/11/compilation-et-installation-dasterisk-1-6-1-9-sous-debian-lenny/">Asterisk</a> et MySQL serveur</p>

<p>Paquets à installer :</p>

<blockquote>


62c9ba5635304e178d4ef67dbe136f1e


</blockquote>

<p>Télécharger les modules complémentaires d&#8217;asterisk :</p>

<blockquote>
<pre># wget <a href="http://downloads.asterisk.org/pub/telephony/asterisk/releases/asterisk-addons-1.6.1.2-rc1.tar.gz">http://downloads.asterisk.org/pub/telephony/asterisk/releases\
/asterisk-addons-1.6.1.2-rc1.tar.gz</a></pre>
</blockquote>

<h2 id="Compilation">Compilation</h2>

<blockquote>


7e9e26c109b5e3d0caeeb3bada23631f


</blockquote>

<p>Les options au script <strong>./configure</strong>, sont des variables pour le standard Debian.
La commande <strong>make menuconfig</strong> est optionnel, utiliser la si vous voulez personaliser les modules d’asterisk</p>

<blockquote>


cfc6b75427c595fd9e9e45665cba24d9


</blockquote>

<p>La commande <strong>make samples</strong> va créer des fichiers de configuration de base dans le répertoire <em>/etc/asterisk</em></p>

<h2 id="Pré-requis">Configuration</h2>

<h3>Serveur MySQL</h3>

<p>Veuiller créer une table dans MySQL, voici le template :</p>

<blockquote>


63ec40caf5fbe8aa128f6de6b3b25705


</blockquote>

<h3>/etc/asterisk/cdr_mysql.conf</h3>

<blockquote>
<pre>[global] 
hostname=<em>l'adresse de votre serveur MySQL
</em>dbname=<em>nom_de_la_base_de_donnée</em>
table=<em>nom_de_la_table</em>
password=<em>le_mot_de_passe</em>
user=<em>nom_de_l'usager</em>
port=3306
;sock=/tmp/mysql.sock</pre>
</blockquote>

<h2>Finalement</h2>

<p>Redémarrer Asterisk et le tout devrait fonctionner.  Si vous avez des questions, laisser moi un commentaire.</p>

<h2>Référence</h2>

<ul>
    <li><a href="http://www.voip-info.org/wiki/view/Asterisk+cdr+mysql">http://www.voip-info.org/wiki/view/Asterisk+cdr+mysql</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://etiennelachance.com/2009/11/asterisk-cdr-mysql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
