<?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; administration</title>
	<atom:link href="http://tavie.onsenfout.com/tag/administration/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>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>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>Mise à jour vers WordPress 2.5</title>
		<link>http://tavie.onsenfout.com/2008/04/07/mise-a-jour-vers-wordpress-25/</link>
		<comments>http://tavie.onsenfout.com/2008/04/07/mise-a-jour-vers-wordpress-25/#comments</comments>
		<pubDate>Mon, 07 Apr 2008 12:08:18 +0000</pubDate>
		<dc:creator>François</dc:creator>
				<category><![CDATA[Bits]]></category>
		<category><![CDATA[administration]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[Lester Chan]]></category>
		<category><![CDATA[svn]]></category>
		<category><![CDATA[traduction]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[wordpress 2.5]]></category>
		<category><![CDATA[WP-Print]]></category>

		<guid isPermaLink="false">http://tavie.onsenfout.com/?p=45</guid>
		<description><![CDATA[J&#8217;ai mis à jour ce blog vers la version 2.5 de WordPress qui apporte un bon lot d&#8217;améliorations dans l&#8217;interface d&#8217;administration. La mise à jour s&#8217;est passée sans histoire (par svn), et tous les plugins installés fonctionnent avec la nouvelle version. WP-Print 2.2 était incompatible mais Lester Chan à développé de nouvelles versions de ses [...]<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>J&#8217;ai mis à jour ce blog vers <a href="http://www.wordpress-fr.net/blog/wordpress/presentation-de-wordpress-25-par-matt" target="_blank">la version 2.5 de WordPress</a> qui apporte un bon lot d&#8217;améliorations dans l&#8217;interface d&#8217;administration. La mise à jour s&#8217;est passée sans histoire (par svn), et tous les plugins installés fonctionnent avec la nouvelle version.</p>
<p><span id="more-45"></span>WP-Print 2.2 était incompatible mais Lester Chan à développé de <a href="http://lesterchan.net/wordpress/2008/03/30/my-plugins-compatibility-with-wordpress-25/" target="_blank">nouvelles versions</a> de ses plugins compatibles avec WP 2.5. La version <a href="http://tavie.onsenfout.com/wp-content/uploads/2008/04/wp-print23b2-fr.zip">WP-Print 2.3 beta 2</a> semble bien fonctionner, à vous de le dire. J&#8217;attends la version finale pour faire la traduction, ça reste donc en anglais pour le moment. Pour les admins WordPress qui font la mise à jour WP-Print, pensez à mettre aussi à jour les permaliens sinon ça marche pas.</p>
<p>A l&#8217;usage j&#8217;ai eu quelques soucis avec la nouvelle interface de téléchargement de médias, Ajaxisée et Flashifiée à mort. Quand j&#8217;essayais d&#8217;uploader un fichier, rien ne se passait. Il y a <a href="http://wordpress.org/support/topic/164999" target="_blank">toute une page</a> (en anglais) qui recense les problèmes avec cette nouvelle interface. Pour ma part j&#8217;ai du faire les manips suivantes :</p>
<ul>
<li>Modifier le fichier .htaccess à la racine du blog et rajouter les lignes :</li>
</ul>

<div class="wp_syntax"><div class="code"><pre class="apache" style="font-family:monospace;">&lt;/<span style="color: #000000; font-weight:bold;">IfModule</span>&gt;
&lt;<span style="color: #000000; font-weight:bold;">IfModule</span> mod_security.c&gt;
&lt;<span style="color: #000000; font-weight:bold;">Files</span> async-upload.php&gt;
SecFilterEngine <span style="color: #0000ff;">Off</span>
SecFilterScanPOST <span style="color: #0000ff;">Off</span>
&lt;/<span style="color: #000000; font-weight:bold;">Files</span>&gt;
&lt;/<span style="color: #000000; font-weight:bold;">IfModule</span>&gt;</pre></div></div>

<ul>
<li>Mettre à jour le plugin Flash pour Firefox. Sous Ubuntu, c&#8217;est flashplugin-nonfree dans les dépots medibuntu.</li>
</ul>
<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/07/mise-a-jour-vers-wordpress-25/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Automatiser les mises à jour de sécurité avec Ubuntu</title>
		<link>http://tavie.onsenfout.com/2007/11/15/automatiser-les-mises-a-jour-de-securite-avec-ubuntu/</link>
		<comments>http://tavie.onsenfout.com/2007/11/15/automatiser-les-mises-a-jour-de-securite-avec-ubuntu/#comments</comments>
		<pubDate>Thu, 15 Nov 2007 09:36:09 +0000</pubDate>
		<dc:creator>François</dc:creator>
				<category><![CDATA[Bits]]></category>
		<category><![CDATA[administration]]></category>
		<category><![CDATA[apt]]></category>
		<category><![CDATA[automatisation]]></category>
		<category><![CDATA[gutsy]]></category>
		<category><![CDATA[unattended-upgrades]]></category>

		<guid isPermaLink="false">http://tavie.onsenfout.com/2007/11/15/automatiser-les-mises-a-jour-de-securite-avec-ubuntu/</guid>
		<description><![CDATA[Testé sur Ubuntu 7.10 Gutsy le 14/11/2007 AMHA, l&#8217;automatisation des mises à jour de sécurité Ubuntu (unattended upgrades) peut s&#8217;appliquer à 2 types de situations : Le serveur non critique, type LAMP ou serveur mail, sur lequel est installé un nombre limité de paquets ne présentant pas à priori d&#8217;incompatibilités, et qui ne nécessite pas [...]<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 7.10 Gutsy le 14/11/2007</em><br />
AMHA, l&#8217;automatisation des mises à jour de sécurité Ubuntu (unattended upgrades) peut s&#8217;appliquer à 2 types de situations :</p>
<ul>
<li>Le serveur non critique, type LAMP ou serveur mail, sur lequel est installé un nombre limité de paquets ne présentant pas à priori d&#8217;incompatibilités, et qui ne nécessite pas une administration paranoïaque.</li>
<li>Le poste de travail d&#8217;un utilisateur qui ne veut ou ne peut pas s&#8217;occuper des mises à jour.</li>
</ul>
<p>Dans ces 2 cas il peut être intéressant que les mises à jour de sécurité s&#8217;appliquent automatiquement, sans pour autant automatiser le passage aux nouvelles versions, autrement plus risqué.</p>
<p>Voilà comment j&#8217;ai fait :</p>
<p>Installation du paquet unattended-upgrades</p>

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

<p>Editer /etc/apt/apt.conf.d/50unattended-upgrades</p>

<div class="wp_syntax"><div class="code"><pre class="apt_sources" style="font-family:monospace;">// Paquets à mettre à jour (origine, archive)
Unattended-Upgrade::Allowed-Origins {
&quot;Ubuntu gutsy-security&quot;;
// Décommenter pour automatiser les changements de version, pour ceux qui savent ce qu'ils font
//    &quot;Ubuntu gutsy-updates&quot;;
};
&nbsp;
// Liste des paquets ne devant pas être mis à jour (exemple)
Unattended-Upgrade::Package-Blacklist {
&quot;nagios-nrpe-plugin&quot;;
&quot;nagios-plugins&quot;;
&quot;nagios-plugins-basic&quot;;
&quot;nagios-plugins-standard&quot;;
&quot;nagios2&quot;;
&quot;nagios2-common&quot;;
&quot;nagios2-doc&quot;;
};</pre></div></div>

<p>Editer ou créer /etc/apt/apt.conf.d/10periodic et ajouter :</p>

<div class="wp_syntax"><div class="code"><pre class="apt_sources" style="font-family:monospace;">APT::Periodic::Update-Package-Lists &quot;1&quot;;
APT::Periodic::Unattended-Upgrade &quot;1&quot;;</pre></div></div>

<p>Dans les versions précédentes d&#8217;Ubuntu, on peut trouver ces paramètres regroupés avec les autres dans /etc/apt/apt.conf, la tendance actuelle semble être d&#8217;utiliser un fichier par fonctionnalité activée dans /etc/apt/apt.conf.d/, et pourquoi pas.<br />
Et voilà c&#8217;est tout, la tâche cron quotidienne <strong>apt</strong> se chargera des mises à jour de sécurité.  Les actions sont loggées dans /var/log/unattended-upgrades/</p>
<h3>Edit du 7 juin 2011</h3>
<p>Depuis Gutsy les choses ont bien évolué et même si la méthode décrite ci-dessus reste adaptée à un serveur, c&#8217;est plus simple d&#8217;utiliser l&#8217;interface graphique pour les machines de bureau :</p>
<ul>
<li>Ouvrir le <strong>gestionnaire de mise à jour</strong> (Menu Système / Administration)</li>
<li>Dans l&#8217;onglet <strong>Mises à jour</strong>, cocher la case <strong>Installer les mises à jour de sécurité sans confirmation</strong></li>
<li>Valider, et c&#8217;est fait.</li>
</ul>
<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/11/15/automatiser-les-mises-a-jour-de-securite-avec-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mise à jour WordPress avec Subversion</title>
		<link>http://tavie.onsenfout.com/2007/11/12/mise-a-jour-wordpress-avec-subversion/</link>
		<comments>http://tavie.onsenfout.com/2007/11/12/mise-a-jour-wordpress-avec-subversion/#comments</comments>
		<pubDate>Mon, 12 Nov 2007 12:38:57 +0000</pubDate>
		<dc:creator>François</dc:creator>
				<category><![CDATA[Bits]]></category>
		<category><![CDATA[administration]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[sauvegarde]]></category>
		<category><![CDATA[subversion]]></category>
		<category><![CDATA[svn]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://tavie.onsenfout.com/2007/11/12/mise-a-jour-wordpress-avec-subversion/</guid>
		<description><![CDATA[Jusqu&#8217;à maintenant je faisais les mises à jour WordPress de la façon laborieuse, en recopiant les fichiers à la mimine. J&#8217;ai profité de la version 2.3.1 pour créer un &#171;&#160;checkout&#160;&#187; subversion qui devrait simplifier les futures mises à jour. J&#8217;ai suivi les instructions du Codex WordPress : Créer un répertoire de blog temporaire mkdir blognew [...]<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>Jusqu&#8217;à maintenant je faisais les mises à jour WordPress de la façon laborieuse, en recopiant les fichiers à la mimine. J&#8217;ai profité de la version 2.3.1 pour créer un &laquo;&nbsp;checkout&nbsp;&raquo; subversion qui devrait simplifier les futures mises à jour. J&#8217;ai suivi les instructions du <a title="Créer un checkout subversion" href="http://codex.wordpress.org/Installing/Updating_WordPress_with_Subversion#Converting_a_.22Traditional.22_WordPress_Blog_to_a_Subversion_Checkout" target="_blank">Codex WordPress</a> :</p>
<p>Créer un répertoire de blog temporaire</p>

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

<p>Dans ce répertoire extraire la dernière version stable de WordPress (attention au point à la fin de la commande svn)</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> blognew
<span style="color: #c20cb9; font-weight: bold;">svn</span> <span style="color: #c20cb9; font-weight: bold;">co</span> http:<span style="color: #000000; font-weight: bold;">//</span>svn.automattic.com<span style="color: #000000; font-weight: bold;">/</span>wordpress<span style="color: #000000; font-weight: bold;">/</span>trunk .</pre></div></div>

<p>Recopier à la main les éléments personnalisés (.htaccess, wp-config.php, wp-content/, etc&#8230;) du répertoire de blog actuel vers le nouveau</p>
<p>Sauvegarder la base de données</p>
<p>Renommer les répertoires :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">mv</span> blog blog.save
<span style="color: #c20cb9; font-weight: bold;">mv</span> blognew blog</pre></div></div>

<p>Lancer le script de mise à jour (il n&#8217;y avait pas de mise à jour de la base pour cette version) :</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">http://tavie.onsenfout.com/wp-admin/upgrade.php</pre></div></div>

<p>La prochaine mise à jour (2.3.2 ?) pourra être effectuée avec la commande :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> blog
<span style="color: #c20cb9; font-weight: bold;">svn</span> update</pre></div></div>

<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/11/12/mise-a-jour-wordpress-avec-subversion/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

