<?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>Ta vie on s'en fout!</title>
	<atom:link href="http://tavie.onsenfout.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://tavie.onsenfout.com</link>
	<description>Mon bazar techno-miam</description>
	<lastBuildDate>Tue, 22 Nov 2011 11:06:05 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Affichage des caractères accentués dans l&#8217;interface de Nagios</title>
		<link>http://tavie.onsenfout.com/2011/11/22/affichage-des-caracteres-accentues-dans-linterface-de-nagios/</link>
		<comments>http://tavie.onsenfout.com/2011/11/22/affichage-des-caracteres-accentues-dans-linterface-de-nagios/#comments</comments>
		<pubDate>Tue, 22 Nov 2011 11:06:05 +0000</pubDate>
		<dc:creator>François</dc:creator>
				<category><![CDATA[Bits]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[monitoring]]></category>
		<category><![CDATA[nagios]]></category>
		<category><![CDATA[utf8]]></category>

		<guid isPermaLink="false">http://tavie.onsenfout.com/?p=996</guid>
		<description><![CDATA[Testé sur Debian Wheezy &#8211; Nagios 3.2.3 (paquets Debian) Depuis le temps je m&#8217;étais fait une raison, je trouvais presque normal d&#8217;avoir ce genre de ligne dans mon interface web Nagios : SMTP OK - 0,012 sec. de temps de rÃ©ponse Je suis tombé au hasard du web sur LA solution simple et efficace pour [...]<br /><div><img src="http://tavie.onsenfout.com/wp-content/plugins/gd-star-rating/gfx.php?value=0.0" /></div><div>Rating: 0.0/<strong>5</strong> (0 votes cast)</div><br /><a target="_blank" href="http://www.gdstarrating.com/"><img src="http://tavie.onsenfout.com/wp-content/plugins/gd-star-rating/gfx/powered.png" border="0" width="80" height="15" /></a><br />]]></description>
			<content:encoded><![CDATA[<p><em>Testé sur Debian Wheezy &#8211; Nagios 3.2.3 (paquets Debian)</em></p>
<p>Depuis le temps je m&#8217;étais fait une raison, je trouvais presque normal d&#8217;avoir ce genre de ligne dans mon interface web Nagios :</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">SMTP OK - 0,012 sec. de temps de rÃ©ponse</pre></div></div>

<p><span id="more-996"></span>Je suis tombé au hasard du web sur <a href="http://www.silverlake.fr/index.php?post/2011/07/22/Interface-web-de-Nagios-et-caract%C3%A8res-accentu%C3%A9s" title="Interface web de Nagios et caractères accentués" target="_blank">LA solution</a> simple et efficace pour résoudre le problème, un grand merci à Silverlake:</p>
<ol>
<li>S&#8217;assurer que dans le fichier <strong>/etc/apache2/conf.d/charset</strong> la ligne &laquo;&nbsp;<strong>AddDefaultCharset UTF-8</strong>&nbsp;&raquo; soit bien décommentée.</li>
<li>Dans le fichier <strong>/etc/nagios3/cgi.cfg</strong> rechercher la ligne &laquo;&nbsp;<strong>escape_html_tags</strong>&nbsp;&raquo; et passer la valeur de <strong>1</strong> à <strong>0</strong>.</li>
</ol>
<p>Redémarrer apache et nagios</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">SMTP OK - 0,012 sec. de temps de réponse</pre></div></div>

<p>C&#8217;est plus joli comme ça, non?</p>
<br /><div><img src="http://tavie.onsenfout.com/wp-content/plugins/gd-star-rating/gfx.php?value=0.0" /></div><div>Rating: 0.0/<strong>5</strong> (0 votes cast)</div><br /><a target="_blank" href="http://www.gdstarrating.com/"><img src="http://tavie.onsenfout.com/wp-content/plugins/gd-star-rating/gfx/powered.png" border="0" width="80" height="15" /></a><br />]]></content:encoded>
			<wfw:commentRss>http://tavie.onsenfout.com/2011/11/22/affichage-des-caracteres-accentues-dans-linterface-de-nagios/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Lapin au chou et aux pommes</title>
		<link>http://tavie.onsenfout.com/2011/11/08/lapin-au-chou-et-aux-pommes/</link>
		<comments>http://tavie.onsenfout.com/2011/11/08/lapin-au-chou-et-aux-pommes/#comments</comments>
		<pubDate>Tue, 08 Nov 2011 18:41:05 +0000</pubDate>
		<dc:creator>François</dc:creator>
				<category><![CDATA[Miam]]></category>
		<category><![CDATA[chou]]></category>
		<category><![CDATA[cidre]]></category>
		<category><![CDATA[lapin]]></category>
		<category><![CDATA[pommes]]></category>
		<category><![CDATA[viandes]]></category>

		<guid isPermaLink="false">http://tavie.onsenfout.com/?p=986</guid>
		<description><![CDATA[C&#8217;est la saison du chou et des pommes, il ne reste qu&#8217;à attraper un lapin pour préparer cette recette facile, rapide et rassérénante. Pour 4 personnes 1 lapin coupé en morceaux 1 chou blanc 4 pommes 2 oignons moyen 200g de lardons fumés 2 feuilles de laurier 1 tablette de bouillon de volaille 40cl de [...]<br /><div><img src="http://tavie.onsenfout.com/wp-content/plugins/gd-star-rating/gfx.php?value=0.0" /></div><div>Rating: 0.0/<strong>5</strong> (0 votes cast)</div><br /><a target="_blank" href="http://www.gdstarrating.com/"><img src="http://tavie.onsenfout.com/wp-content/plugins/gd-star-rating/gfx/powered.png" border="0" width="80" height="15" /></a><br />]]></description>
			<content:encoded><![CDATA[<p>C&#8217;est la saison du chou et des pommes, il ne reste qu&#8217;à attraper un lapin pour préparer cette recette facile, rapide et rassérénante.</p>
<p><span id="more-986"></span><br />
<h3>Pour 4 personnes</h3>
<p></p>
<ul>
<li>1 lapin coupé en morceaux</li>
<li>1 chou blanc</li>
<li>4 pommes</li>
<li>2 oignons moyen</li>
<li>200g de lardons fumés</li>
<li>2 feuilles de laurier</li>
<li>1 tablette de bouillon de volaille</li>
<li>40cl de cidre brut</li>
<li>1 petit verre de Calvados (facultatif, mais tellement meilleur!)</li>
<li>un peu d&#8217;huile</li>
<li>Sel, poivre</li>
</ul>
<p></p>
<ol>
<li>Couper le chou en lanières et le blanchir 5mn à l&#8217;eau bouillante salée</li>
<li>Dans une cocotte en fonte faire revenir les lardons, réserver</li>
<li>Faire dorer les oignons dans la graisse des lardons, réserver</li>
<li>Ajouter si besoin un peu d&#8217;huile et faire revenir les morceaux de lapin, flamber au Calva si l&#8217;option a été retenue, saler, poivrer et réserver</li>
<li>Mettre le chou bien égouté dans la cocotte, ajouter les oignons, les lardons, le cidre, le laurier, la tablette de bouillon émiettée, sel poivre. Mélanger et laisser mijoter 15mn à couvert, on en profite pour éplucher les pommes et les couper en lamelles</li>
<li>Ajouter les pommes au chou, mélanger, et poser sur le lit de chou les morceaux de lapin. Continuer la cuisson 25-30 mn à couvert</li>
</ol>
<br /><div><img src="http://tavie.onsenfout.com/wp-content/plugins/gd-star-rating/gfx.php?value=0.0" /></div><div>Rating: 0.0/<strong>5</strong> (0 votes cast)</div><br /><a target="_blank" href="http://www.gdstarrating.com/"><img src="http://tavie.onsenfout.com/wp-content/plugins/gd-star-rating/gfx/powered.png" border="0" width="80" height="15" /></a><br />]]></content:encoded>
			<wfw:commentRss>http://tavie.onsenfout.com/2011/11/08/lapin-au-chou-et-aux-pommes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>VirtualBox : Erreur d&#8217;accès au sous-système USB</title>
		<link>http://tavie.onsenfout.com/2011/11/08/virtualbox-erreur-dacces-au-sous-systeme-usb/</link>
		<comments>http://tavie.onsenfout.com/2011/11/08/virtualbox-erreur-dacces-au-sous-systeme-usb/#comments</comments>
		<pubDate>Tue, 08 Nov 2011 11:57:49 +0000</pubDate>
		<dc:creator>François</dc:creator>
				<category><![CDATA[Bits]]></category>
		<category><![CDATA[usb]]></category>
		<category><![CDATA[virtualbox]]></category>
		<category><![CDATA[vm]]></category>

		<guid isPermaLink="false">http://tavie.onsenfout.com/?p=982</guid>
		<description><![CDATA[Host sous Debian Wheezy &#8211; VirtualBox 4.1.4 J&#8217;ai eu cette erreur dernièrement sur plusieurs machines en voulant accéder à la configuration de la VM, cela quelque soit l&#8217;OS de la VM. L&#8217;USB ne fonctionne alors pas sur la VM. Le code d&#8217;erreur est : NS_ERROR_FAILURE (0x00004005) Le remède : L&#8217;utilisateur actif doit faire partie du [...]<br /><div><img src="http://tavie.onsenfout.com/wp-content/plugins/gd-star-rating/gfx.php?value=0.0" /></div><div>Rating: 0.0/<strong>5</strong> (0 votes cast)</div><br /><a target="_blank" href="http://www.gdstarrating.com/"><img src="http://tavie.onsenfout.com/wp-content/plugins/gd-star-rating/gfx/powered.png" border="0" width="80" height="15" /></a><br />]]></description>
			<content:encoded><![CDATA[<p><em>Host sous Debian Wheezy &#8211; VirtualBox 4.1.4</em></p>
<p>J&#8217;ai eu cette erreur dernièrement sur plusieurs machines en voulant accéder à la configuration de la VM, cela quelque soit l&#8217;OS de la VM. L&#8217;USB ne fonctionne alors pas sur la VM. </p>
<p>Le code d&#8217;erreur est :</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">NS_ERROR_FAILURE (0x00004005)</pre></div></div>

<p><span id="more-982"></span><br />
<h3>Le remède :</h3>
<p>L&#8217;utilisateur actif doit faire partie du groupe <strong>vboxusers</strong>, et d&#8217;un groupe du même nom que l&#8217;utilisateur. Editer <strong>/etc/group</strong> et redémarrer la machine.</p>
<h3>Lien</h3>
<p><a href="https://forums.virtualbox.org/viewtopic.php?f=7&#038;t=40982" target="_blank">NS_ERROR_FAILURE (0&#215;00004005) on natty ubuntu</a></p>
<br /><div><img src="http://tavie.onsenfout.com/wp-content/plugins/gd-star-rating/gfx.php?value=0.0" /></div><div>Rating: 0.0/<strong>5</strong> (0 votes cast)</div><br /><a target="_blank" href="http://www.gdstarrating.com/"><img src="http://tavie.onsenfout.com/wp-content/plugins/gd-star-rating/gfx/powered.png" border="0" width="80" height="15" /></a><br />]]></content:encoded>
			<wfw:commentRss>http://tavie.onsenfout.com/2011/11/08/virtualbox-erreur-dacces-au-sous-systeme-usb/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Supprimer les mots de passe réseau enregistrés sous Windows</title>
		<link>http://tavie.onsenfout.com/2011/09/16/supprimer-les-mots-de-passe-reseau-enregistres-sous-windows/</link>
		<comments>http://tavie.onsenfout.com/2011/09/16/supprimer-les-mots-de-passe-reseau-enregistres-sous-windows/#comments</comments>
		<pubDate>Fri, 16 Sep 2011 11:17:14 +0000</pubDate>
		<dc:creator>François</dc:creator>
				<category><![CDATA[Bits]]></category>
		<category><![CDATA[mots de passe]]></category>
		<category><![CDATA[réseau]]></category>
		<category><![CDATA[vista]]></category>
		<category><![CDATA[windows]]></category>
		<category><![CDATA[Windows 7]]></category>
		<category><![CDATA[windows XP]]></category>

		<guid isPermaLink="false">http://tavie.onsenfout.com/?p=957</guid>
		<description><![CDATA[Un petit mémo sur une commande que j&#8217;oublie toujours quand j&#8217;en ai besoin&#160;: Cliquer sur Démarrer / Exécuter, et taper control keymgr.dll Ça ouvre une interface graphique qui permet d&#8217;ajouter, modifier ou supprimer les identifiants d&#8217;accès aux ressources réseau. Bien pratique lorsque la case &#171;&#160;Mémoriser les informations&#160;&#187; a été cochée par erreur. La commande fonctionne [...]<br /><div><img src="http://tavie.onsenfout.com/wp-content/plugins/gd-star-rating/gfx.php?value=4.0" /></div><div>Rating: 4.0/<strong>5</strong> (1 vote cast)</div><br /><a target="_blank" href="http://www.gdstarrating.com/"><img src="http://tavie.onsenfout.com/wp-content/plugins/gd-star-rating/gfx/powered.png" border="0" width="80" height="15" /></a><br />]]></description>
			<content:encoded><![CDATA[<p>Un petit mémo sur une commande que j&#8217;oublie toujours quand j&#8217;en ai besoin&nbsp;: Cliquer sur Démarrer / Exécuter, et taper</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">control keymgr.dll</pre></div></div>

<p>Ça ouvre une interface graphique qui permet d&#8217;ajouter, modifier ou supprimer les identifiants d&#8217;accès aux ressources réseau. Bien pratique lorsque la case &laquo;&nbsp;Mémoriser les informations&nbsp;&raquo; a été cochée par erreur.<br />
<span id="more-957"></span><br />
La commande fonctionne sous Windows XP, Vista et Windows 7, avec des interfaces légèrement différentes&nbsp;:<br />
<div id="attachment_963" class="wp-caption aligncenter" style="width: 406px"><a href="http://tavie.onsenfout.com/wp-content/uploads/2011/09/control_keymgr.dll_xp.jpg"><img src="http://tavie.onsenfout.com/wp-content/uploads/2011/09/control_keymgr.dll_xp.jpg" alt="" title="control_keymgr.dll_xp" width="396" height="326" class="size-full wp-image-963" /></a><p class="wp-caption-text">sous Windows XP</p></div><br />
<div id="attachment_965" class="wp-caption aligncenter" style="width: 310px"><a href="http://tavie.onsenfout.com/wp-content/uploads/2011/09/control_keymgr.dll_w7.jpg"><img src="http://tavie.onsenfout.com/wp-content/uploads/2011/09/control_keymgr.dll_w7-300x265.jpg" alt="" title="control_keymgr.dll_w7" width="300" height="265" class="size-medium wp-image-965" /></a><p class="wp-caption-text">sous Windows 7</p></div></p>
<br /><div><img src="http://tavie.onsenfout.com/wp-content/plugins/gd-star-rating/gfx.php?value=4.0" /></div><div>Rating: 4.0/<strong>5</strong> (1 vote cast)</div><br /><a target="_blank" href="http://www.gdstarrating.com/"><img src="http://tavie.onsenfout.com/wp-content/plugins/gd-star-rating/gfx/powered.png" border="0" width="80" height="15" /></a><br />]]></content:encoded>
			<wfw:commentRss>http://tavie.onsenfout.com/2011/09/16/supprimer-les-mots-de-passe-reseau-enregistres-sous-windows/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Salade de Chou Pointu au Chorizo</title>
		<link>http://tavie.onsenfout.com/2011/07/06/salade-de-chou-pointu-au-chorizo/</link>
		<comments>http://tavie.onsenfout.com/2011/07/06/salade-de-chou-pointu-au-chorizo/#comments</comments>
		<pubDate>Wed, 06 Jul 2011 15:40:08 +0000</pubDate>
		<dc:creator>François</dc:creator>
				<category><![CDATA[Miam]]></category>
		<category><![CDATA[chorizo]]></category>
		<category><![CDATA[chou]]></category>
		<category><![CDATA[légumes]]></category>
		<category><![CDATA[salade]]></category>

		<guid isPermaLink="false">http://tavie.onsenfout.com/?p=919</guid>
		<description><![CDATA[Dans le panier de l&#8217;AMAP Stanislas dépose depuis deux semaines un chou pointu. C&#8217;est un joli petit chou, très chou en somme, je trouve que le goût se rapproche de celui du chou blanc, avec une texture plus délicate. Celui de cette semaine nous a régalé avec cette salade toute simple. &#160;<br /><div><img src="http://tavie.onsenfout.com/wp-content/plugins/gd-star-rating/gfx.php?value=0.0" /></div><div>Rating: 0.0/<strong>5</strong> (0 votes cast)</div><br /><a target="_blank" href="http://www.gdstarrating.com/"><img src="http://tavie.onsenfout.com/wp-content/plugins/gd-star-rating/gfx/powered.png" border="0" width="80" height="15" /></a><br />]]></description>
			<content:encoded><![CDATA[<p><a href="http://tavie.onsenfout.com/wp-content/uploads/2011/07/chou-pointu.jpg"><img src="http://tavie.onsenfout.com/wp-content/uploads/2011/07/chou-pointu.jpg" alt="Chou pointu" title="Chou pointu" width="300" height="300" class="size-full wp-image-920" /></a><br />
Dans le panier de l&#8217;<a href="http://www.reseau-amap.org/" title="Réseau AMAP" target="_blank">AMAP</a> Stanislas dépose depuis deux semaines un chou pointu. C&#8217;est un joli petit chou, très chou en somme, je trouve que le goût se rapproche de celui du chou blanc, avec une texture plus délicate. Celui de cette semaine nous a régalé avec cette salade toute simple.<span id="more-919"></span>
<p>&nbsp;</p>
<p><a href="http://tavie.onsenfout.com/wp-content/uploads/2011/07/salade-de-chou-pointu-au-chorizo.jpg"><img src="http://tavie.onsenfout.com/wp-content/uploads/2011/07/salade-de-chou-pointu-au-chorizo-300x188.jpg" alt="Salade de chou pointu au chorizo" title="Salade de chou pointu au chorizo" width="300" height="188" size-medium wp-image-937" /></a></p>
<h3>Pour 4 personnes</h3>
</p>
<ul>
<li>1 chou pointu</li>
<li>1 chorizo</li>
<li>1 oignon moyen</li>
<li>3 gousses d&#8217;ail</li>
<li>1 botte de cives ou de ciboulette</li>
<li>2 càs de vinaigre de Xérès</li>
<li>4 càs de bonne huile d&#8217;olive</li>
<li>Sel, poivre, piment doux (facultatif)</li>
</ul>
<p>&nbsp;</p>
<ol>
<li>Couper le chou en 4, enlever le coeur et les feuilles abîmées, et le couper en lanières. Émincer l&#8217;oignon, hacher finement les gousses d&#8217;ail. Couper le chorizo en petits cubes.</li>
<li>Dans un Wok ou une sauteuse faire revenir le chorizo à feu moyen pour qu&#8217;il rende sa graisse. Égoutter et réserver.</li>
<li>Faire revenir l&#8217;oignon dans la graisse du chorizo jusqu&#8217;à ce qu&#8217;il soit transparent. Ajouter le chou, le chorizo, l&#8217;ail et faire revenir quelque minutes pour que le chou s&#8217;attendrisse tout en restant croquant. En fin de cuisson ajouter le vinaigre, sel, poivre et piment doux, faire cuire une minute de plus. Ajouter l&#8217;huile d&#8217;olive et laisser refroidir. </li>
<li>Avant de servir parsemer de cives hachées.</li>
</ol>
<br /><div><img src="http://tavie.onsenfout.com/wp-content/plugins/gd-star-rating/gfx.php?value=0.0" /></div><div>Rating: 0.0/<strong>5</strong> (0 votes cast)</div><br /><a target="_blank" href="http://www.gdstarrating.com/"><img src="http://tavie.onsenfout.com/wp-content/plugins/gd-star-rating/gfx/powered.png" border="0" width="80" height="15" /></a><br />]]></content:encoded>
			<wfw:commentRss>http://tavie.onsenfout.com/2011/07/06/salade-de-chou-pointu-au-chorizo/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Consolidation des logs avec rsyslog, MySQL et LogAnalyser</title>
		<link>http://tavie.onsenfout.com/2011/07/05/consolidation-des-logs-avec-rsyslog-mysql-et-loganalyser/</link>
		<comments>http://tavie.onsenfout.com/2011/07/05/consolidation-des-logs-avec-rsyslog-mysql-et-loganalyser/#comments</comments>
		<pubDate>Tue, 05 Jul 2011 14:01:55 +0000</pubDate>
		<dc:creator>François</dc:creator>
				<category><![CDATA[Bits]]></category>
		<category><![CDATA[administration]]></category>
		<category><![CDATA[lenny]]></category>
		<category><![CDATA[loganalyser]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[rsyslog]]></category>
		<category><![CDATA[syslog]]></category>
		<category><![CDATA[wheezy]]></category>

		<guid isPermaLink="false">http://tavie.onsenfout.com/?p=898</guid>
		<description><![CDATA[Debian Lenny et Wheezy, Ubuntu Server 10.04 Dès qu&#8217;on a plus d&#8217;un serveur à gérer il est intéressant de pouvoir centraliser les logs des différentes machines pour en simplifier l&#8217;administration. C&#8217;est relativement facile avec rsyslog. Ce mini tuto va nous permettre de monter un serveur de logs sous Debian, les logs étant stockées dans une [...]<br /><div><img src="http://tavie.onsenfout.com/wp-content/plugins/gd-star-rating/gfx.php?value=0.0" /></div><div>Rating: 0.0/<strong>5</strong> (0 votes cast)</div><br /><a target="_blank" href="http://www.gdstarrating.com/"><img src="http://tavie.onsenfout.com/wp-content/plugins/gd-star-rating/gfx/powered.png" border="0" width="80" height="15" /></a><br />]]></description>
			<content:encoded><![CDATA[<p><em>Debian Lenny et Wheezy, Ubuntu Server 10.04</em></p>
<p>Dès qu&#8217;on a plus d&#8217;un serveur à gérer il est intéressant de pouvoir centraliser les logs des différentes machines pour en simplifier l&#8217;administration. C&#8217;est relativement facile avec <a href="http://www.rsyslog.com/">rsyslog</a>. Ce mini tuto va nous permettre de monter un serveur de logs sous Debian, les logs étant stockées dans une base MySQL.<br />
<span id="more-898"></span></p>
<h3>Configuration du serveur de logs</h3>
<p>Si ce n&#8217;est pas encore fait, installer et configurer les paquets mysql-client et mysql-server. On installe ensuite les pagets requis par rsyslog :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">aptitude</span> <span style="color: #c20cb9; font-weight: bold;">install</span> rsyslog rsyslog-doc rsyslog-mysql</pre></div></div>

<p>La configuration de rsyslog-mysql se fait automatiquement à la fin de l&#8217;installation par <a href="http://people.debian.org/~seanius/policy/dbconfig-common-using.html/">dbconfig</a>. Avec les options par défaut on aboutit à la création d&#8217;une base MySQL nommée <strong>Syslog</strong>, contenant 2 tables <strong>SystemEvents</strong> et <strong>SystemEventsProperties</strong>. L&#8217;utilisateur <strong>rsyslog@localhost</strong> aura le contrôle total sur cette base. Ces informations de connexion sont stockées dans <strong>/etc/rsyslog.d/mysql.conf</strong> :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">### Configuration file for rsyslog-mysql</span>
<span style="color: #666666; font-style: italic;">### Changes are preserved</span>
&nbsp;
<span style="color: #007800;">$ModLoad</span> ommysql
<span style="color: #000000; font-weight: bold;">*</span>.<span style="color: #000000; font-weight: bold;">*</span> :ommysql:localhost,Syslog,rsyslog,motdepasse</pre></div></div>

<p>On active ensuite la réception des logs distantes en éditant <strong>/etc/rsyslog.conf</strong> et en décommentant les lignes correspondantes :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># provides UDP syslog reception</span>
<span style="color: #007800;">$ModLoad</span> imudp
<span style="color: #007800;">$UDPServerRun</span> <span style="color: #000000;">514</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># provides TCP syslog reception</span>
<span style="color: #007800;">$ModLoad</span> imtcp
<span style="color: #007800;">$InputTCPServerRun</span> <span style="color: #000000;">514</span></pre></div></div>

<p>On redémarre le démon rsyslog :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>rsyslog restart</pre></div></div>

<p>Le serveur est maintenant configuré pour enregistrer les logs dans la base, et il écoute sur le port 514 les messages entrant. On peut vérifier que la table MySQL est bien alimentée avec les logs locales :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">mysql <span style="color: #660033;">-u</span> rsyslog <span style="color: #660033;">-p</span> <span style="color: #660033;">-Bsr</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;SELECT Message FROM SystemEvents LIMIT 0,20&quot;</span> Syslog</pre></div></div>

<p>Attention, si le serveur de logs se trouve derrière un routeur, il faudra penser a activer les règles NAT qui vont bien (redirection du traffic UDP et TCP 514->514 vers le serveur de logs).</p>
<h3>Configuration des serveurs distants</h3>
<p>Il faut maintenant configurer les autres serveurs pour qu&#8217;ils envoient leurs logs au serveur de log. Dans l&#8217;exemple j&#8217;utilise ici aussi rsyslog mais ça fonctionne aussi avec syslog ou syslog-ng (avec un paramétrage différent).</p>
<p>Installation du paquet :</p>

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

<p>Création d&#8217;un répertoire de travail</p>

<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: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>spool<span style="color: #000000; font-weight: bold;">/</span>rsyslog</pre></div></div>

<p>On ajoute les lignes suivantes à la fin du fichier <strong>/etc/rsyslog.conf</strong> (adapter l&#8217;adresse du serveur <img src='http://tavie.onsenfout.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> ):</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># Envoi des logs au serveur de logs</span>
<span style="color: #007800;">$WorkDirectory</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>spool<span style="color: #000000; font-weight: bold;">/</span>rsyslog  <span style="color: #666666; font-style: italic;"># default location for work (spool) files</span>
<span style="color: #007800;">$ActionQueueType</span> LinkedList   <span style="color: #666666; font-style: italic;"># use asynchronous processing</span>
<span style="color: #007800;">$ActionQueueFileName</span> srvrfwd  <span style="color: #666666; font-style: italic;"># set file name, also enables disk mode</span>
<span style="color: #007800;">$ActionResumeRetryCount</span> <span style="color: #660033;">-1</span>    <span style="color: #666666; font-style: italic;"># infinite retries on insert failure</span>
<span style="color: #007800;">$ActionQueueSaveOnShutdown</span> on <span style="color: #666666; font-style: italic;"># save in-memory data if rsyslog shuts down</span>
<span style="color: #000000; font-weight: bold;">*</span>.<span style="color: #000000; font-weight: bold;">*</span>       <span style="color: #000000; font-weight: bold;">@@</span>adresse.du.serveur.de.logs:<span style="color: #000000;">514</span></pre></div></div>

<p>On redémarre le démon, et c&#8217;est tout :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>rsyslog restart</pre></div></div>

<h3>Installation de <a href="http://loganalyzer.adiscon.com/">LogAnalyser</a></h3>
<p>Retour au serveur de logs pour installer l&#8217;interface web <a href="http://loganalyzer.adiscon.com/">Adiscon LogAnalyser</a> qui va nous permettre de visualiser et d&#8217;analyser nos messages syslog. On suppose qu&#8217;un serveur Apache et PHP 5 sont déjà installés sur le serveur. A l&#8217;heure où j&#8217;écris la dernière version stable de LogAnalyser est la 3.2.1.</p>
<p>Téléchargement et décompression de l&#8217;archive:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>download.adiscon.com<span style="color: #000000; font-weight: bold;">/</span>loganalyzer<span style="color: #000000; font-weight: bold;">/</span>loganalyzer-3.2.1.tar.gz
<span style="color: #c20cb9; font-weight: bold;">tar</span> <span style="color: #660033;">-xvzf</span> loganalyzer-3.2.1.tar.gz</pre></div></div>

<p>On crée un répertoire loganalyser à la racine du serveur web:</p>

<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: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>loganalyser</pre></div></div>

<p>On copie les fichiers LogAnalyser requis dans ce répertoire:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #660033;">-a</span> loganalyzer-3.2.1<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/*</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>loganalyser</pre></div></div>

<p>On rend le user Apache propriétaire du dossier:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">chown</span> <span style="color: #660033;">-R</span> www-data:www-data <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>loganalyser</pre></div></div>

<p>Avec un navigateur on se rend ensuite à l&#8217;adresse <strong>http://adresse.du.serveur.de.logs/loganalyser</strong> et on configure LogAnalyser en suivant les instructions de l&#8217;assistant.<br />
Consulter le fichier <strong>/var/www/loganalyser/INSTALL</strong> pour des instructions détaillées si besoin.</p>
<p>Une remarque pour conclure, la table MySQL <strong>SystemEvents</strong> peut se remplir rapidement et devenir très volumineuse. Un petit script de purge placé en cron permettra d&#8217;éviter les mauvaises surprises:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
<span style="color: #666666; font-style: italic;"># Purge mensuelle des logs de la base MySQL Syslog</span>
<span style="color: #007800;">RETENTION</span>=<span style="color: #000000;">180</span> <span style="color: #666666; font-style: italic;"># Durée de rétention des logs (en jours)</span>
<span style="color: #666666; font-style: italic;"># Paramètres MySQL</span>
<span style="color: #007800;">MYSQL_HOST</span>=<span style="color: #ff0000;">&quot;localhost&quot;</span>
<span style="color: #007800;">MYSQL_DB</span>=<span style="color: #ff0000;">&quot;Syslog&quot;</span>
<span style="color: #007800;">MYSQL_USER</span>=<span style="color: #ff0000;">&quot;rsyslog&quot;</span>
<span style="color: #007800;">MYSQL_PASSWD</span>=<span style="color: #ff0000;">&quot;motdepasse&quot;</span>
<span style="color: #666666; font-style: italic;"># Suppression des enregistrements MySQL</span>
<span style="color: #007800;">sql</span>=<span style="color: #ff0000;">&quot;DELETE FROM SystemEvents WHERE DATEDIFF(NOW(), DeviceReportedTime) &gt; <span style="color: #007800;">$RETENTION</span>&quot;</span>
mysql <span style="color: #660033;">-h</span> <span style="color: #007800;">$MYSQL_HOST</span> <span style="color: #660033;">-u</span> <span style="color: #007800;">$MYSQL_USER</span> -p<span style="color: #007800;">$MYSQL_PASSWD</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$sql</span>&quot;</span> <span style="color: #660033;">-B</span> <span style="color: #660033;">-s</span> <span style="color: #007800;">$MYSQL_DB</span></pre></div></div>

<h3>Liens</h3>
<p><a href="http://www.rsyslog.com/using-the-syslog-receiver-module/">Using the syslog receiver module</a><br />
<a href="http://www.rsyslog.com/doc/rsyslog_reliable_forwarding.html">Reliable Forwarding of syslog Messages with Rsyslog</a><br />
<a href="http://www.rsyslog.com/doc/rsyslog_mysql.html">Writing syslog messages to MySQL</a></p>
<br /><div><img src="http://tavie.onsenfout.com/wp-content/plugins/gd-star-rating/gfx.php?value=0.0" /></div><div>Rating: 0.0/<strong>5</strong> (0 votes cast)</div><br /><a target="_blank" href="http://www.gdstarrating.com/"><img src="http://tavie.onsenfout.com/wp-content/plugins/gd-star-rating/gfx/powered.png" border="0" width="80" height="15" /></a><br />]]></content:encoded>
			<wfw:commentRss>http://tavie.onsenfout.com/2011/07/05/consolidation-des-logs-avec-rsyslog-mysql-et-loganalyser/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Configuration snmp sous Debian Squeeze</title>
		<link>http://tavie.onsenfout.com/2011/07/01/configuration-snmp-sous-debian-squeeze/</link>
		<comments>http://tavie.onsenfout.com/2011/07/01/configuration-snmp-sous-debian-squeeze/#comments</comments>
		<pubDate>Fri, 01 Jul 2011 17:25:23 +0000</pubDate>
		<dc:creator>François</dc:creator>
				<category><![CDATA[Bits]]></category>
		<category><![CDATA[cacti]]></category>
		<category><![CDATA[lm-sensors]]></category>
		<category><![CDATA[monitoring]]></category>
		<category><![CDATA[snmp]]></category>
		<category><![CDATA[snmpd]]></category>
		<category><![CDATA[squeeze]]></category>
		<category><![CDATA[wheezy]]></category>

		<guid isPermaLink="false">http://tavie.onsenfout.com/?p=890</guid>
		<description><![CDATA[Debian 6.0.2 Squeeze Depuis le passage à Debian Squeeze mes monitorings Cacti basés sur lm-sensors (température, ventilateurs, voltage) ne fonctionnaient plus. Il y a eu des modifications dans le paquet snmpd et les MIBS qui permettent de convertir les OID en langage clair doivent être téléchargées séparément. Il y a aussi quelques petites modifs de [...]<br /><div><img src="http://tavie.onsenfout.com/wp-content/plugins/gd-star-rating/gfx.php?value=0.0" /></div><div>Rating: 0.0/<strong>5</strong> (0 votes cast)</div><br /><a target="_blank" href="http://www.gdstarrating.com/"><img src="http://tavie.onsenfout.com/wp-content/plugins/gd-star-rating/gfx/powered.png" border="0" width="80" height="15" /></a><br />]]></description>
			<content:encoded><![CDATA[<p><em>Debian 6.0.2 Squeeze</em></p>
<p>Depuis le passage à Debian Squeeze mes <a href="http://www.eric-a-hall.com/software/cacti-netsnmp-lmsensors/">monitorings Cacti basés sur lm-sensors</a> (température, ventilateurs, voltage) ne fonctionnaient plus. Il y a eu des modifications dans le paquet snmpd et les <a href="http://www.net-snmp.org/docs/mibs/">MIBS</a> qui permettent de convertir les OID en langage clair doivent être téléchargées séparément. Il y a aussi quelques petites modifs de configuration à faire :<br />
<span id="more-890"></span></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">aptitude</span> <span style="color: #c20cb9; font-weight: bold;">install</span> snmp-mibs-downloader</pre></div></div>

<p>Ce paquet est dans les dépôts <strong>non-free</strong>. A la fin de l&#8217;installation du paquet les MIBS sont téléchargées dans le répertoire /usr/share/mibs</p>
<p>Il reste à faire 2 modifs dans les fichiers de config :</p>
<h3>Dans /etc/default/snmpd</h3>
<p>Commenter la ligne export MIBDIRS, ajouter l&#8217;export de toutes les MIBS. On peut être plus sélectif, dans ce cas à la place de <strong>ALL</strong> lister les MIBS requises séparées par deux points <strong>&#8216;:&#8217;</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># export MIBDIRS=/usr/share/snmp/mibs</span>
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">MIBS</span>=ALL</pre></div></div>

<h3>Dans /etc/snmp/snmp.conf</h3>
<p>commenter la ligne mibs:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># mibs</span></pre></div></div>

<p>On redémarre smtpd :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>snmpd restart</pre></div></div>

<p>On vérifie que tout ça fonctionne :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">snmpwalk <span style="color: #660033;">-v</span> 2c <span style="color: #660033;">-c</span> public localhost system</pre></div></div>

<p>Et les jolis graphes Cacti sont de retour!</p>
<br /><div><img src="http://tavie.onsenfout.com/wp-content/plugins/gd-star-rating/gfx.php?value=0.0" /></div><div>Rating: 0.0/<strong>5</strong> (0 votes cast)</div><br /><a target="_blank" href="http://www.gdstarrating.com/"><img src="http://tavie.onsenfout.com/wp-content/plugins/gd-star-rating/gfx/powered.png" border="0" width="80" height="15" /></a><br />]]></content:encoded>
			<wfw:commentRss>http://tavie.onsenfout.com/2011/07/01/configuration-snmp-sous-debian-squeeze/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Autologin sous Debian Wheezy</title>
		<link>http://tavie.onsenfout.com/2011/06/17/autologin-sous-debian-wheezy/</link>
		<comments>http://tavie.onsenfout.com/2011/06/17/autologin-sous-debian-wheezy/#comments</comments>
		<pubDate>Fri, 17 Jun 2011 11:51:56 +0000</pubDate>
		<dc:creator>François</dc:creator>
				<category><![CDATA[Bits]]></category>
		<category><![CDATA[autologin]]></category>
		<category><![CDATA[gdm]]></category>
		<category><![CDATA[wheezy]]></category>

		<guid isPermaLink="false">http://tavie.onsenfout.com/?p=860</guid>
		<description><![CDATA[Debian Wheezy 6.0.1 amd64 Il y a un bug du programme gdmsetup sous Debian Wheezy qui empêche de déverrouiller l&#8217;accès aux options de connexion automatique. On peut contourner le problème en éditant en tant que root le fichier /etc/gdm3/daemon.conf et en modifiant la section daemon. Pour ouvrir automatiquement la session de l&#8217;utilisateur toto on mettra [...]<br /><div><img src="http://tavie.onsenfout.com/wp-content/plugins/gd-star-rating/gfx.php?value=5.0" /></div><div>Rating: 5.0/<strong>5</strong> (1 vote cast)</div><br /><a target="_blank" href="http://www.gdstarrating.com/"><img src="http://tavie.onsenfout.com/wp-content/plugins/gd-star-rating/gfx/powered.png" border="0" width="80" height="15" /></a><br />]]></description>
			<content:encoded><![CDATA[<p><em>Debian Wheezy 6.0.1 amd64</em></p>
<p>Il y a un <a href="http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=622234" target="_blank">bug du programme gdmsetup</a> sous Debian Wheezy qui empêche de déverrouiller l&#8217;accès aux options de connexion automatique. </p>
<p>On peut contourner le problème en éditant en tant que root le fichier /etc/gdm3/daemon.conf et en modifiant la section daemon.</p>
<p>Pour ouvrir automatiquement la session de l&#8217;utilisateur toto on mettra :</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">[daemon]
AutomaticLoginEnable=true
AutomaticLogin=toto</pre></div></div>

<h3>lien</h3>
<p><a href="http://www.phwinfo.com/forum/linux-debian-user/499081-gdmsetup-cant-unlock-problem-any-workaround.html" target="_blank">gdmsetup can&#8217;t unlock problem: any workaround?</a></p>
<br /><div><img src="http://tavie.onsenfout.com/wp-content/plugins/gd-star-rating/gfx.php?value=5.0" /></div><div>Rating: 5.0/<strong>5</strong> (1 vote cast)</div><br /><a target="_blank" href="http://www.gdstarrating.com/"><img src="http://tavie.onsenfout.com/wp-content/plugins/gd-star-rating/gfx/powered.png" border="0" width="80" height="15" /></a><br />]]></content:encoded>
			<wfw:commentRss>http://tavie.onsenfout.com/2011/06/17/autologin-sous-debian-wheezy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flan aux courgettes et aux fèves</title>
		<link>http://tavie.onsenfout.com/2011/06/14/flan-aux-courgettes-et-aux-feves/</link>
		<comments>http://tavie.onsenfout.com/2011/06/14/flan-aux-courgettes-et-aux-feves/#comments</comments>
		<pubDate>Tue, 14 Jun 2011 10:04:18 +0000</pubDate>
		<dc:creator>François</dc:creator>
				<category><![CDATA[Miam]]></category>
		<category><![CDATA[courgettes]]></category>
		<category><![CDATA[fèves]]></category>
		<category><![CDATA[flan]]></category>
		<category><![CDATA[légumes]]></category>
		<category><![CDATA[oeufs]]></category>

		<guid isPermaLink="false">http://tavie.onsenfout.com/?p=813</guid>
		<description><![CDATA[Conséquence assez prévisible de l&#8217;inscription à une AMAP il y a un mois de ça, le bac à légumes du frigo ne désemplit pas. Dans le panier de la semaine il y avait des courgettes et des fèves qui ne voulaient pas se quitter. Pour 4 personnes 300-400 g de courgettes 200 g de fèves [...]<br /><div><img src="http://tavie.onsenfout.com/wp-content/plugins/gd-star-rating/gfx.php?value=0.0" /></div><div>Rating: 0.0/<strong>5</strong> (0 votes cast)</div><br /><a target="_blank" href="http://www.gdstarrating.com/"><img src="http://tavie.onsenfout.com/wp-content/plugins/gd-star-rating/gfx/powered.png" border="0" width="80" height="15" /></a><br />]]></description>
			<content:encoded><![CDATA[<p>Conséquence assez prévisible de l&#8217;inscription à une <a href="http://www.reseau-amap.org/" target="_blank">AMAP</a> il y a un mois de ça, le bac à légumes du frigo ne désemplit pas. Dans le panier de la semaine il y avait des courgettes et des fèves qui ne voulaient pas se quitter.<br />
<span id="more-813"></span></p>
<h3>Pour 4 personnes</h3>
<p style="text-align: center;"><a href="http://tavie.onsenfout.com/wp-content/uploads/2011/06/flan_aux_courgettes_et_aux_fèves.jpg"><img src="http://tavie.onsenfout.com/wp-content/uploads/2011/06/flan_aux_courgettes_et_aux_fèves-300x191.jpg" alt="Flan aux courgettes et aux fèves" title="Flan aux courgettes et aux fèves" width="300" height="191" class="aligncenter size-medium wp-image-848" /></a></p>
<ul>
<li>300-400 g de courgettes</li>
<li>200 g de fèves écossées</li>
<li>200g de jambon cru effiloché</li>
<li>4 oeufs</li>
<li>15 cl de lait</li>
<li>15 cl de crème fraîche épaisse</li>
<li>100 g de fromage râpé (comté, emmental, parmesan,&#8230;)  </li>
<li>2 cuillères à soupe de Maïzena (s&#8217;il en reste une centaine de kilos après la recette on peut faire <a href="http://www.youtube.com/watch?gl=FR&#038;hl=fr&#038;hl=fr&#038;v=f2XQ97XHjVw" target="_blank">des trucs rigolos</a> avec)</li>
<li>Cumin moulu, sel, poivre</li>
</ul>
<p></p>
<ol>
<li>Laver les courgettes, les couper en dés et les faire cuire quelques minutes à la vapeur, elles doivent rester fermes. Égoutter et assaisonner avec sel, poivre et une pincée de cumin moulu.</li>
<li>Ébouillanter les fèves une minute et enlever la petite peau qui les recouvre, c&#8217;est pas le moment le plus fun de la recette.</li>
<li>Poêler rapidement le jambon à feu vif.</li>
<li>Dans un saladier délayer la Maïzena dans le lait et incorporer les oeufs, la crème, le fromage, le jambon et les légumes. Saler, poivrer.</li>
<li>Verser dans un plat à gratin beurré et faire cuire 30 à 45 mn au four à 200° (th 7). Vérifier la cuisson avec la lamme d&#8217;un couteau. Si le flan est bien gratiné mais pas encore complètement pris on peut terminer la cuisson au micro-ondes.
</ol>
<br /><div><img src="http://tavie.onsenfout.com/wp-content/plugins/gd-star-rating/gfx.php?value=0.0" /></div><div>Rating: 0.0/<strong>5</strong> (0 votes cast)</div><br /><a target="_blank" href="http://www.gdstarrating.com/"><img src="http://tavie.onsenfout.com/wp-content/plugins/gd-star-rating/gfx/powered.png" border="0" width="80" height="15" /></a><br />]]></content:encoded>
			<wfw:commentRss>http://tavie.onsenfout.com/2011/06/14/flan-aux-courgettes-et-aux-feves/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Authentification Apache avec une table MySQL d&#8217;utilisateurs</title>
		<link>http://tavie.onsenfout.com/2011/05/28/authentification-apache-avec-une-table-mysql-dutilisateurs/</link>
		<comments>http://tavie.onsenfout.com/2011/05/28/authentification-apache-avec-une-table-mysql-dutilisateurs/#comments</comments>
		<pubDate>Sat, 28 May 2011 10:22:56 +0000</pubDate>
		<dc:creator>François</dc:creator>
				<category><![CDATA[Bits]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[authentification]]></category>
		<category><![CDATA[cryptage]]></category>
		<category><![CDATA[dbd]]></category>
		<category><![CDATA[MD5]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[SHA1]]></category>
		<category><![CDATA[webdav]]></category>

		<guid isPermaLink="false">http://tavie.onsenfout.com/?p=763</guid>
		<description><![CDATA[Debian 6.0.1 Squeeze &#8211; Apache 2.2.16 &#8211; MySQL Server 5.1.49 Objectif : Réaliser l&#8217;authentification basique Apache pour un Webdav avec une base d&#8217;utilisateurs en MySQL, et le mot de passe stocké avec un cryptage non réversible dans la base. J&#8217;ai un peu galéré dans cette affaire, les infos qu&#8217;on trouve ne sont pas forcément d&#8217;actualité, [...]<br /><div><img src="http://tavie.onsenfout.com/wp-content/plugins/gd-star-rating/gfx.php?value=0.0" /></div><div>Rating: 0.0/<strong>5</strong> (0 votes cast)</div><br /><a target="_blank" href="http://www.gdstarrating.com/"><img src="http://tavie.onsenfout.com/wp-content/plugins/gd-star-rating/gfx/powered.png" border="0" width="80" height="15" /></a><br />]]></description>
			<content:encoded><![CDATA[<p><em>Debian 6.0.1 Squeeze &#8211; Apache 2.2.16 &#8211; MySQL Server 5.1.49</em></p>
<p>Objectif : Réaliser l&#8217;authentification basique Apache pour un Webdav avec une base d&#8217;utilisateurs en MySQL, et le mot de passe stocké avec un cryptage non réversible dans la base. J&#8217;ai un peu galéré dans cette affaire, les infos qu&#8217;on trouve ne sont pas forcément d&#8217;actualité, voici donc un petit topo.<br />
<span id="more-763"></span><br />
On commence par installer le paquet qui va bien pour qu&#8217;Apache puisse causer gentiment à MySQL via dbd :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">aptitude</span> <span style="color: #c20cb9; font-weight: bold;">install</span> libaprutil1-dbd-mysql</pre></div></div>

<p>Ensuite on active le <a href="http://httpd.apache.org/docs/2.2/mod/mod_dbd.html" target="_blank">module d&#8217;authentification dbd</a> :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">a2enmod authn_dbd
apache2ctl restart</pre></div></div>

<p>Création de la base sous MySQL. Pour faire simple la table utilisateurs ne comprend que 2 champs, login et pass:</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;">DATABASE</span> mabase CHARACTER <span style="color: #990099; font-weight: bold;">SET</span> UTF8<span style="color: #000033;">;</span>
<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;">`utilisateurs`</span> <span style="color: #FF00FF;">&#40;</span> 
      <span style="color: #008000;">`login`</span> <span style="color: #999900; font-weight: bold;">varchar</span><span style="color: #FF00FF;">&#40;</span><span style="color: #008080;">255</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: #000033;">,</span>  
      <span style="color: #008000;">`pass`</span> <span style="color: #999900; font-weight: bold;">varchar</span><span style="color: #FF00FF;">&#40;</span><span style="color: #008080;">255</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: #000033;">,</span>  
      <span style="color: #FF9900; font-weight: bold;">UNIQUE</span> <span style="color: #990099; font-weight: bold;">KEY</span> <span style="color: #008000;">`login`</span> <span style="color: #FF00FF;">&#40;</span><span style="color: #008000;">`login`</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>utf8<span style="color: #000033;">;</span></pre></div></div>

<p>Toujours sous MySQL on crée un utilisateur &laquo;&nbsp;apache&nbsp;&raquo; avec des droits limités à la table :</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: #000099;">USER</span> <span style="color: #008000;">'apache'</span>@<span style="color: #008000;">'localhost'</span> IDENTIFIED BY  <span style="color: #008000;">'secret'</span><span style="color: #000033;">;</span>
<span style="color: #990099; font-weight: bold;">GRANT</span> <span style="color: #990099; font-weight: bold;">SELECT</span> <span style="color: #990099; font-weight: bold;">ON</span>  <span style="color: #008000;">`mabase`</span>.<span style="color: #008000;">`utilisateurs`</span> <span style="color: #990099; font-weight: bold;">TO</span>  <span style="color: #008000;">'apache'</span>@<span style="color: #008000;">'localhost'</span><span style="color: #000033;">;</span></pre></div></div>

<p>Ensuite on remplit la table MySQL et c&#8217;est là qu&#8217;il faut faire les bons choix pour le cryptage du mot de passe et ne pas se gourer. <a href="http://httpd.apache.org/docs/current/misc/password_encryptions.html">Apache reconnait 4 formats de mots de passe</a> : PLAIN TEXT, CRYPT, SHA1 et MD5.<br />
PLAIN TEXT est clairement à éviter, SHA1 et MD5 sont les plus robustes. Entre les deux SHA1 serait potentiellement le meilleur sauf que l&#8217;implémentation Apache est à priori faiblarde (pas de &laquo;&nbsp;grain de sel&nbsp;&raquo;) donc j&#8217;ai retenu MD5, mais ça reste un choix qu&#8217;on peut discuter le soir au coin du feu.</p>
<p>En tout cas, et quel que soit le cryptage choisi, la première chose à ne pas faire c&#8217;est d&#8217;utiliser les fonctions de cryptage de MySQL (password, MD5, SHA1), c&#8217;est complètement incompatible avec l&#8217;authentification Apache. Une fois qu&#8217;on a compris ça on a fait un grand pas!</p>
<p>On va donc générer en bash le hash MD5 du mot de passe avec l&#8217;utilitaire <a href="http://httpd.apache.org/docs/current/programs/htpasswd.html" target="_blank">htpasswd</a> fourni par Apache et l&#8217;enregistrer dans la base (la fonction htpasswd a surement été portée dans votre langage préféré). </p>
<p>Le cryptage est en MD5 par défaut, les options <code>-n et -b</code> permettent respectivement de rediriger le résultat vers la sortie standard et d&#8217;utiliser le mode batch :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">mysql <span style="color: #660033;">-u</span> admin <span style="color: #660033;">-p</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;INSERT INTO utilisateurs (login, pass) VALUES ( <span style="color: #000099; font-weight: bold;">\
</span>     &quot;</span><span style="color: #000000; font-weight: bold;">\&quot;</span><span style="color: #ff0000;">&quot;robert&quot;</span><span style="color: #000000; font-weight: bold;">\&quot;</span><span style="color: #ff0000;">&quot;, <span style="color: #000099; font-weight: bold;">\
</span>     &quot;</span><span style="color: #000000; font-weight: bold;">\&quot;</span><span style="color: #ff0000;">&quot;<span style="color: #007800;">$(htpasswd -nb robert secret |cut -d ':' -f 2)</span>&quot;</span><span style="color: #000000; font-weight: bold;">\&quot;</span><span style="color: #ff0000;">&quot;)&quot;</span> mabase</pre></div></div>

<p>On met ensuite à jour le Virtual Host pour qu&#8217;Apache puisse aller chercher les infos d&#8217;identification dans la base :</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">&lt;VirtualHost *:80&gt;
	ServerName webdav.mondomaine.org
	DocumentRoot /var/www/webdav
	...
	DBDriver mysql
	DBDParams &quot;socket=/var/run/mysqld/mysqld.sock dbname=mabase user=apache pass=secret&quot;
	DBDMin  4
	DBDKeep 8
	DBDMax  20
	DBDExptime 300
	...
	&lt;Directory /var/www/webdav&gt;
		...
		AuthName &quot;Webdav&quot;
		AuthType Basic
		AuthBasicProvider dbd
		# Requete SQL pour l'authentification
		AuthDBDUserPWQuery &quot;SELECT pass FROM utilisateurs WHERE login = %s&quot; 
		Require valid-user
	&lt;/Directory&gt;
	...
&lt;/VirtualHost&gt;</pre></div></div>

<p>et on redémarre Apache :</p>

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

<h3> Liens</h3>
<p><a href="http://httpd.apache.org/docs/2.3/fr/howto/auth.html" target="_blank>Authentification, autorisation et contrôle d&#8217;accès</a><br />
<a href="http://www.loicmorvan.fr/2010/01/php-comparaison-md5-sha-1/" target="_blank">PHP : Comparaison MD5 / SHA-1</a></p>
<br /><div><img src="http://tavie.onsenfout.com/wp-content/plugins/gd-star-rating/gfx.php?value=0.0" /></div><div>Rating: 0.0/<strong>5</strong> (0 votes cast)</div><br /><a target="_blank" href="http://www.gdstarrating.com/"><img src="http://tavie.onsenfout.com/wp-content/plugins/gd-star-rating/gfx/powered.png" border="0" width="80" height="15" /></a><br />]]></content:encoded>
			<wfw:commentRss>http://tavie.onsenfout.com/2011/05/28/authentification-apache-avec-une-table-mysql-dutilisateurs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

