<?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! &#187; Bits</title>
	<atom:link href="http://tavie.onsenfout.com/category/informatique/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>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>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>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>
		<item>
		<title>Dossiers Webdav Apache et Windows 7</title>
		<link>http://tavie.onsenfout.com/2011/05/27/dossiers-webdav-apache-et-windows-7/</link>
		<comments>http://tavie.onsenfout.com/2011/05/27/dossiers-webdav-apache-et-windows-7/#comments</comments>
		<pubDate>Fri, 27 May 2011 00:15:49 +0000</pubDate>
		<dc:creator>François</dc:creator>
				<category><![CDATA[Bits]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[authentification digest]]></category>
		<category><![CDATA[Bitkinex]]></category>
		<category><![CDATA[htdigest]]></category>
		<category><![CDATA[lenny]]></category>
		<category><![CDATA[ssl]]></category>
		<category><![CDATA[webdav]]></category>
		<category><![CDATA[Windows 7]]></category>

		<guid isPermaLink="false">http://tavie.onsenfout.com/?p=735</guid>
		<description><![CDATA[Serveur Debian Lenny &#8211; Apache 2.2.9 avec mod_dav Clients Windows 7 32 et 64 bits Microsoft n&#8217;aime décidément pas les dossiers Webdav, surtout quand ils sont servis par un serveur non MS, Apache par exemple. Sous Windows 7, si on essaie d&#8217;ouvrir un dossier Webdav servi par Apache avec l&#8217;authentification basique, on obtient l&#8217;erreur Le [...]<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>Serveur Debian Lenny &#8211; Apache 2.2.9 avec mod_dav<br />
Clients Windows 7 32 et 64 bits<br />
</em><br />
Microsoft n&#8217;aime décidément pas les dossiers Webdav, surtout quand ils sont servis par un serveur non MS, Apache par exemple. Sous Windows 7, si on essaie d&#8217;ouvrir un dossier Webdav servi par Apache avec l&#8217;authentification basique, on obtient l&#8217;erreur <em><strong>Le dossier que vous avez entré ne semble pas être valide. Choisissez-en un autre</strong></em>. J&#8217;aime beaucoup les messages d&#8217;erreur Windows, c&#8217;est bon de se sentir aidé&#8230;</p>
<p>Le problème est lié au type d&#8217;authentification utilisé par Apache, l&#8217;authentification basique (AuthType Basic) n&#8217;est pas supportée par Windows 7. En http on pourrait comprendre pour des raisons de sécurité, le mot de passe est transmis en clair, mais en https c&#8217;est pareil alors que la connexion est cryptée dans un tunnel SSL. Il y avait déjà eu le même problème avec Vista, <a href="http://www.microsoft.com/downloads/en/details.aspx?familyid=17c36612-632e-4c04-9382-987622ed1d64&#038;displaylang=en" target="_blank">réglé par un patch</a>, mais pour l&#8217;instant rien ne s&#8217;annonce pour Windows 7. </p>
<p>Que peut-on faire?<br />
<span id="more-735"></span></p>
<h3>Côté poste client</h3>
<p>Si on n&#8217;a pas accès à la configuration du serveur, il y a des clients Webdav qui permettent de contourner le problème, <a href="http://www.bitkinex.com/" target="_blank">Bitkinex</a> semble avoir la cote actuellement mais je ne l&#8217;ai pas testé.</p>
<p>Sur le poste client Windows 7 on peut aussi autoriser l&#8217;authentification basique en donnant la valeur <strong>2</strong> à la clé de registre suivante :</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WebClient\Parameters\BasicAuthLevel</pre></div></div>

<h3>Coté serveur</h3>
<p>Apache propose un autre mode d&#8217;authentification, <a href="http://httpd.apache.org/docs/2.2/fr/mod/mod_auth_digest.html" target="_blank">digest</a>, basé sur les condensés MD5, à priori plus sécurisé et accepté par les clients intégrés à Windows 7, Vista et XP. Par contre cette méthode d&#8217;authentification n&#8217;est pas forcément implémentée dans les anciens navigateurs.</p>
<p>Activation du module auth_digest :</p>

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

<p>Un exemple de config Apache :</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">Dav on
&lt;Location /webdav/&gt;
AuthType digest
AuthName &quot;monwebdav&quot;
AuthDigestDomain /webdav/ http://mondomaine/webdav/
AuthDigestProvider file
AuthUserFile /www/auth/webdav
Require valid-user
&lt;/Location&gt;</pre></div></div>

<p>Pour créer le fichier des utilisateurs, ici /www/auth/webdav avec le premier utilisateur toto, on utilise <a href="http://www.manpagez.com/man/1/htdigest/">htdigest</a> :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">htdigest <span style="color: #660033;">-c</span> <span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>auth<span style="color: #000000; font-weight: bold;">/</span>webdav monwebdav toto</pre></div></div>

<p>Le &laquo;&nbsp;realm&nbsp;&raquo; de htdigest doit correspondre à la directive AuthName, ici c&#8217;est &laquo;&nbsp;monwebdav&nbsp;&raquo;.</p>
<p>Pour les utilisateurs suivants on enlèvera le -c :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">htdigest <span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>auth<span style="color: #000000; font-weight: bold;">/</span>webdav monwebdav turlututu</pre></div></div>

<h3>Liens</h3>
<p><a href="http://shon.org/blog/2010/03/04/howto-fix-windows-7-64bit-webdav/" target="_blank">How to fix Windows 7 64 bits Webdav</a><br />
<a href="http://www.webdavsystem.com/server/documentation/authentication/basic_auth_vista" target="_blank">Using Basic Authentication with Windows 7 and Windows Vista WebDAV Client</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/27/dossiers-webdav-apache-et-windows-7/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installer un certificat numérique sous Outlook</title>
		<link>http://tavie.onsenfout.com/2011/05/24/installer-un-certificat-numerique-sous-outlook/</link>
		<comments>http://tavie.onsenfout.com/2011/05/24/installer-un-certificat-numerique-sous-outlook/#comments</comments>
		<pubDate>Tue, 24 May 2011 11:53:46 +0000</pubDate>
		<dc:creator>François</dc:creator>
				<category><![CDATA[Bits]]></category>
		<category><![CDATA[certificat]]></category>
		<category><![CDATA[messagerie]]></category>
		<category><![CDATA[outlook]]></category>
		<category><![CDATA[outlook 2007]]></category>
		<category><![CDATA[outlook express]]></category>
		<category><![CDATA[sécurité]]></category>
		<category><![CDATA[signature électronique]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[windows mail]]></category>

		<guid isPermaLink="false">http://tavie.onsenfout.com/?p=711</guid>
		<description><![CDATA[Pour faire suite à l&#8217;installation de certificat sous Thunderbird, un petit topo sur l&#8217;installation sous Outlook. Le principe est le même pour Outlook Express et Windows Mail, qui utilisent eux aussi le magasin de certificats Windows. Comme précédemment on utilisera un certificat Comodo pour se simplifier la vie. Etape 1 : La demande de certificat [...]<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>Pour faire suite à <a href="/2011/05/16/installer-un-certificat-sous-thunderbird/" target="_blank">l&#8217;installation de certificat sous Thunderbird</a>, un petit topo sur l&#8217;installation sous Outlook. Le principe est le même pour Outlook Express et Windows Mail, qui utilisent eux aussi le magasin de certificats Windows. Comme précédemment on utilisera un certificat Comodo pour se simplifier la vie.<br />
<span id="more-711"></span></p>
<h3>Etape 1 : La demande de certificat</h3>
<p>La demande de certificat doit être faite avec Internet Explorer, c&#8217;est bien plus simple. Aller sur la page <a href="http://www.comodo.com/home/email-security/free-email-certificate.php" target="_blank">Free Secure Email Certificate</a> et cliquer sur le bouton <strong><em>Free Download</em></strong>. Si la barre d&#8217;information d&#8217;IE affiche <strong><em>Ce site Web souhaite exécuter le module complémentaire &laquo;&nbsp;Microsoft Certificate Enrollment Control&nbsp;&raquo;&#8230;</em></strong>, cliquer sur la barre, choisir <strong><em>Exécuter le module complémentaire</em></strong>, puis <strong><em>Exécuter</em></strong>. Valider de la même façon les éventuels messages de demande d&#8217;autorisation. Entrer le prénom, le nom, l&#8217;adresse email pour laquelle on veut le certificat, le pays, laisser les options par défaut. Saisir un mot de passe pour pouvoir éventuellement révoquer le certificat, décocher (ou pas) la case &laquo;&nbsp;Opt-in&nbsp;&raquo; pour la newsletter de Comodo, accepter les conditions, valider, et accepter les demandes d&#8217;autorisation.</p>
<h3>Etape 2 : Installer le certificat</h3>
<p>Lorsque le message <strong><em>Your certificate is ready for collection</em></strong> est arrivé dans la boite à lettres, cliquer sur le lien <strong><em>Click &#038; Install Comodo Email Certificate</em></strong> si Internet Explorer est le navigateur par défaut, sinon copier l&#8217;adresse du lien et la coller dans la barre d&#8217;adresse de IE. Accepter les demandes d&#8217;autorisation. Si <strong><em>Successful</em></strong> s&#8217;affiche sur la page le certificat est installé dans le magasin Windows.</p>
<h3>Etape 3 : Sauvegarder le certificat</h3>
<p>Cette étape n&#8217;est pas nécessaire pour l&#8217;utilisation du certificat mais elle est vivement recommandée pour pouvoir réinstaller le certificat en cas de problème.</p>
<p>Sous Internet Explorer aller dans <strong><em>Outils</em></strong> puis <strong><em>Options Internet</em></strong> et onglet <strong><em>Contenu</em></strong>. Cliquer sur le bouton <strong><em>Certificats</em></strong>, le certificat demandé doit apparaître dans l&#8217;onglet <strong><em>Personnel</em></strong>. Le selectionner et cliquer sur <strong><em>Exporter</em></strong>. Choisir d&#8217;exporter la clé privée, laisser les options par défaut, saisir un mot de passe robuste, choisir un nom de fichier et un emplacement et valider. Il est recommandé de stocker ce certificat en lieu sur.</p>
<h3>Etape 4 : Associer le certificat au compte de messagerie</h3>
<p>L&#8217;emplacement des options peut varier selon les versions d&#8217;Outlook. Pour Outlook 2007 aller dans <strong><em>Outils</em></strong>, puis <strong><em>Centre de gestion de la confidentialité</em></strong>, rubrique <strong><em>Sécurité de messagerie électronique</em></strong>. </p>
<p>Dans <strong><em>Courrier électronique chiffré</em></strong> cocher uniquement les cases <strong><em>Ajouter une signature numérique au message sortant</em></strong> et <strong><em>Envoyer le message signé en texte clair&#8230;</em></strong>. Cliquer sur le bouton <strong><em>Paramètres</em></strong>.</p>
<p>Dans <strong><em>Nom des paramètres de sécurité</em></strong> saisir l&#8217;adresse email. Cocher les 2 cases <strong><em>Paramètre de sécurité par défaut&#8230;</em></strong>. Cliquer sur le bouton <strong><em>Choisir</em></strong> à coté de <strong><em>Certificat de signature</em></strong>, et sélectionner le certificat, valider. Cocher la case <strong><em>Envoyer ces certificats avec le message signé</em></strong>, valider toutes les boites de dialogue.</p>
<p>C&#8217;est terminé, les messages envoyés seront tous signés avec le nouveau certificat numérique. Lors de la rédaction d&#8217;un message, 2 boutons permettent de gérer la signature et le chiffrement dans le groupe <strong><em>Options</em></strong> de l&#8217;onglet <strong><em>Message</em></strong></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/05/24/installer-un-certificat-numerique-sous-outlook/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Installer un certificat numérique sous Thunderbird</title>
		<link>http://tavie.onsenfout.com/2011/05/16/installer-un-certificat-sous-thunderbird/</link>
		<comments>http://tavie.onsenfout.com/2011/05/16/installer-un-certificat-sous-thunderbird/#comments</comments>
		<pubDate>Mon, 16 May 2011 01:17:12 +0000</pubDate>
		<dc:creator>François</dc:creator>
				<category><![CDATA[Bits]]></category>
		<category><![CDATA[cacert]]></category>
		<category><![CDATA[certificat]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[mail]]></category>
		<category><![CDATA[messagerie]]></category>
		<category><![CDATA[sécurité]]></category>
		<category><![CDATA[signature électronique]]></category>
		<category><![CDATA[thunderbird]]></category>

		<guid isPermaLink="false">http://tavie.onsenfout.com/?p=670</guid>
		<description><![CDATA[Un certificat de signature électronique permet comme son nom l&#8217;indique de signer numériquement ses messages et également d&#8217;échanger des messages cryptés avec des correspondants qui disposent eux aussi d&#8217;un certificat. Il y a de nombreuses offres commerciales payantes, et quelques gratuites : Comodo [en] TBS [fr] Startcom [en] Secorio [en] TC TrustCenter [en] CaCert [en] [...]<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>Un certificat de signature électronique permet comme son nom l&#8217;indique de signer numériquement ses messages et également d&#8217;échanger des messages cryptés avec des correspondants qui disposent eux aussi d&#8217;un certificat. Il y a de nombreuses offres commerciales payantes, et quelques gratuites :</p>
<p><a href="http://www.comodo.com/home/email-security/free-email-certificate.php" target="_blank">Comodo</a> [en]<br />
<a href="https://www.tbs-internet.com/php/HTML/commande.php?p=2&#038;id=106" target="_blank">TBS</a> [fr]<br />
<a href="https://cert.startcom.org/" target="_blank">Startcom</a> [en]<br />
<a href="https://www.secorio.com/index.php?S_MIME_Email_Certificates" target="_blank">Secorio</a> [en]<br />
<a href="http://www.trustcenter.de/en/products/tc_certificates.htm" target="_blank">TC TrustCenter</a> [en]<br />
<a href="http://www.cacert.org/" target="_blank">CaCert</a> [en]</p>
<p><span id="more-670"></span><br />
Pour l&#8217;exemple de ce billet j&#8217;ai retenu <a href="http://www.comodo.com/home/email-security/free-email-certificate.php" target="_blank">Comodo</a> car ce sont eux qui ont la procédure la plus simple: pas d&#8217;inscription préalable, demande minimale de renseignements, ça ne devrait décourager que les plus allergiques à l&#8217;anglais. Pour ceux là il y a <a href="https://www.tbs-internet.com/php/HTML/commande.php?p=2&#038;id=106" target="_blank">TBS</a>, qui d&#8217;ailleurs délivre des certificats Comodo mais ils sont plus inquisiteurs sur les renseignements personnels.</p>
<h3>Etape 1 : La demande de certificat</h3>
<p>Avec Firefox de préférence aller sur la page <a href="http://www.comodo.com/home/email-security/free-email-certificate.php" target="_blank">Free Secure Email Certificate</a> et cliquer sur le bouton <strong><em>Free Download</em></strong>. Entrer le prénom, le nom, l&#8217;adresse email pour laquelle on veut le certificat, le pays, laisser &laquo;&nbsp;Haut Grade&nbsp;&raquo; pour l&#8217;option &laquo;&nbsp;Key size&nbsp;&raquo;. Saisir un mot de passe pour pouvoir éventuellement révoquer le certificat, décocher (ou pas) la case &laquo;&nbsp;Opt-in&nbsp;&raquo; pour la newsletter de Comodo, accepter les conditions et valider, c&#8217;est parti.</p>
<h3>Etape 2 : Installer le certificat dans Firefox</h3>
<p>Lorsque le message <strong><em>Your certificate is ready for collection</em></strong> est arrivé dans la boite à lettres, cliquer sur le lien <strong><em>Click &#038; Install Comodo Email Certificate</em></strong> si Firefox est le navigateur par défaut, sinon copier l&#8217;adresse du lien et la coller dans la barre d&#8217;adresse de Firefox.</p>
<p>Valider la boite de dialogue <strong><em>Votre certificat personnel a été installé</em></strong> en haussant les épaules, car c&#8217;est en grande partie faux. Certes le certificat a bien été installé dans Firefox, mais à quoi ça sert pour le mail? A rien. On continue.</p>
<h3>Etape 3 : Sauvegarder le certificat</h3>
<p>Toujours sous Firefox, aller dans <strong><em>Outils</em></strong>, puis <strong><em>Options</em></strong>, menu <strong><em>Avancé</em></strong>, onglet <strong><em>Chiffrement</em></strong>, cliquer sur le bouton <strong><em>Afficher les certificats</em></strong>, aller sur l&#8217;onglet <strong><em>Vos certificats</em></strong>. Cliquer sur le certificat nommé <strong><em>ID COMODO CA Limited</em></strong> puis sur le bouton <strong><em>Sauvegarder</em></strong>. Choisir un emplacement sur le disque et un nom de fichier, l&#8217;adresse email est un bon choix. Entrer ensuite un mot de passe de protection suffisamment robuste, personne n&#8217;aimerait qu&#8217;on utilise sa clé privée pour signer des messages&#8230;</p>
<h3>Etape 4 : Importer le certificat dans Thunderbird</h3>
<p>On commence à voir le bout du tunnel. Sous Thunderbird, aller dans <strong><em>Outils</em></strong>, puis <strong><em>Options</em></strong>, menu <strong><em>Avancé</em></strong>, onglet <strong><em>Certificats</em></strong>, cliquer sur le bouton <strong><em>Voir les certificats</em></strong>, puis sur le bouton <strong><em>Importer</em></strong>. Choisir le certificat sauvegardé, entrer le mot de passe, valider. Le certificat <strong><em>ID COMODO CA Limited</em></strong> doit apparaître dans l&#8217;onglet <strong><em>Vos certificats</em></strong>. Valider pour sortir du menu Options.</p>
<h3>Etape 5 : Associer le certificat au compte de messagerie</h3>
<p>Toujours sous Thunderbird, aller dans <strong><em>Outils</em></strong>, puis <strong><em>Paramètre des comptes</em></strong>. Pour l&#8217;adresse de messagerie concernée, sélectionner la rubrique <strong><em>Sécurité</em> </strong>. Dans la zone <strong><em>Signature</em> </strong>cliquer sur <strong><em>Sélectionner un certificat</em></strong>, choisir <strong><em>ID COMODO CA Limited</em></strong>, valider et accepter d&#8217;utiliser le même certificat pour le chiffrement. </p>
<p>On peut choisir de cocher la case <strong><em>Signer les messages numériquement</em></strong>, tous les messages seront signés par défaut et il y a peu d&#8217;effets indésirables.</p>
<h3>Etape 6 : Mon premier message signé et chiffré!</h3>
<p>Pour tester on s&#8217;envoie un message à soi-même en signant et chiffrant le message, menu <strong><em>Options</em> </strong>ou bouton <strong><em>Sécurité</em></strong>. Le message reçu aura 2 jolies petites icônes dans la zone d&#8217;en-tête, une enveloppe cachetée pour la signature et un cadenas pour le chiffrement.</p>
<p>Les messages signés peuvent être envoyés à tout le monde, les messages chiffrés ne peuvent être envoyés qu&#8217;aux destinataires dont on a la clé publique, qu&#8217;on obtient en recevant un message signé ou chiffré. </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/16/installer-un-certificat-sous-thunderbird/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

