<?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; apache</title>
	<atom:link href="http://tavie.onsenfout.com/tag/apache/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>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>Supprimer la passphrase d&#8217;un certificat ssl apache</title>
		<link>http://tavie.onsenfout.com/2011/03/14/supprimer-la-passphrase-dun-certificat-ssl-apache/</link>
		<comments>http://tavie.onsenfout.com/2011/03/14/supprimer-la-passphrase-dun-certificat-ssl-apache/#comments</comments>
		<pubDate>Mon, 14 Mar 2011 10:13:35 +0000</pubDate>
		<dc:creator>François</dc:creator>
				<category><![CDATA[Bits]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[certificat]]></category>
		<category><![CDATA[sécurité]]></category>
		<category><![CDATA[ssl]]></category>

		<guid isPermaLink="false">http://tavie.onsenfout.com/?p=628</guid>
		<description><![CDATA[Testé sous Debian 5.07 Lenny Un certificat ssl avec passphrase (phrase de passe selon l&#8217;Académie Française) sous Apache, au premier abord ça semble bien pour la sécurité mais dans les faits c&#8217;est un très bon moyen d&#8217;avoir un serveur en rade sans savoir pourquoi: la passphrase est demandée à chaque redémarrage d&#8217;Apache, il faut donc [...]<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é sous Debian 5.07 Lenny</em></p>
<p>Un certificat ssl avec passphrase (phrase de passe selon l&#8217;Académie Française) sous Apache, au premier abord ça semble bien pour la sécurité mais dans les faits c&#8217;est un très bon moyen d&#8217;avoir un serveur en rade sans savoir pourquoi: la passphrase est demandée à chaque redémarrage d&#8217;Apache, il faut donc une intervention humaine. Si Apache est redémarré par un script ou un reboot du serveur il restera à attendre cette fichue passphrase qui a peu de chance d&#8217;arriver comme ça&#8230;</p>
<p>La solution est de supprimer la passphrase de la clé privée, qu&#8217;on aura sauvegardée au préalable :</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> mondomaine.key mondomaine.key.sav
openssl rsa <span style="color: #660033;">-in</span> mondomaine.key.sav <span style="color: #660033;">-out</span> mondomaine.key
<span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #000000;">400</span> mondomaine.key</pre></div></div>

<h3>Lien</h3>
<p><a href="http://httpd.apache.org/docs/2.0/ssl/ssl_faq.html#removepassphrase">How can I get rid of the pass-phrase dialog at Apache startup time?</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/03/14/supprimer-la-passphrase-dun-certificat-ssl-apache/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Configurer les commandes externes de l&#8217;interface Nagios</title>
		<link>http://tavie.onsenfout.com/2011/02/22/configurer-les-commandes-externes-de-linterface-nagios/</link>
		<comments>http://tavie.onsenfout.com/2011/02/22/configurer-les-commandes-externes-de-linterface-nagios/#comments</comments>
		<pubDate>Tue, 22 Feb 2011 10:37:46 +0000</pubDate>
		<dc:creator>François</dc:creator>
				<category><![CDATA[Bits]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[nagios]]></category>

		<guid isPermaLink="false">http://tavie.onsenfout.com/?p=580</guid>
		<description><![CDATA[Testé sous Debian 6.0 Squeeze et Nagios 3.2.3 En migrant mon serveur Nagios sur une nouvelle machine j&#8217;ai à nouveau rencontré un problème que j&#8217;avais eu lors de la première installation : impossible de forcer la vérification d&#8217;un service par l&#8217;interface Nagios (commande Re-schedule the next check of this service). Le message d&#8217;erreur que j&#8217;avais [...]<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é sous Debian 6.0 Squeeze et Nagios 3.2.3</em></p>
<p>En migrant mon serveur Nagios sur une nouvelle machine j&#8217;ai à nouveau rencontré un problème que j&#8217;avais eu lors de la première installation : impossible de forcer la vérification d&#8217;un service par l&#8217;interface Nagios (commande <strong>Re-schedule the next check of this service</strong>). </p>
<p>Le message d&#8217;erreur que j&#8217;avais était &laquo;&nbsp;Error: Could not stat() command file &#8216;/var/lib/nagios3/rw/nagios.cmd&#8217;!&nbsp;&raquo;, certaines personnes signalent le message &laquo;&nbsp;Error: No command was specified&nbsp;&raquo; sur le même sujet.</p>
<p>C&#8217;est un problème de droits d&#8217;accès entre Nagios et Apache sur le répertoire des commandes externes, voilà comment régler le problème :<br />
<span id="more-580"></span><br />
Dans /etc/nagios3/nagios.cfg :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #007800;">check_external_commands</span>=<span style="color: #000000;">1</span></pre></div></div>

<p>Exécuter ensuite les commandes suivantes en tant que root :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">dpkg-statoverride <span style="color: #660033;">--update</span> <span style="color: #660033;">--add</span> nagios www-data <span style="color: #000000;">2710</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>nagios3<span style="color: #000000; font-weight: bold;">/</span>rw
dpkg-statoverride <span style="color: #660033;">--update</span> <span style="color: #660033;">--add</span> nagios nagios <span style="color: #000000;">751</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>nagios3
<span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #000000;">2770</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>nagios3<span style="color: #000000; font-weight: bold;">/</span>rw
<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>nagios3 stop
apache2ctl restart
<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>nagios3 start</pre></div></div>

<p>Et hop, c&#8217;est reparti!</p>
<h3>Liens:</h3>
<p><a href="https://www.alienvault.com/forum/index.php?t=msg&#038;goto=4070&#038;S=5dc21af1dcc27b7f72be280a4d1f52b3">OSSIM : Nagios => Nagios &#8211; External Command</a><br />
<a href="http://blog.lolo.org/?p=11">Le tuto de Lolo sur l&#8217;installation de Nagios</a><br />
<a href="http://www.delafond.org/traducmanfr/deb/man8/dpkg-statoverride.8.html">Man page dpkg-statoverride</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/02/22/configurer-les-commandes-externes-de-linterface-nagios/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installer Typo3 avec svn sur Ubuntu server</title>
		<link>http://tavie.onsenfout.com/2008/05/20/installer-typo3-avec-svn-sur-ubuntu-server/</link>
		<comments>http://tavie.onsenfout.com/2008/05/20/installer-typo3-avec-svn-sur-ubuntu-server/#comments</comments>
		<pubDate>Tue, 20 May 2008 01:22:39 +0000</pubDate>
		<dc:creator>François</dc:creator>
				<category><![CDATA[Bits]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[cms]]></category>
		<category><![CDATA[subversion]]></category>
		<category><![CDATA[svn]]></category>
		<category><![CDATA[typo3]]></category>

		<guid isPermaLink="false">http://tavie.onsenfout.com/?p=67</guid>
		<description><![CDATA[Testé sur Ubuntu server 8.04LTS Plus ça va plus je trouve que subversion (svn) est un outil génial, et pas seulement pour les développeurs. Une fois qu&#8217;on connait l&#8217;adresse du dépot svn d&#8217;une application, ça devient très facile de l&#8217;installer, sous ses différentes versions si besoin, et les mises à jour deviennent très simples. Par [...]<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 Ubuntu server 8.04LTS</em></p>
<p>Plus ça va plus je trouve que <a href="http://subversion.tigris.org/" target="_blank">subversion</a> (svn) est un outil génial, et pas seulement pour les développeurs. Une fois qu&#8217;on connait l&#8217;adresse du dépot svn d&#8217;une application, ça devient très facile de l&#8217;installer, sous ses différentes versions si besoin, et les mises à jour deviennent très simples.</p>
<p>Par exemple <a href="http://www.typo3.fr/" target="_blank">Typo3</a>. Cet excellent CMS n&#8217;a qu&#8217;un petit défaut, les mises à jour sur un site existant sont parfois délicates, il faut prendre son temps. Du coup c&#8217;est intéressant d&#8217;avoir plusieurs plusieurs versions installées, les sites n&#8217;ayant pas encore été migrés utilisant leur version d&#8217;origine. Avec svn, c&#8217;est tout simple.</p>
<p><span id="more-67"></span>L&#8217;adresse du dépot svn pour typo3 est <a title="Typo3" href="https://typo3.svn.sourceforge.net/svnroot/typo3" target="_blank">https://typo3.svn.sourceforge.net/svnroot/typo3</a>. A partir de là CoreDocs/ donne accès à la documentation, et TYPO3core/ aux sources. Classiquement, on a ensuite trunk/ pour la dernière version de développement, branches/ pour les versions principales (4.0, 4.1, 4.2, etc&#8230;) et tags/ pour les différentes releases (4.0.1, 4.0.2, etc&#8230;). Pour un serveur de production le choix de tags/ est plus raisonnable, branches/ est plus pratique sur une machine de test pour faire des mises à jour avec svn update. Quant à trunk/, c&#8217;est pour les développeurs et les grands joueurs.</p>
<p class="commentitem">Edit du 3/5/2010 :<br />
Le dépot svn typo3 est maintenant à l&#8217;adresse <a href="https://svn.typo3.org/" target="_blank">https://svn.typo3.org/</a><br />
Créer le répertoire typo3 :</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>usr<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>typo3
<span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>typo3</pre></div></div>

<p>On télécharge les version 4.0.8 et 4.2.0 :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">svn</span> <span style="color: #c20cb9; font-weight: bold;">co</span> https:<span style="color: #000000; font-weight: bold;">//</span>typo3.svn.sourceforge.net<span style="color: #000000; font-weight: bold;">/</span>svnroot<span style="color: #000000; font-weight: bold;">/</span>typo3<span style="color: #000000; font-weight: bold;">/</span>TYPO3core<span style="color: #000000; font-weight: bold;">/</span>tags<span style="color: #000000; font-weight: bold;">/</span>TYPO3_4-<span style="color: #000000;">0</span>-<span style="color: #000000;">8</span> 4.0.8
<span style="color: #c20cb9; font-weight: bold;">svn</span> <span style="color: #c20cb9; font-weight: bold;">co</span> https:<span style="color: #000000; font-weight: bold;">//</span>typo3.svn.sourceforge.net<span style="color: #000000; font-weight: bold;">/</span>svnroot<span style="color: #000000; font-weight: bold;">/</span>typo3<span style="color: #000000; font-weight: bold;">/</span>TYPO3core<span style="color: #000000; font-weight: bold;">/</span>tags<span style="color: #000000; font-weight: bold;">/</span>TYPO3_4-<span style="color: #000000;">2</span>-<span style="color: #000000;">0</span> 4.2.0</pre></div></div>

<p>On crée des liens symboliques, latest pour la dernière et éventuellement des liens personnalisés pour les sites qui utilisent les anciennes versions :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> 4.2.0 latest
<span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> 4.0.8 mesvieuxsites</pre></div></div>

<p>S&#8217;ils ne sont pas encore là on installe les paquets nécessaires à typo3 et on recharge la config Apache :</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> php5-gd imagemagick libttf-dev
<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>apache2 reload</pre></div></div>

<p>Pour un nouveau site, il faut télécharger le package <a href="http://typo3.org/download/packages/" target="_blank">dummy</a> (que je n&#8217;ai pas trouvé sur svn), si comme moi c&#8217;est pour migrer un site sur une nouvelle machine il faut créer le fichier typo3conf/ENABLE_INSTALL_TOOL :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">touch</span> monsite<span style="color: #000000; font-weight: bold;">/</span>typo3conf<span style="color: #000000; font-weight: bold;">/</span>ENABLE_INSTALL_TOOL</pre></div></div>

<p>A la racine du site, on crée le lien symbolique qui va pointer sur la version appropriée de typo3 :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>typo3<span style="color: #000000; font-weight: bold;">/</span>latest typo3_src</pre></div></div>

<p>ensuite se rendre sur http://monsite/typo3/install pour exécuter l&#8217;assistant d&#8217;installation et de mise à jour.</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/2008/05/20/installer-typo3-avec-svn-sur-ubuntu-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mise en place de Webdav / SSL sur Debian</title>
		<link>http://tavie.onsenfout.com/2008/04/24/mise-en-place-de-webdav-ssl-sur-debian/</link>
		<comments>http://tavie.onsenfout.com/2008/04/24/mise-en-place-de-webdav-ssl-sur-debian/#comments</comments>
		<pubDate>Wed, 23 Apr 2008 23:18:16 +0000</pubDate>
		<dc:creator>François</dc:creator>
				<category><![CDATA[Bits]]></category>
		<category><![CDATA[administration]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[cacert]]></category>
		<category><![CDATA[certificat]]></category>
		<category><![CDATA[ftp]]></category>
		<category><![CDATA[httpasswd]]></category>
		<category><![CDATA[sécurité]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[ssl]]></category>
		<category><![CDATA[webdav]]></category>

		<guid isPermaLink="false">http://tavie.onsenfout.com/?p=63</guid>
		<description><![CDATA[Testé sur Debian testing &#171;&#160;Lenny&#160;&#187; Ce memo me sert pour configurer WebDAV avec cryptage SSL sur un serveur Apache. J&#8217;utilise WebDAV pour offrir un accès fichiers aux webmasters des sites que j&#8217;héberge, c&#8217;est plus souple et plus sûr que le FTP. Cette config est très basique, Webdav permet un paramétrage très fin des autorisations, notamment [...]<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 testing &laquo;&nbsp;Lenny&nbsp;&raquo;</em></p>
<p>Ce memo me sert pour configurer WebDAV avec cryptage SSL sur un serveur Apache. J&#8217;utilise WebDAV pour offrir un accès fichiers aux webmasters des sites que j&#8217;héberge, c&#8217;est plus souple et plus sûr que le FTP. Cette config est très basique, Webdav permet un paramétrage très fin des autorisations, notamment avec la directive &lt;Limit &#8230;&gt;</p>
<p><span id="more-63"></span>Une des contraintes de Webdav est que le serveur Apache doit avoir les droits en lecture-écriture sur tous les répertoires et fichiers partagés. Il faut donc veiller à ce que le user sous lequel s&#8217;exécute Apache (www-data dans mon cas) en reste propriétaire. C&#8217;est pourquoi les concepteurs de Webdav recommandent de ne pas utiliser d&#8217;autre protocole pour accéder à ces fichiers. C&#8217;est à mon humble avis un peu excessif, mais il faut y faire attention, un upload fait par SSH ou FTP n&#8217;aura probablement pas les bons droits.</p>
<h3>Requis</h3>
<ul>
<li>Apache 2</li>
<li>Openssl</li>
<li>Un compte sur <a href="http://www.cacert.org" target="_blank">cacert.org</a></li>
</ul>
<p></br></p>
<h3>Installer les modules Apache</h3>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">a2enmod ssl
a2enmod dav
a2enmod dav_fs
a2enmod dav_lock
a2enmod rewrite
<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>apache2 force-reload</pre></div></div>

<h3>Générer le certificat SSL</h3>
<p>Dans le répertoire /etc/ssl/private :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">openssl req <span style="color: #660033;">-nodes</span> <span style="color: #660033;">-new</span> <span style="color: #660033;">-keyout</span> mondomaine.key <span style="color: #660033;">-out</span> mondomaine.csr</pre></div></div>

<p>On peut passer toutes les questions sauf &laquo;&nbsp;Common Name (eg, YOUR name)&nbsp;&raquo;, où il ne faut surtout pas mettre son nom mais le nom du domaine.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">cat</span> mondomaine.csr</pre></div></div>

<p>Copier la sortie dans le presse-papier<br />
Sur le site cacert.org aller sur Certificat de domaine / Nouveau<br />
Demander un certificat de classe 3<br />
Coller le csr<br />
Récupérer le certificat dans le presse-papier et le coller dans /etc/ssl/private/mondomaine.crt</p>
<p>finir par :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #000000;">600</span> mondomaine.<span style="color: #000000; font-weight: bold;">*</span></pre></div></div>

<p>Recopier le certificat racine CACert Classe 3 dans le magasin de certificats /etc/ssl/certs sous le nom cacert_class3.crt</p>
<p>Il est aussi possible d&#8217;utiliser un certificat autosigné, comme <a href="http://free.korben.info/index.php/Auto-signer_son_certificat_SSL">expliqué ici</a> par exemple. L&#8217;avantage du certificat CACert est qu&#8217;il est issu d&#8217;une autorité certes non commerciale mais reconnue. Si le certificat racine de CACert n&#8217;est pas présent sur les postes clients on peut le télécharger <a href="http://www.cacert.org/index.php?id=3" target="_blank">ici</a></p>
<h3>Configurer Apache</h3>
<p style="text-align: left;"><span style="font-size: 10pt;"><strong><span style="color: #800000;">Attention, un seul serveur virtuel SSL par adresse IP!</span></strong></span></p>
<p>Hors serveur virtuel, ajouter les directives :</p>

<div class="wp_syntax"><div class="code"><pre class="apache" style="font-family:monospace;"><span style="color: #00007f;">NameVirtualHost</span> *:<span style="color: #ff0000;">80</span>
<span style="color: #00007f;">NameVirtualHost</span> *:<span style="color: #ff0000;">443</span>
<span style="color: #00007f;">DAVMinTimeout</span> <span style="color: #ff0000;">600</span>
<span style="color: #00007f;">DAVDepthInfinity</span> <span style="color: #0000ff;">On</span></pre></div></div>

<p>Dès qu&#8217;on a mis en place le SSL, il faut que <strong>tous</strong> les serveurs virtuels soient assignés à un port, 80 pour http ou 443 pour https.</p>
<p>ex :</p>

<div class="wp_syntax"><div class="code"><pre class="apache" style="font-family:monospace;">&lt;<span style="color: #000000; font-weight:bold;">VirtualHost</span> *:<span style="color: #ff0000;">80</span>&gt;
...
&lt;/<span style="color: #000000; font-weight:bold;">VirtualHost</span>&gt;</pre></div></div>

<h3>Déclarer le serveur virtuel</h3>
<p>On crée le fichier /etc/apache2/sites-availables/webdav :</p>

<div class="wp_syntax"><div class="code"><pre class="apache" style="font-family:monospace;">&lt;<span style="color: #000000; font-weight:bold;">VirtualHost</span> *:<span style="color: #ff0000;">80</span>&gt;
<span style="color: #00007f;">ServerName</span> mondomaine
<span style="color: #adadad; font-style: italic;"># Force SSL</span>
<span style="color: #00007f;">RewriteEngine</span> <span style="color: #0000ff;">on</span>
<span style="color: #00007f;">RewriteCond</span> %{HTTPS} !=<span style="color: #0000ff;">on</span> [NC]
<span style="color: #00007f;">RewriteRule</span> ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [R,L]
&lt;/<span style="color: #000000; font-weight:bold;">VirtualHost</span>&gt;
&lt;<span style="color: #000000; font-weight:bold;">VirtualHost</span> *:<span style="color: #ff0000;">443</span>&gt;
<span style="color: #00007f;">ServerName</span> mondomaine
<span style="color: #00007f;">ServerAdmin</span> webmaster@mondomaine
<span style="color: #00007f;">SSLEngine</span> <span style="color: #0000ff;">On</span>
<span style="color: #00007f;">SSLCACertificateFile</span> /etc/ssl/certs/cacert_class3.crt
<span style="color: #00007f;">SSLCertificateFile</span> /etc/ssl/private/mondomaine.crt
<span style="color: #00007f;">SSLCertificateKeyFile</span> /etc/ssl/private/mondomaine.key
<span style="color: #00007f;">DocumentRoot</span> /var/www
&lt;<span style="color: #000000; font-weight:bold;">Directory</span> /&gt;
<span style="color: #00007f;">Options</span> -<span style="color: #0000ff;">Indexes</span> <span style="color: #0000ff;">FollowSymLinks</span>
<span style="color: #00007f;">AllowOverride</span> <span style="color: #0000ff;">none</span>
&lt;/<span style="color: #000000; font-weight:bold;">Directory</span>&gt;
&lt;<span style="color: #000000; font-weight:bold;">Directory</span> /var/www/site1&gt;
<span style="color: #00007f;">Options</span> <span style="color: #0000ff;">Indexes</span>
<span style="color: #00007f;">AllowOverride</span> <span style="color: #0000ff;">none</span>
<span style="color: #00007f;">Order</span> <span style="color: #00007f;">allow</span>,<span style="color: #00007f;">deny</span>
<span style="color: #00007f;">allow</span> from <span style="color: #0000ff;">all</span>
<span style="color: #00007f;">DAV</span> <span style="color: #0000ff;">on</span>
<span style="color: #00007f;">AuthName</span> <span style="color: #7f007f;">&quot;Administration site Site 1&quot;</span>
<span style="color: #00007f;">AuthType</span> Basic
<span style="color: #00007f;">AuthUserFile</span> /etc/apache2/htpasswd-webdav
&lt;<span style="color: #000000; font-weight:bold;">Limit</span> GET POST PROPFIND PUT DELETE PROPPATCH MKCOL COPY MOVE LOCK UNLOCK&gt;
<span style="color: #00007f;">Require</span> <span style="color: #00007f;">user</span> utilisateur1
&lt;/<span style="color: #000000; font-weight:bold;">Limit</span>&gt;
&lt;/<span style="color: #000000; font-weight:bold;">Directory</span>&gt;
&lt;<span style="color: #000000; font-weight:bold;">Directory</span> /var/www/site2&gt;
<span style="color: #00007f;">Options</span> <span style="color: #0000ff;">Indexes</span>
<span style="color: #00007f;">AllowOverride</span> <span style="color: #0000ff;">none</span>
<span style="color: #00007f;">Order</span> <span style="color: #00007f;">allow</span>,<span style="color: #00007f;">deny</span>
<span style="color: #00007f;">allow</span> from <span style="color: #0000ff;">all</span>
<span style="color: #00007f;">DAV</span> <span style="color: #0000ff;">on</span>
<span style="color: #00007f;">AuthName</span> <span style="color: #7f007f;">&quot;Administration site Site 2&quot;</span>
<span style="color: #00007f;">AuthType</span> Basic
<span style="color: #00007f;">AuthUserFile</span> /etc/apache2/htpasswd-webdav
&lt;<span style="color: #000000; font-weight:bold;">Limit</span> GET POST PROPFIND PUT DELETE PROPPATCH MKCOL COPY MOVE LOCK UNLOCK&gt;
<span style="color: #00007f;">Require</span> <span style="color: #00007f;">user</span> utilisateur2
&lt;/<span style="color: #000000; font-weight:bold;">Limit</span>&gt;
&lt;/<span style="color: #000000; font-weight:bold;">Directory</span>&gt;
<span style="color: #00007f;">ErrorLog</span> syslog
<span style="color: #00007f;">LogLevel</span> warn
<span style="color: #00007f;">CustomLog</span> /var/log/apache2/access_dav.log combined
&lt;/<span style="color: #000000; font-weight:bold;">VirtualHost</span>&gt;</pre></div></div>

<h3>Créer la base utilisateurs</h3>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">htpasswd <span style="color: #660033;">-c</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>htpasswd-webdav utilisateur1
New password:
Re-type new password:
Adding password <span style="color: #000000; font-weight: bold;">for</span> user utilisateur1
htpasswd <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>htpasswd-webdav utilisateur2
New password:
Re-type new password:
Adding password <span style="color: #000000; font-weight: bold;">for</span> user utilisateur2</pre></div></div>

<h3>Donner les droits d&#8217;accès à Apache</h3>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">chown</span> www-data <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>htpasswd-webdav
<span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #000000;">660</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>htpasswd-webdav</pre></div></div>

<h3>Configurer le firewall</h3>
<p>Ouvrir le port TCP 443</p>
<h3>Le moment de vérité!</h3>
<p>on active le site :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">a2ensite webdav
<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>apache2 reload</pre></div></div>

<p>S&#8217;il n&#8217;y a pas d&#8217;erreur il ne reste plus qu&#8217;a tester le partage avec un client Webdav : Dossiers Web sous Windows, le kio webdavs:// avec Konqueror (attention webdav:// ne fonctionne pas en SSL), le client intégré à Mac OS X, etc&#8230;</p>
<h3>Liens</h3>
<p><a href="http://www.webdav.org/">Le site officiel webdav</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/2008/04/24/mise-en-place-de-webdav-ssl-sur-debian/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Les permaliens WordPress qui ne fonctionnent pas</title>
		<link>http://tavie.onsenfout.com/2007/10/08/les-permaliens-wordpress-qui-ne-fonctionnent-pas/</link>
		<comments>http://tavie.onsenfout.com/2007/10/08/les-permaliens-wordpress-qui-ne-fonctionnent-pas/#comments</comments>
		<pubDate>Mon, 08 Oct 2007 15:49:46 +0000</pubDate>
		<dc:creator>François</dc:creator>
				<category><![CDATA[Bits]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://tavie.onsenfout.com/2007/10/08/les-permaliens-wordpress-qui-ne-fonctionnent-pas/</guid>
		<description><![CDATA[C&#8217;est tout con mais j&#8217;y ai passé une heure : je n&#8217;arrivais pas à faire fonctionner les permaliens WordPress, quand je selectionnais un post j&#8217;obtenais une erreur page not found. Et alors? Ben j&#8217;avais une directive AllowOverride None dans mon fichier de configuration apache, et les instructions rewrite du .htaccess étaient superbement ignorées. Avec un [...]<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 tout con mais j&#8217;y ai passé une heure : je n&#8217;arrivais pas à faire fonctionner les permaliens WordPress, quand je selectionnais un post j&#8217;obtenais une erreur page not found.</p>
<p>Et alors? Ben j&#8217;avais une directive <strong>AllowOverride None </strong>dans mon fichier de configuration apache, et les instructions <strong>rewrite</strong> du .htaccess étaient superbement ignorées.</p>
<p>Avec un <strong>AllowOverride All</strong> tout est rentré dans l&#8217;ordre. On est bien peu de chose&#8230;</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/2007/10/08/les-permaliens-wordpress-qui-ne-fonctionnent-pas/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

