<?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>Void And Any &#187; software</title>
	<atom:link href="http://voidandany.free.fr/index.php/category/informatique/software/feed/" rel="self" type="application/rss+xml" />
	<link>http://voidandany.free.fr</link>
	<description>mon bazar...</description>
	<lastBuildDate>Sat, 09 Dec 2017 09:24:06 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
		<item>
		<title>Installation d’un dépôt de fichier : bilan</title>
		<link>http://voidandany.free.fr/index.php/installation-dun-depot-de-fichier-bilan/</link>
		<comments>http://voidandany.free.fr/index.php/installation-dun-depot-de-fichier-bilan/#comments</comments>
		<pubDate>Tue, 17 Jan 2012 14:52:27 +0000</pubDate>
		<dc:creator>voidAndAny</dc:creator>
				<category><![CDATA[site web]]></category>

		<guid isPermaLink="false">http://voidandany.free.fr/?p=4545</guid>
		<description><![CDATA[Rappel du besoin : Avoir sur mon Dockstar un dépôt de fichier, un endroit ou je (ou des personnes de confiance) puisse facilement uploader des fichiers et avoir un lien vers ce fichier. Logiciel testés avec les liens vers les articles &#8230; <a href="http://voidandany.free.fr/index.php/installation-dun-depot-de-fichier-bilan/">Continuer la lecture <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Rappel du besoin :</p>
<p style="padding-left: 30px;">Avoir sur mon Dockstar un <strong>dépôt de fichier</strong>, un endroit ou je (ou des personnes de confiance) puisse facilement uploader des fichiers et avoir un lien vers ce fichier.</p>
<p>Logiciel testés avec les liens vers les articles :</p>
<ul>
<li><a title="Lien permanent vers Installation d’un dépôt de fichier : Jyraphe (recalé)" rel="bookmark" href="http://voidandany.free.fr/index.php/installation-dun-depot-de-fichier-jyraphe-recale/">Jyraphe</a></li>
<li><a title="Lien permanent vers Installation d’un dépôt de fichier : FileZ (configuration sur NGINX)" rel="bookmark" href="http://voidandany.free.fr/index.php/installation-dun-depot-de-fichier-filez-configuration-sur-nginx/">FileZ</a></li>
<li><a title="Lien permanent vers Installation d’un dépôt de fichier : KoLoad" rel="bookmark" href="http://voidandany.free.fr/index.php/installation-dun-depot-de-fichier-koload/">KoLoad</a></li>
<li><a title="Lien permanent vers Installation d’un dépôt de fichier : OpenUpload" rel="bookmark" href="http://voidandany.free.fr/index.php/installation-dun-depot-de-fichier-openupload/">OpenUpload</a></li>
<li><a title="Lien permanent vers Installation d’un dépôt de fichier : cFTP" rel="bookmark" href="http://voidandany.free.fr/index.php/installation-d%e2%80%99un-depot-de-fichier-cftp/">cFTP</a></li>
</ul>
<p>Autres logiciels disponibles (non testés et qui ne le seront probablement pas)</p>
<ul>
<li><a title="BigFileSharing" href="http://bigfilesharing.sourceforge.net/" target="_blank">BigFileSharing</a> : pas de mise à jour depuis 2008, est prvu pour fonctionner avec un serveur CAS et/ou LDAP (bien qu&#8217;une authentification par htaccess semble en théorie possible, modification cvs de 2010), testé mais je n&#8217;ai pas réussi a afficher autre chose que cette page : </li>
</ul>
<p><a rel="attachment wp-att-4547" href="http://voidandany.free.fr/index.php/installation-dun-depot-de-fichier-bilan/2012-01-17_144050/"><img class="aligncenter size-medium wp-image-4547" title="2012-01-17_144050" src="http://voidandany.free.fr/wp-content/uploads/2012-01-17_144050-300x161.png" alt="" width="300" height="161" /></a></p>
<ul>
<li><a title="F*ex" href="http://fex.rus.uni-stuttgart.de/" target="_blank"></a><a title="F*ex" href="http://fex.rus.uni-stuttgart.de/" target="_blank">F*ex</a> : non testé car en PERL</li>
<li><a title="Droopy" href="http://stackp.online.fr/?p=28" target="_blank">Droopy</a> : déjà testé (mais non décrit) simple script Python, le plus simple et le plus léger à mettre en oeuvre (aucune installation)</li>
<li><a href="http://code.google.com/p/xtraupload/">xtraupload</a> : commencé à tester sans succès (peut être réessaierai-je ?)</li>
</ul>
<p>&nbsp;</p>
<p><span style="text-decoration: underline;"><strong>Récapitulatif :</strong></span></p>
<table style="width: 567px; height: 194px; border-width: 1px;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td width="100"><strong>Application</strong></td>
<td width="100"><strong><a title="Lien permanent vers Installation d’un dépôt de fichier : Jyraphe (recalé)" rel="bookmark" href="http://voidandany.free.fr/index.php/installation-dun-depot-de-fichier-jyraphe-recale/">Jyraphe</a></strong></td>
<td width="100"><strong><a title="Lien permanent vers Installation d’un dépôt de fichier : FileZ (configuration sur NGINX)" rel="bookmark" href="http://voidandany.free.fr/index.php/installation-dun-depot-de-fichier-filez-configuration-sur-nginx/">FileZ</a></strong></td>
<td width="100"><strong><a title="Lien permanent vers Installation d’un dépôt de fichier : KoLoad" rel="bookmark" href="http://voidandany.free.fr/index.php/installation-dun-depot-de-fichier-koload/">KoLoad</a></strong></td>
</tr>
<tr>
<td>Dernière mise à jour</td>
<td>
<p>Juin 2009, il existe une <a href="https://gna.org/projects/jyraphe/">version 0.6 alpha de janvier 2010</a> et un <a href="https://github.com/tester22/Jyraphe">fork sur github de mars 2011</a></p>
</td>
<td>Oct 2011</td>
<td>Nov 2011</td>
</tr>
<tr>
<td>Installation</td>
<td>Traduction Fr pas simple, sinon facile</td>
<td>Assez difficile (création base et utilisateur manuel), beaucoup d&#8217;options</td>
<td>Facile</td>
</tr>
<tr>
<td>Traduit</td>
<td>Oui</td>
<td>Oui</td>
<td>Oui</td>
</tr>
<tr>
<td>Authentification</td>
<td>Non (contournement via .htaccess)</td>
<td>Oui obligatoire pour l&#8217;upload, pas pour le téléchargement</td>
<td>Optionnel pour l&#8217;upload, Non pour le téléchargement</td>
</tr>
<tr>
<td>Protection des fichiers par mot de passe</td>
<td>Oui</td>
<td>Oui</td>
<td>Non</td>
</tr>
<tr>
<td>Purge automatique des fichiers</td>
<td>Non</td>
<td>Oui</td>
<td>Non</td>
</tr>
<tr>
<td>Limitation du nombre de téléchargement</td>
<td>Oui (téléchargement unique)</td>
<td>Non</td>
<td>Non</td>
</tr>
<tr>
<td>Durée de validité du téléchargement</td>
<td>Oui (1 min / jour/ semaine / mois)</td>
<td>Oui (1 à 20j)</td>
<td>Non</td>
</tr>
<tr>
<td>Aspect</td>
<td>Correct</td>
<td>Beau</td>
<td>Beau</td>
</tr>
<tr>
<td>Divers</td>
<td>Pas de liste des fichiers existant</td>
<td>Lourd (24Mo) !!</td>
<td>
</td>
</tr>
</tbody>
</table>
<table style="width: 567px; height: 194px; border-width: 1px;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td width="100"><strong>Application</strong></td>
<td width="100"><strong><a title="Lien permanent vers Installation d’un dépôt de fichier : OpenUpload" rel="bookmark" href="http://voidandany.free.fr/index.php/installation-dun-depot-de-fichier-openupload/">OpenUpload</a></strong></td>
<td width="100"><strong><a title="Lien permanent vers Installation d’un dépôt de fichier : cFTP" rel="bookmark" href="http://voidandany.free.fr/index.php/installation-d%e2%80%99un-depot-de-fichier-cftp/">cFTP</a></strong></td>
</tr>
<tr>
<td>Dernière mise à jour</td>
<td>Nov 2010</td>
<td>Oct 2011</td>
</tr>
<tr>
<td>Installation</td>
<td>Difficile (beaucoup d&#8217;options, de paramétrage)</td>
<td>Moyen</td>
</tr>
<tr>
<td>Traduit</td>
<td>Oui</td>
<td>Oui</td>
</tr>
<tr>
<td>Authentification</td>
<td>Oui ultra-paramétrable</td>
<td>Oui pour l&#8217;upload et le téléchargement</td>
</tr>
<tr>
<td>Protection des fichiers par mot de passe</td>
<td>Oui</td>
<td>Non</td>
</tr>
<tr>
<td>Purge automatique des fichiers</td>
<td>?</td>
<td>Non</td>
</tr>
<tr>
<td>Limitation du nombre de téléchargement</td>
<td>Non</td>
<td>Non</td>
</tr>
<tr>
<td>Durée de validité du téléchargement</td>
<td>Non</td>
<td>Non</td>
</tr>
<tr>
<td>Aspect</td>
<td>Moche</td>
<td>Beau</td>
</tr>
<tr>
<td>Divers</td>
<td>Très paramétrable, mais compliqué</td>
<td>Usage très spécifique, les fichiers sont rattachés à une notion de client</td>
</tr>
</tbody>
</table>
]]></content:encoded>
			<wfw:commentRss>http://voidandany.free.fr/index.php/installation-dun-depot-de-fichier-bilan/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installation d’un dépôt de fichier : cFTP</title>
		<link>http://voidandany.free.fr/index.php/installation-dun-depot-de-fichier-cftp/</link>
		<comments>http://voidandany.free.fr/index.php/installation-dun-depot-de-fichier-cftp/#comments</comments>
		<pubDate>Tue, 17 Jan 2012 13:29:48 +0000</pubDate>
		<dc:creator>voidAndAny</dc:creator>
				<category><![CDATA[site web]]></category>
		<category><![CDATA[dockstar]]></category>
		<category><![CDATA[nginx]]></category>

		<guid isPermaLink="false">http://voidandany.free.fr/?p=4529</guid>
		<description><![CDATA[Promis c&#8217;est le dernier (enfin normalement) dépôt de fichier que je test, il s&#8217;agit cette fois ci de cFTP Ce dernier est un peu en marge des autre car clairement orienté professionnel, les fichiers uploadés le sont en effet à destination d&#8217;un client particulier. &#8230; <a href="http://voidandany.free.fr/index.php/installation-dun-depot-de-fichier-cftp/">Continuer la lecture <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Promis c&#8217;est le dernier (enfin normalement) dépôt de fichier que je test, il s&#8217;agit cette fois ci de <a href="http://code.google.com/p/clients-oriented-ftp/">cFTP</a></p>
<p>Ce dernier est un peu en marge des autre car clairement orienté professionnel, les fichiers uploadés le sont en effet à destination d&#8217;un client particulier.</p>
<p>&nbsp;</p>
<h2>Pré-requis installation</h2>
<p>On doit créer une base dédiée, pour cela on se connecte à MySQL :</p>
<div>
<div>
<pre>mysql -u root -p</pre>
</div>
</div>
<p lang="sql">Puis on lance l&#8217;ordre SQL (à adapter):</p>
<div>
<div>
<pre>CREATE DATABASE cftp;</pre>
</div>
</div>
<p>&nbsp;</p>
<h2>Installation</h2>
<p><a href="http://code.google.com/p/clients-oriented-ftp/downloads/list">Télécharger l’archive</a>, la décompresser dans l’arborescence de son serveur Web, fixer les droits utilisateur (www-data propriétaire des fichiers) et configurer son serveur Web</p>
<p>On pourra ensuite <a href="http://code.google.com/p/clients-oriented-ftp/downloads/list">télécharger la traduction française</a>, deziper le fichier et copier le fichier vars.php dans includes/</p>
<p>Editer le fichier includes/sys.vars.php et mettre à jour les informatons de connexion SQL</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">define<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #ff0000;">'DB_NAME'</span>, <span style="color: #ff0000;">'cftp'</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>; <span style="color: #000000; font-weight: bold;">//</span> database name
define<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #ff0000;">'DB_HOST'</span>, <span style="color: #ff0000;">'localhost'</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>; <span style="color: #000000; font-weight: bold;">//</span> database host <span style="color: #7a0874; font-weight: bold;">&#40;</span>most of the <span style="color: #7a0874; font-weight: bold;">times</span> its localhost<span style="color: #7a0874; font-weight: bold;">&#41;</span>
define<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #ff0000;">'DB_USER'</span>, <span style="color: #ff0000;">'root'</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>; <span style="color: #000000; font-weight: bold;">//</span> user related to cftp<span style="color: #ff0000;">'s database
define('</span>DB_PASSWORD<span style="color: #ff0000;">', '</span><span style="color: #ff0000;">'); // the password for that userfsf</span></pre></div></div>

<p>Puis on va à l&#8217;URL de cFTP dans le &laquo;&nbsp;sous-répertoire&nbsp;&raquo; install :</p>
<p>http://www.domaine.fr/cftp/install</p>
<p>Les données à renseigner se passent de commentaires (paramétrage fait avant d&#8217;avoir installé la traduction française) :</p>
<p><a rel="attachment wp-att-4531" href="http://voidandany.free.fr/index.php/installation-dun-depot-de-fichier-cftp/2012-01-17_140545/"><img class="aligncenter size-full wp-image-4531" title="2012-01-17_140545" src="http://voidandany.free.fr/wp-content/uploads/2012-01-17_140545.png" alt="" width="505" height="667" /></a></p>
<p>Sur l&#8217;écran suivant on peut directement se logguer.</p>
<p><a rel="attachment wp-att-4532" href="http://voidandany.free.fr/index.php/installation-dun-depot-de-fichier-cftp/2012-01-17_140605/"><img class="aligncenter size-medium wp-image-4532" title="2012-01-17_140605" src="http://voidandany.free.fr/wp-content/uploads/2012-01-17_140605-300x123.png" alt="" width="300" height="123" /></a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<h2>Utilisation</h2>
<p>L&#8217;écran de login sépare l&#8217;accès administrateur de client :</p>
<p><a rel="attachment wp-att-4539" href="http://voidandany.free.fr/index.php/installation-dun-depot-de-fichier-cftp/2012-01-17_142713/"><img class="aligncenter size-full wp-image-4539" title="2012-01-17_142713" src="http://voidandany.free.fr/wp-content/uploads/2012-01-17_142713.png" alt="" width="376" height="410" /></a></p>
<p>La page d&#8217;accueil (loggué en administrateur)</p>
<p><a rel="attachment wp-att-4530" href="http://voidandany.free.fr/index.php/installation-dun-depot-de-fichier-cftp/2012-01-17_140821/"><img title="2012-01-17_140821" src="http://voidandany.free.fr/wp-content/uploads/2012-01-17_140821.png" alt="" /></a></p>
<p>&nbsp;</p>
<p>L&#8217;upload d&#8217;un fichier est obligatoirement rattaché à un client il faut donc en créer un :</p>
<p><a rel="attachment wp-att-4533" href="http://voidandany.free.fr/index.php/installation-dun-depot-de-fichier-cftp/2012-01-17_140913/"><img class="aligncenter size-full wp-image-4533" title="2012-01-17_140913" src="http://voidandany.free.fr/wp-content/uploads/2012-01-17_140913.png" alt="" width="560" height="501" /></a></p>
<p>Puis on peut procéder à l&#8217;upload :</p>
<p><a rel="attachment wp-att-4535" href="http://voidandany.free.fr/index.php/installation-dun-depot-de-fichier-cftp/2012-01-17_141006/"><img class="aligncenter size-full wp-image-4535" title="2012-01-17_141006" src="http://voidandany.free.fr/wp-content/uploads/2012-01-17_141006.png" alt="" width="559" height="285" /></a><a rel="attachment wp-att-4536" href="http://voidandany.free.fr/index.php/installation-dun-depot-de-fichier-cftp/2012-01-17_141020/"><img class="aligncenter size-medium wp-image-4536" title="2012-01-17_141020" src="http://voidandany.free.fr/wp-content/uploads/2012-01-17_141020-300x172.png" alt="" width="300" height="172" /></a></p>
<p>&nbsp;</p>
<p>Le client quand il se logguera verra alors le fichier :</p>
<p><a rel="attachment wp-att-4538" href="http://voidandany.free.fr/index.php/installation-dun-depot-de-fichier-cftp/2012-01-17_141141/"><img class="aligncenter size-full wp-image-4538" title="2012-01-17_141141" src="http://voidandany.free.fr/wp-content/uploads/2012-01-17_141141.png" alt="" /></a></p>
<p>On peut accéder à cette même interface du client en cliquant sur la loupe dans l’administration des clients :</p>
<p><a rel="attachment wp-att-4537" href="http://voidandany.free.fr/index.php/installation-dun-depot-de-fichier-cftp/2012-01-17_141110/"><img class="aligncenter size-medium wp-image-4537" title="2012-01-17_141110" src="http://voidandany.free.fr/wp-content/uploads/2012-01-17_141110-300x37.png" alt="" width="300" height="37" /></a></p>
<p>&nbsp;</p>
<h2>Conclusion</h2>
<p>Usage spécifique (notion de client), propre, beau, léger (600 ko)</p>
]]></content:encoded>
			<wfw:commentRss>http://voidandany.free.fr/index.php/installation-dun-depot-de-fichier-cftp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installation d’un dépôt de fichier : OpenUpload</title>
		<link>http://voidandany.free.fr/index.php/installation-dun-depot-de-fichier-openupload/</link>
		<comments>http://voidandany.free.fr/index.php/installation-dun-depot-de-fichier-openupload/#comments</comments>
		<pubDate>Tue, 17 Jan 2012 10:31:50 +0000</pubDate>
		<dc:creator>voidAndAny</dc:creator>
				<category><![CDATA[site web]]></category>
		<category><![CDATA[dockstar]]></category>
		<category><![CDATA[nginx]]></category>

		<guid isPermaLink="false">http://voidandany.free.fr/?p=4496</guid>
		<description><![CDATA[Encore un dépôt de fichier : OpenUpload &#160; Installation Après avoir téléchargé l’archive, l&#8217;avoir décompressé dans l’arborescence de son serveur Web, fixé les droits utilisateur (www-data propriétaire des fichiers) et configuré son serveur Web (pas de ruse) On va à l&#8217;adresse d&#8217;openupload et &#8230; <a href="http://voidandany.free.fr/index.php/installation-dun-depot-de-fichier-openupload/">Continuer la lecture <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Encore un dépôt de fichier : <a title="OpenUpload" href="http://openupload.sourceforge.net/" target="_blank">OpenUpload</a></p>
<p>&nbsp;</p>
<h2>Installation</h2>
<p>Après avoir <a href="http://sourceforge.net/projects/openupload/files/openupload/v0.4/openupload-0.4.2.tar.gz/download">téléchargé l’archive</a>, l&#8217;avoir décompressé dans l’arborescence de son serveur Web, fixé les droits utilisateur (www-data propriétaire des fichiers) et configuré son serveur Web (pas de ruse)</p>
<p>On va à l&#8217;adresse d&#8217;openupload et l&#8217;installeur se lance et va nous guider au travers de 9 étapes :</p>
<p><a title="OpenUpload" href="http://openupload.sourceforge.net/" target="_blank"></a></p>
<p><a rel="attachment wp-att-4497" href="http://voidandany.free.fr/index.php/installation-dun-depot-de-fichier-openupload/2012-01-16_142738/"><img class="size-full wp-image-4497 aligncenter" title="2012-01-16_142738" src="http://voidandany.free.fr/wp-content/uploads/2012-01-16_142738.png" alt="" width="600" height="318" /></a></p>
<p><strong>Etape 1 </strong>: vérification des pré-requis</p>
<p><a rel="attachment wp-att-4498" href="http://voidandany.free.fr/index.php/installation-dun-depot-de-fichier-openupload/2012-01-16_142749/"><img class="size-full wp-image-4498 aligncenter" title="2012-01-16_142749" src="http://voidandany.free.fr/wp-content/uploads/2012-01-16_142749.png" alt="" width="215" height="64" /></a></p>
<p><a rel="attachment wp-att-4499" href="http://voidandany.free.fr/index.php/installation-dun-depot-de-fichier-openupload/2012-01-16_142807/"><img class="size-full wp-image-4499 aligncenter" title="2012-01-16_142807" src="http://voidandany.free.fr/wp-content/uploads/2012-01-16_142807.png" alt="" width="330" height="633" /></a></p>
<p>Les croix rouges ne posent pas de problème, il faut avoir au moins le support d&#8217;une base de données (MySQL dans mon cas) et il n&#8217;est pas nécessaire d&#8217;avoir un système de barre de progression.</p>
<p>&nbsp;</p>
<p><strong>Etape 2 </strong>: chemins</p>
<p><a rel="attachment wp-att-4500" href="http://voidandany.free.fr/index.php/installation-dun-depot-de-fichier-openupload/2012-01-16_143138/"><img class="size-full wp-image-4500 aligncenter" title="2012-01-16_143138" src="http://voidandany.free.fr/wp-content/uploads/2012-01-16_143138.png" alt="" width="562" height="257" /></a></p>
<p>Le premier chemin est le chemin d&#8217;openupload sur le système de fichier, ce répertoire contient les librairies utilisé par openupload, il est envisageable (conseillé) de déplacer ce répertoire de l&#8217;arborescence web et de ne garder que le sous-répertoire www (qui contient l&#8217;application openupload proprement dite) dans cette dernière</p>
<p>WWW server URL est l&#8217;URL de base pour accéder à votre serveur</p>
<p>WWW root path est l&#8217;alias web de l&#8217;application openupload, celle que vous avez configuré dans votre serveur web.</p>
<p>Enfin le dernier chemin est le chemin dans lequel les fichiers uploadés seront stockés. Ce dernier doit contenir un sous-répertoire tmp et l&#8217;utilisateur exécutant le serveur web doit y avoir les droits d&#8217;écriture.</p>
<p>&nbsp;</p>
<p><strong>Etape 3-4 </strong>: base de données</p>
<p><a rel="attachment wp-att-4501" href="http://voidandany.free.fr/index.php/installation-dun-depot-de-fichier-openupload/2012-01-16_143155/"><img class="size-full wp-image-4501 aligncenter" title="2012-01-16_143155" src="http://voidandany.free.fr/wp-content/uploads/2012-01-16_143155.png" alt="" width="248" height="63" /></a></p>
<p>&nbsp;</p>
<p><a rel="attachment wp-att-4510" href="http://voidandany.free.fr/index.php/installation-dun-depot-de-fichier-openupload/2012-01-16_144749/"><img class="size-full wp-image-4510 aligncenter" title="2012-01-16_144749" src="http://voidandany.free.fr/wp-content/uploads/2012-01-16_144749.png" alt="" width="389" height="342" /></a>Le programme d’installation permet la création de la base et de son utilisateur dédié ce qui est pratique (dans mon cas de test je n&#8217;ai pas créé d&#8217;utilisateur dédié mais utilisé mon root)</p>
<p>La dernière option permet d&#8217;indiquer le niveau des données à insérer.</p>
<ul>
<li>No : Rien n&#8217;est fait niveau base de données</li>
<li>Structure only : seules les structures de table sont créées, aucune données n&#8217;est inséré, il vous faudra le faire à la main avant de pouvoir ne serait ce que vous connecter à openupload (sinon message pas clair indiquant que votre IP est blacklistée, banned)</li>
<li>Base system data : les groupes sont créés, l&#8217;utilisateur admin est créé et les droits de base (pour l’administrateur) sont créés</li>
</ul>
<p>Les autres options permettent d&#8217;insérer les données visant à faire faire fonctionner openupload selon 1 des 4 modes par défaut :</p>
<ul>
<li>Public mode : le site est complètement public. Les utilisateurs n&#8217;ont pas besoin d&#8217;être enregistrés pour téléchargé ni même uploader (fonctionnement de <a title="Installation d’un dépôt de fichier : Jyraphe (recalé)" href="http://voidandany.free.fr/index.php/installation-dun-depot-de-fichier-jyraphe-recale/">Jyraphe</a>)</li>
<li>Service mode : idem public mais les utilisateurs enregistrés ont plus de fonctions (moins de limitation, protection de leur fichiers par mot de passe, envoi d&#8217;email&#8230;)</li>
<li>Restricted mode : Téléchargement public mais nécessité d&#8217;être connecté pour uploader</li>
<li>Private mode : nécessité d&#8217;être connecté pour télécharger et uploader (fonctionnement de <a title="Installation d’un dépôt de fichier : FileZ (configuration sur NGINX)" href="http://voidandany.free.fr/index.php/installation-dun-depot-de-fichier-filez-configuration-sur-nginx/">FileZ</a>)</li>
</ul>
<p>A noter que ces différents modes d&#8217;insertion sont concrétisés par l&#8217;exécution d&#8217;un ou plusieurs fichier SQL présents dans /sql/mysql/</p>
<p>&nbsp;</p>
<p><strong>Etape 5 </strong>: options de l&#8217;application</p>
<p><a rel="attachment wp-att-4502" href="http://voidandany.free.fr/index.php/installation-dun-depot-de-fichier-openupload/2012-01-16_143456/"><img class="size-full wp-image-4502 aligncenter" title="2012-01-16_143456" src="http://voidandany.free.fr/wp-content/uploads/2012-01-16_143456.png" alt="" width="600" height="578" /></a></p>
<p>Pas grand chose à dire, je n&#8217;ai rien modifié à part le renseignement des adresses email (obligatoires)</p>
<p>&nbsp;</p>
<p><strong>Etape 6 </strong>: utilisateur</p>
<p><a rel="attachment wp-att-4503" href="http://voidandany.free.fr/index.php/installation-dun-depot-de-fichier-openupload/2012-01-16_143511/"><img class="size-full wp-image-4503 aligncenter" title="2012-01-16_143511" src="http://voidandany.free.fr/wp-content/uploads/2012-01-16_143511.png" alt="" width="329" height="187" /></a></p>
<p>On indique ici les nom et mot de passe de l&#8217;administrateur et des groupes pré-définis.</p>
<p>A noter que ces données ne seront insérés que si vous avez sélectionné au moins l&#8217;insertion des données de base (étapes 3-4)</p>
<p>&nbsp;</p>
<p><strong>Etape 7 </strong>: plugins</p>
<p><a rel="attachment wp-att-4504" href="http://voidandany.free.fr/index.php/installation-dun-depot-de-fichier-openupload/2012-01-16_143544/"><img class="aligncenter size-full wp-image-4504" title="2012-01-16_143544" src="http://voidandany.free.fr/wp-content/uploads/2012-01-16_143544.png" alt="" width="426" height="251" /></a></p>
<p>Sélection des plugins a installer, je n&#8217;ai pas pris le temps d&#8217;étudier la portée et les fonctions de ces plugins.</p>
<p>&nbsp;</p>
<p><strong>Etape 8 </strong>: installation de la base</p>
<p>L&#8217;installation proprement dite débute par la base de données (passage des scripts présents sous /sql/mysql/</p>
<p><a rel="attachment wp-att-4505" href="http://voidandany.free.fr/index.php/installation-dun-depot-de-fichier-openupload/2012-01-16_143556/"><img class="aligncenter size-full wp-image-4505" title="2012-01-16_143556" src="http://voidandany.free.fr/wp-content/uploads/2012-01-16_143556.png" alt="" width="287" height="96" /></a></p>
<p>&nbsp;</p>
<p><a rel="attachment wp-att-4505" href="http://voidandany.free.fr/index.php/installation-dun-depot-de-fichier-openupload/2012-01-16_143556/"></a><a rel="attachment wp-att-4506" href="http://voidandany.free.fr/index.php/installation-dun-depot-de-fichier-openupload/2012-01-16_143604/"><img class="aligncenter size-full wp-image-4506" title="2012-01-16_143604" src="http://voidandany.free.fr/wp-content/uploads/2012-01-16_143604.png" alt="" width="234" height="177" /></a></p>
<p>&nbsp;</p>
<p><a rel="attachment wp-att-4507" href="http://voidandany.free.fr/index.php/installation-dun-depot-de-fichier-openupload/2012-01-16_143615/"><img class="aligncenter size-full wp-image-4507" title="2012-01-16_143615" src="http://voidandany.free.fr/wp-content/uploads/2012-01-16_143615.png" alt="" width="291" height="498" /></a></p>
<p><a rel="attachment wp-att-4511" href="http://voidandany.free.fr/index.php/installation-dun-depot-de-fichier-openupload/2012-01-16_144817/"><img class="aligncenter size-full wp-image-4511" title="2012-01-16_144817" src="http://voidandany.free.fr/wp-content/uploads/2012-01-16_144817.png" alt="" width="239" height="277" /></a></p>
<p>&nbsp;</p>
<p><strong>Etape 9 </strong>: sauvegarde configuration</p>
<p>Puis les choix sont sauvegardés dans le fichier www/config.inc.php</p>
<p><a rel="attachment wp-att-4508" href="http://voidandany.free.fr/index.php/installation-dun-depot-de-fichier-openupload/2012-01-16_143623/"><img class="aligncenter size-full wp-image-4508" title="2012-01-16_143623" src="http://voidandany.free.fr/wp-content/uploads/2012-01-16_143623.png" alt="" width="564" height="160" /></a></p>
<p><a rel="attachment wp-att-4509" href="http://voidandany.free.fr/index.php/installation-dun-depot-de-fichier-openupload/2012-01-16_143629/"><img class="aligncenter size-full wp-image-4509" title="2012-01-16_143629" src="http://voidandany.free.fr/wp-content/uploads/2012-01-16_143629.png" alt="" width="564" height="221" /></a></p>
<p>&nbsp;</p>
<h2>Utilisation</h2>
<p>On peut alors se connecter sur openupload (pas forcement obligatoire si vous avez configuré openupload en mode publique)</p>
<p><a rel="attachment wp-att-4512" href="http://voidandany.free.fr/index.php/installation-dun-depot-de-fichier-openupload/2012-01-16_144844/"><img class="aligncenter size-full wp-image-4512" title="2012-01-16_144844" src="http://voidandany.free.fr/wp-content/uploads/2012-01-16_144844.png" alt="" width="600" height="309" /></a></p>
<p>On arrive arrive sur la page d&#8217;upload :</p>
<p><a rel="attachment wp-att-4513" href="http://voidandany.free.fr/index.php/installation-dun-depot-de-fichier-openupload/2012-01-16_144906/"><img class="aligncenter size-full wp-image-4513" title="2012-01-16_144906" src="http://voidandany.free.fr/wp-content/uploads/2012-01-16_144906.png" alt="" width="600" height="253" /></a></p>
<p>Les options d&#8217;upload (fonction des droits et des plugins activés)</p>
<p><a rel="attachment wp-att-4525" href="http://voidandany.free.fr/index.php/installation-dun-depot-de-fichier-openupload/2012-01-17_111952/"><img class="aligncenter size-full wp-image-4525" title="2012-01-17_111952" src="http://voidandany.free.fr/wp-content/uploads/2012-01-17_111952.png" alt="" width="509" height="447" /></a>On peut aussi accéder à la liste de ses fichiers :</p>
<p><a rel="attachment wp-att-4514" href="http://voidandany.free.fr/index.php/installation-dun-depot-de-fichier-openupload/2012-01-16_153604/"><img class="aligncenter size-full wp-image-4514" title="2012-01-16_153604" src="http://voidandany.free.fr/wp-content/uploads/2012-01-16_153604.png" alt="" width="600" height="141" /></a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>Enfin en tant qu’administrateur, on a accès à différentes pages de configuration :</p>
<p><a rel="attachment wp-att-4515" href="http://voidandany.free.fr/index.php/installation-dun-depot-de-fichier-openupload/2012-01-16_153614/"><img class="aligncenter size-medium wp-image-4515" title="2012-01-16_153614" src="http://voidandany.free.fr/wp-content/uploads/2012-01-16_153614-300x180.png" alt="" width="300" height="180" /></a></p>
<p>Liste de la totalité des fichiers uploadés (tout utilisateur) avec possibilité de les supprimer et de bannir les IP des uploadeur</p>
<p><a rel="attachment wp-att-4516" href="http://voidandany.free.fr/index.php/installation-dun-depot-de-fichier-openupload/2012-01-16_153639/"><img class="aligncenter size-medium wp-image-4516" title="2012-01-16_153639" src="http://voidandany.free.fr/wp-content/uploads/2012-01-16_153639-300x92.png" alt="" width="300" height="92" /></a></p>
<p>Liste des utilisateurs :</p>
<p><a rel="attachment wp-att-4517" href="http://voidandany.free.fr/index.php/installation-dun-depot-de-fichier-openupload/2012-01-16_153648/"><img class="aligncenter size-medium wp-image-4517" title="2012-01-16_153648" src="http://voidandany.free.fr/wp-content/uploads/2012-01-16_153648-300x70.png" alt="" width="300" height="70" /></a></p>
<p>Des groupes :</p>
<p><a rel="attachment wp-att-4518" href="http://voidandany.free.fr/index.php/installation-dun-depot-de-fichier-openupload/2012-01-16_153655/"><img class="aligncenter size-medium wp-image-4518" title="2012-01-16_153655" src="http://voidandany.free.fr/wp-content/uploads/2012-01-16_153655-300x94.png" alt="" width="300" height="94" /></a></p>
<p>Et des droits par groupe, sous la forme d&#8217;<a href="http://www.google.fr/url?sa=t&amp;rct=j&amp;q=acl&amp;source=web&amp;cd=1&amp;ved=0CDUQFjAA&amp;url=http%3A%2F%2Ffr.wikipedia.org%2Fwiki%2FAccess_Control_List&amp;ei=I0wVT6L3CIOmhAet8qSIAg&amp;usg=AFQjCNFSlw3FakF1uUDWyXUtgbKKVJKQTA">ACL</a> : très puissant/configurable mais complexe et pas documenté</p>
<p><a rel="attachment wp-att-4519" href="http://voidandany.free.fr/index.php/installation-dun-depot-de-fichier-openupload/2012-01-16_153712/"><img class="aligncenter size-medium wp-image-4519" title="2012-01-16_153712" src="http://voidandany.free.fr/wp-content/uploads/2012-01-16_153712-300x170.png" alt="" width="300" height="170" /></a></p>
<p>Enfin information intéressante opeupload log les accès et les actions des différents utilisateurs (niveau de log paramétré en étape 5)</p>
<p><a rel="attachment wp-att-4520" href="http://voidandany.free.fr/index.php/installation-dun-depot-de-fichier-openupload/2012-01-16_153741/"><img class="aligncenter size-medium wp-image-4520" title="2012-01-16_153741" src="http://voidandany.free.fr/wp-content/uploads/2012-01-16_153741-300x117.png" alt="" width="300" height="117" /></a></p>
<p>&nbsp;</p>
<h2>Conclusion</h2>
<p>Openupload semble la solution ultime, selon les droits appliqués on peut lui faire prendre différents comportement (publique ou protégé + des étapes intermédiaires) répondant ainsi à la majorité des besoins</p>
<p>L&#8217;application est relativement légère (3Mo)</p>
<p>Les fichiers ne sont pas accessibles depuis le disque (noms encodés)</p>
<p>MAIS par contre le thème par défaut (le seul fournis) est moche, très années 90&#8230;.</p>
<p>&nbsp;</p>
<p><span style="text-decoration: underline;"><em><strong>Sources :</strong></em></span></p>
<ul>
<li><a href="http://www.google.fr/url?sa=t&amp;rct=j&amp;q=openupload&amp;source=web&amp;cd=3&amp;ved=0CD8QFjAC&amp;url=http%3A%2F%2Fwww.opendoc.net%2Fsolutions%2Fcomparatif-partage-web-filez-fex-webshare-jyraphe-openupload&amp;ctbs=lr%3Alang_1fr&amp;ei=-1IUT43wKYuYhQefp_CbAg&amp;usg=AFQjCNH2t_eAMGoAQWN0yUWi8w86ldWM-Q&amp;cad=rja">Comparatif de solutions de partage via du web [OPENDOC.NET]</a></li>
<li><a rel="bookmark" href="http://www.planetedugeek.fr/index.php/2011/03/29/installer-openupload-howto-openupload/">Installer OpenUpload | How to OpenUpload</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://voidandany.free.fr/index.php/installation-dun-depot-de-fichier-openupload/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Installation d’un dépôt de fichier : KoLoad</title>
		<link>http://voidandany.free.fr/index.php/installation-dun-depot-de-fichier-koload/</link>
		<comments>http://voidandany.free.fr/index.php/installation-dun-depot-de-fichier-koload/#comments</comments>
		<pubDate>Mon, 16 Jan 2012 13:14:48 +0000</pubDate>
		<dc:creator>voidAndAny</dc:creator>
				<category><![CDATA[site web]]></category>
		<category><![CDATA[dockstar]]></category>
		<category><![CDATA[nginx]]></category>

		<guid isPermaLink="false">http://voidandany.free.fr/?p=4487</guid>
		<description><![CDATA[Je continue sur ma lancée du test des dépôts de fichiers. Le suivant listé dans Applications libres d’upload de fichiers volumineux et testé est KoLoad, cependant le lien indiqué pour la page du projet n&#8217;existe plus. Le code peut être récupéré à &#8230; <a href="http://voidandany.free.fr/index.php/installation-dun-depot-de-fichier-koload/">Continuer la lecture <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Je continue sur ma lancée du test des dépôts de fichiers.</p>
<p>Le suivant listé dans <a rel="bookmark" href="http://blog.admin-linux.org/logiciels-libres/applications-libres-dupload-de-fichiers-volumineux">Applications libres d’upload de fichiers volumineux</a> et testé est KoLoad, cependant le lien indiqué pour la page du projet n&#8217;existe plus.</p>
<p>Le code peut être récupéré à cette adresse : <a href="http://codingteam.net/project/koload"><em>KOLoad</em> &#8211; CodingTeam</a></p>
<p>L&#8217;installation est ultra-simple, <a href="http://codingteam.net/project/koload/download/file/koload-v1.5.zip">on télécharge l’archive</a>, on la décompresse dans l’arborescence de son serveur Web, on fixe les droits utilisateur (www-data propriétaire des fichiers) et on configure ensuite son serveur Web (pas de ruse).</p>
<p>On peut ensuite aller sur la page du projet :</p>
<p><a href="http://voidandany.free.fr/wp-content/uploads/2012-01-13_170520.png"><img class="aligncenter size-full wp-image-4488" title="2012-01-13_170520" src="http://voidandany.free.fr/wp-content/uploads/2012-01-13_170520.png" alt="" width="600" height="218" /></a></p>
<p>On arrive directement sur la liste des fichiers disponibles</p>
<p>Si on veut envoyer un fichier on clique sur le lien en bas à gauche et on choisi son fichier dans la popup qui s&#8217;ouvre :</p>
<p><a href="http://voidandany.free.fr/wp-content/uploads/2012-01-13_170555.png"><img class="aligncenter size-medium wp-image-4489" title="2012-01-13_170555" src="http://voidandany.free.fr/wp-content/uploads/2012-01-13_170555-300x88.png" alt="" width="300" height="88" /></a></p>
<p>On choisi son fichier et on l&#8217;envoi :</p>
<p><a href="http://voidandany.free.fr/wp-content/uploads/2012-01-13_170607.png"><img class="aligncenter size-medium wp-image-4490" title="2012-01-13_170607" src="http://voidandany.free.fr/wp-content/uploads/2012-01-13_170607-300x88.png" alt="" width="300" height="88" /></a></p>
<p>Il existe 2-3 configurations possibles, faisable dans le fichier conf.php à la racine.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'VERSION'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'1.5'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>               <span style="color: #666666; font-style: italic;">// version of KOLoad</span>
<span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'LANG'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'fr'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>                   <span style="color: #666666; font-style: italic;">// language, available : en, fr, de, es, it</span>
<span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'SITENAME'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'KOLoad'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>           <span style="color: #666666; font-style: italic;">// type your site name here</span>
<span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'UPLOAD'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'true'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>               <span style="color: #666666; font-style: italic;">// allow upload module, type 'false' to disable and 'true' to enable</span>
<span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'DELETE'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'true'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>               <span style="color: #666666; font-style: italic;">// allow delete module, type 'false' to disable and 'true' to enable</span>
<span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'RENAME'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'true'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>               <span style="color: #666666; font-style: italic;">// allow rename module, type 'false' to disable and 'true' to enable</span>
<span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'PASSWORD'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>                 <span style="color: #666666; font-style: italic;">// enable the login fonction if there's a password, else, koload is public</span>
<span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'COLOURS'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'blue'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>              <span style="color: #666666; font-style: italic;">// change the colours of KOLoad, available : blue, red, green, grey</span>
<span style="color: #990000;">ob_start</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'ob_gzhandler'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>               <span style="color: #666666; font-style: italic;">// force gzip compression (PHP), delete this line to disable</span></pre></div></div>

<p>Notamment la possibilité de mettre un mot de passe, ce qui se traduit par cette page dès lors que la fonctionnalité est activée :</p>
<p><a href="http://voidandany.free.fr/wp-content/uploads/2012-01-13_173437.png"><img class="aligncenter size-medium wp-image-4491" title="2012-01-13_173437" src="http://voidandany.free.fr/wp-content/uploads/2012-01-13_173437-300x202.png" alt="" width="300" height="202" /></a>Pour accéder à la liste des fichiers et à l&#8217;upload il faut alors saisir le mot de passe choisi.</p>
<p>Par contre ce mot de passe ne protégera pas le téléchargement des fichiers pour peu que vous connaissez l&#8217;URL.</p>
<p>Concernant l&#8217;URL des fichiers uploadés, il s&#8217;agit simplement du nom du fichier, il n&#8217;ya pas d&#8217;encodage, de caractère aléatoire, etc, ainsi l&#8217;URL de téléchargement du fichier exemple fournis par défaut à l&#8217;installation de Koload est :</p>
<p>http://www.mon_domaine.fr/koload/files/example.txt</p>
<p>&nbsp;</p>
<h2>Conclusion :</h2>
<p>Simple (pas de base, d&#8217;URL rewriting, etc), léger, plutôt beau</p>
<p>Pas de notion de date de validité du fichier (pas vraiment nécessaire), pas de mot de passe pour le téléchargement des fichiers, nom des fichiers non protégé, sécurité en règle générale (est ce vraiment sécurisé ?)</p>
<p>&nbsp;</p>
<p><em><strong>Sources :</strong></em></p>
<ul>
<li><a rel="bookmark" href="http://blog.admin-linux.org/logiciels-libres/applications-libres-dupload-de-fichiers-volumineux">Applications libres d’upload de fichiers volumineux</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://voidandany.free.fr/index.php/installation-dun-depot-de-fichier-koload/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installation d&#8217;un dépôt de fichier : FileZ (configuration sur NGINX)</title>
		<link>http://voidandany.free.fr/index.php/installation-dun-depot-de-fichier-filez-configuration-sur-nginx/</link>
		<comments>http://voidandany.free.fr/index.php/installation-dun-depot-de-fichier-filez-configuration-sur-nginx/#comments</comments>
		<pubDate>Wed, 11 Jan 2012 17:33:33 +0000</pubDate>
		<dc:creator>voidAndAny</dc:creator>
				<category><![CDATA[site web]]></category>
		<category><![CDATA[dockstar]]></category>
		<category><![CDATA[nginx]]></category>

		<guid isPermaLink="false">http://voidandany.free.fr/?p=4455</guid>
		<description><![CDATA[Après avoir testé Jyraphe, voici un autre script de dépôt de fichier FileZ Ce script est développé par l&#8217;Université d&#8217;Avignon et des Pays de Vaucluse et les sources sont sur GitHub En vu de tester le logiciel j&#8217;ai réalisé une installation minimal, ainsi &#8230; <a href="http://voidandany.free.fr/index.php/installation-dun-depot-de-fichier-filez-configuration-sur-nginx/">Continuer la lecture <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Après avoir testé <a title="Lien permanent vers Installation d’un dépôt de fichier : Jyraphe (recalé)" rel="bookmark" href="http://voidandany.free.fr/index.php/installation-dun-depot-de-fichier-jyraphe-recale/">Jyraphe</a>, voici un autre script de dépôt de fichier <a href="http://gpl.univ-avignon.fr/filez/">FileZ</a></p>
<p>Ce script est développé par <a href="http://gpl.univ-avignon.fr/" target="#_blank">l&#8217;Université d&#8217;Avignon et des Pays de Vaucluse</a> et les <a href="https://github.com/UAPV/FileZ">sources sont sur GitHub</a></p>
<p>En vu de tester le logiciel j&#8217;ai réalisé une installation minimal, ainsi par exemple je n&#8217;ai pas installé APC qui permet d&#8217;avoir une barre de progression lors de l&#8217;upload (voir section &laquo;&nbsp;Installing and configuring APC&nbsp;&raquo; de cette <a href="https://github.com/UAPV/FileZ/blob/master/doc/INSTALL.markdown">page</a>).</p>
<p>FileZ permet de se brancher sur divers base utilisateur existante (LDAP, DB, <a href="http://fr.wikipedia.org/wiki/Central_Authentication_Service">CAS</a>), j&#8217;ai pris le cas le plus simple créer une base utilisateur dédiée.</p>
<p>&nbsp;</p>
<h2>Pré-requis installation</h2>
<p>On crée une base dédiée, la table des utilisateurs et un utilisateur.</p>
<p>Pour cela on se connecte à MySQL :</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;">mysql <span style="color: #66cc66;">-</span>u root <span style="color: #66cc66;">-</span>p</pre></div></div>

<p lang="sql">Puis on lance les ordres SQL (à adapter):</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">CREATE</span> <span style="color: #993333; font-weight: bold;">DATABASE</span> filez;
<span style="color: #993333; font-weight: bold;">USE</span> filez;
<span style="color: #993333; font-weight: bold;">CREATE</span> <span style="color: #993333; font-weight: bold;">TABLE</span> <span style="color: #ff0000;">`filez`</span><span style="color: #66cc66;">.</span><span style="color: #ff0000;">`db_users`</span> <span style="color: #66cc66;">&#40;</span>
<span style="color: #ff0000;">`uid`</span> SERIAL <span style="color: #993333; font-weight: bold;">NOT</span> <span style="color: #993333; font-weight: bold;">NULL</span> <span style="color: #66cc66;">,</span>
<span style="color: #ff0000;">`login`</span> <span style="color: #993333; font-weight: bold;">VARCHAR</span><span style="color: #66cc66;">&#40;</span> <span style="color: #cc66cc;">20</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">NOT</span> <span style="color: #993333; font-weight: bold;">NULL</span> <span style="color: #66cc66;">,</span>
<span style="color: #ff0000;">`password`</span> <span style="color: #993333; font-weight: bold;">VARCHAR</span><span style="color: #66cc66;">&#40;</span> <span style="color: #cc66cc;">40</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">NOT</span> <span style="color: #993333; font-weight: bold;">NULL</span> <span style="color: #66cc66;">,</span>
<span style="color: #ff0000;">`givenname`</span> <span style="color: #993333; font-weight: bold;">VARCHAR</span><span style="color: #66cc66;">&#40;</span> <span style="color: #cc66cc;">255</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">NOT</span> <span style="color: #993333; font-weight: bold;">NULL</span> <span style="color: #66cc66;">,</span>
<span style="color: #ff0000;">`sn`</span> <span style="color: #993333; font-weight: bold;">VARCHAR</span><span style="color: #66cc66;">&#40;</span> <span style="color: #cc66cc;">255</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">NOT</span> <span style="color: #993333; font-weight: bold;">NULL</span> <span style="color: #66cc66;">,</span>
<span style="color: #ff0000;">`mail`</span> <span style="color: #993333; font-weight: bold;">VARCHAR</span><span style="color: #66cc66;">&#40;</span> <span style="color: #cc66cc;">255</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">NOT</span> <span style="color: #993333; font-weight: bold;">NULL</span>
<span style="color: #66cc66;">&#41;</span> ENGINE <span style="color: #66cc66;">=</span> MYISAM ;
<span style="color: #993333; font-weight: bold;">INSERT</span> <span style="color: #993333; font-weight: bold;">INTO</span> <span style="color: #ff0000;">`filez`</span><span style="color: #66cc66;">.</span><span style="color: #ff0000;">`db_users`</span> <span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">`uid`</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">`login`</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">`password`</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">`givenname`</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">`sn`</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">`mail`</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">VALUES</span> <span style="color: #66cc66;">&#40;</span><span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'admin'</span><span style="color: #66cc66;">,</span> MD5<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'password'</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'Admin'</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'Olympe'</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'admin@olympe.local'</span><span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p>On crée ensuite les répertoires nécessaires à FileZ, le répertoire d&#8217;upload (exemple /var/Filez/uploads) et le répertoire de log (exemple /var/log/filez) et on s&#8217;assure que l&#8217;utilisateur exécutant le serveur web (www-data sans doute) à le droits d&#8217;y écrire.</p>
<h2>Installation</h2>
<p>Classiquement, <a href="https://github.com/UAPV/FileZ/downloads">on télécharge l&#8217;archive</a>, on la décompresse dans l&#8217;arborescence de son serveur Web, on fixe les droits utilisateur (www-data propriétaire des fichiers)</p>
<p><em><strong>Rque :</strong></em> Filez est assez volumineux, a ce point de l’installation (aucune données) le répertoire fait déjà 20Mo</p>
<p>On configure ensuite son serveur Web, dans le cas de NGINX, filez étant installé dans un sous-répertoire de la racine Web, voici ma configuration</p>
<pre>server {
        listen       80;
        server_name  www.domaine.fr;
        root         /var/www/domaine.fr;
 
        index           index.php;
 
	location /filez{
		access_log      /var/log/nginx/filez.access.log;
                location ~ \.php$ {
                        include         /etc/nginx/fastcgi_params;
                        fastcgi_param   SCRIPT_FILENAME  $document_root$fastcgi_script_name;
                        fastcgi_pass    127.0.0.1:9000;
                }
                if (!-e $request_filename) {
                        rewrite ^/(.*)$ /filez/index.php last;
                }
	}
}</pre>
<p>A noter ma traduction très personnelle des règles de réécriture Apache contenu dans le .htaccess à la racine de filez</p>

<div class="wp_syntax"><div class="code"><pre class="apache" style="font-family:monospace;">  <span style="color: #00007f;">RewriteCond</span> %{REQUEST_URI} !favicon.ico
  <span style="color: #00007f;">RewriteCond</span> %{REQUEST_URI} !doc/<span style="color: #00007f;">user</span>/(.*)\.
  <span style="color: #00007f;">RewriteCond</span> %{REQUEST_URI} !resources/(.*)\.
  <span style="color: #00007f;">RewriteRule</span> ^(.*)$ index.php [QSA,L]</pre></div></div>

<p>On peut ensuite aller sur l&#8217;URL de FileZ</p>
<p><a href="http://voidandany.free.fr/wp-content/uploads/2012-01-11_1615231.png"><img class="aligncenter size-full wp-image-4473" title="2012-01-11_161523" src="http://voidandany.free.fr/wp-content/uploads/2012-01-11_1615231.png" alt="" /></a></p>
<p>Le script d&#8217;installation nous prévient que le mod_rewrite n&#8217;est pas activé, normal puisque l&#8217;on est pas sous Apache et préconise divers paramétrages de php pour optimiser l&#8217;upload.</p>
<p>Paramétrage que je n&#8217;ai pas fait dans le cadre de ce test, peut être plus tard&#8230;</p>
<p>On peut continuer, s&#8217;affiche ensuite un long formulaire de paramétrage :</p>
<p><a href="http://voidandany.free.fr/wp-content/uploads/2012-01-11_170428.png"><img class="aligncenter size-full wp-image-4475" title="2012-01-11_170428" src="http://voidandany.free.fr/wp-content/uploads/2012-01-11_170428.png" alt="" /></a></p>
<p>Quelques éléments :</p>
<ul>
<li>Upload directory (absolute dir) (required) : mettre ici le répertoire créé en pré-requis</li>
<li>Log directory (absolute dir) (required) : mettre ici le répertoire créé en pré-requis</li>
<li>Use https : pour ce test je ne tiens pas à configurer le site en https (création et configuration des certificats), on le désactive donc</li>
<li>Upload progress monitoring library [help] : voir en introduction, je n&#8217;ai pas installé ce qu&#8217;il faut pour cette fonctionnalité</li>
<li>Database username (required) : toujours pour des raisons de test rapide je ne crée pas d&#8217;utilisateur dédié à Filez, j&#8217;utilise donc mon root</li>
<li>Authentication method : c&#8217;est ici que l&#8217;on peut choisir d&#8217;interfacer Filez avec CAS</li>
<li>User profile source : je n&#8217;ai pas de LDAP j&#8217;utilise donc une base de donnée</li>
<li>Use the same configuration as Filez : même base et même méthode d&#8217;identification pour la base des utilisateurs que pour la base spécifique a filez</li>
<li>Table where username are stored (required), Database column name containing the username (required), Database column name containing the user,  password (required), Algorithm used to hash the password : à mettre en raccord avec la table des utilisateurs créé en pré-requis</li>
</ul>
<h2>Utilisation</h2>
<p><span style="color: #000000;">On se loggue : <a href="http://voidandany.free.fr/wp-content/uploads/2012-01-11_145953.png"><img class="aligncenter size-medium wp-image-4471" title="2012-01-11_145953" src="http://voidandany.free.fr/wp-content/uploads/2012-01-11_145953-292x300.png" alt="" width="292" height="300" /></a></span></p>
<p>On peut alors voir ses précédents upload et les modifier :</p>
<p><a href="http://voidandany.free.fr/wp-content/uploads/2012-01-11_145854.png"><img class="aligncenter size-medium wp-image-4477" title="2012-01-11_145854" src="http://voidandany.free.fr/wp-content/uploads/2012-01-11_145854-300x248.png" alt="" width="300" height="248" /></a>Et envoyer un autre fichier :</p>
<p><a href="http://voidandany.free.fr/wp-content/uploads/2012-01-11_145934.png"><img class="aligncenter size-medium wp-image-4478" title="2012-01-11_145934" src="http://voidandany.free.fr/wp-content/uploads/2012-01-11_145934-300x145.png" alt="" width="300" height="145" /></a></p>
<p>Lors de l&#8217;envoi on précise le fichier, la durée de disponibilité du fichier, un commentaire et éventuellement un mot de passe</p>
<p>Lorsque l&#8217;on accède à l&#8217;URL du fichier, on revoit tous les détails du fichier et le téléchargement commence :</p>
<p><a href="http://voidandany.free.fr/wp-content/uploads/2012-01-11_150024.png"><img class="aligncenter size-medium wp-image-4479" title="2012-01-11_150024" src="http://voidandany.free.fr/wp-content/uploads/2012-01-11_150024-300x196.png" alt="" width="300" height="196" /></a></p>
<h2>Conclusion</h2>
<p>J&#8217;aime beaucoup Filez, l&#8217;interface est clair, la plupart des fonctionnalités que j&#8217;attend sont présentes.</p>
<p>MAIS</p>
<ul>
<li>la création des utilisateurs doit être faite à la main</li>
<li>les fichiers ne sont pas récupérables depuis le filesystem</li>
<li>24Mo pour un dépôt de fichier !!</li>
</ul>
<p>&nbsp;</p>
<p><span style="text-decoration: underline;"><em><strong>Sources : </strong></em></span></p>
<ul>
<li><a title="Ubuntu 10.04: Installation de FileZ 2.0.2" href="http://pegasus45.free.fr/index.php?title=Ubuntu_10.04:_Installation_de_FileZ_2.0.2">Ubuntu 10.04: Installation de FileZ 2.0.2</a></li>
<li><a rel="bookmark" href="http://blog.admin-linux.org/logiciels-libres/applications-libres-dupload-de-fichiers-volumineux">Applications libres d’upload de fichiers volumineux</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://voidandany.free.fr/index.php/installation-dun-depot-de-fichier-filez-configuration-sur-nginx/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>RSSLounge : Se passer de Google Reader &#8211; Configuration avec NGINX</title>
		<link>http://voidandany.free.fr/index.php/rsslounge-se-passer-de-google-reader-configuration-avec-nginx/</link>
		<comments>http://voidandany.free.fr/index.php/rsslounge-se-passer-de-google-reader-configuration-avec-nginx/#comments</comments>
		<pubDate>Wed, 11 Jan 2012 14:54:11 +0000</pubDate>
		<dc:creator>voidAndAny</dc:creator>
				<category><![CDATA[site web]]></category>
		<category><![CDATA[rss]]></category>

		<guid isPermaLink="false">http://voidandany.free.fr/?p=4456</guid>
		<description><![CDATA[Dans la liste des services web que je voulais tester en vue d&#8217;autohéberger un maximum mes données se trouvait un agrégateur de flux RSS web. 2 scripts coexistent pour remplir ce rôle, Tiny Tiny RSS et Rsslounge J&#8217;ai choisi de tester ce &#8230; <a href="http://voidandany.free.fr/index.php/rsslounge-se-passer-de-google-reader-configuration-avec-nginx/">Continuer la lecture <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Dans la liste des services web que je voulais tester en vue d&#8217;autohéberger un maximum mes données se trouvait un agrégateur de flux RSS web.</p>
<p>2 scripts coexistent pour remplir ce rôle, <a href="http://www.google.fr/url?sa=t&amp;rct=j&amp;q=tinytinyrss&amp;source=web&amp;cd=1&amp;ved=0CCgQFjAA&amp;url=http%3A%2F%2Ftt-rss.org%2F&amp;ei=f5cNT43vGtG7hAfbzPm0BA&amp;usg=AFQjCNElsb-IUp8kNcRtVGpaBo6nyQsRlw">Tiny Tiny RSS</a> et <a href="http://rsslounge.aditu.de/">Rsslounge</a></p>
<p>J&#8217;ai choisi de tester ce dernier car il semblerait qu&#8217;il soit <a href="http://www.generation-linux.fr/index.php?post/2011/07/02/rssLounge%2C-un-excellent-gestionnaire-de-flux-RSS-!">plus léger, véloce</a> (mais ce n&#8217;est pas suffisant, cf. Conclusion)</p>
<h2>Installation</h2>
<ul>
<li>
<p>On télécharge le script sur le <a href="http://rsslounge.aditu.de/">site de rsslounge</a> (<a href="http://rsslounge.googlecode.com/files/rsslounge-1.7.zip">lien direct vers la 1.7</a>)</p>
</li>
<li>
<p>On dézippe l&#8217;archive dans l&#8217;arborescence de votre site</p>
</li>
<li>
<p>On change les droits des répertoires et fichiers pour qu&#8217;il appartiennent à l&#8217;utilisateur exécutant le serveur web (www-data probablement)</p>
</li>
<li>
<p>On configure le serveur web.</p>
</li>
</ul>
<p>Pour les autres services web que je test je ne décris jamais cette dernière étape car elle dépend de votre serveur Web et des choix faits (virtual host, sous-domaine, etc), mais je vais faire une exception ici car j&#8217;ai pas mal cherché avant de réussir a faire fonctionner rsslounge.</p>
<p>Je l&#8217;ai installé avec le serveur web <a title="Installer un serveur web (nginx) sur le Seagate Dockstar" href="http://voidandany.free.fr/index.php/installer-un-serveur-web-nginx-sur-le-seagate-dockstar/">NGINX</a>, en plaçant RSSLounge dans un sous-répertoire de mon arborescence principal et sans déclarer de sous-domaine.</p>
<p>Soit mon site domaine.fr pour lequel la racine est localisé dans /var/www/domaine.fr, RSSLounge est quand à lui installé dans /var/www/domaine.fr/rsslounge et sera donc accédé via l&#8217;URL www.domaine.fr/rsslounge, voici ma configuration NGINX</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">server {
        listen       80;
        server_name  www.domaine.fr;
        root         /var/www/domaine.fr;
&nbsp;
        index           index.php;
&nbsp;
	rewrite ^/rsslounge/favicon.ico$ /rsslounge/public/favicon.ico;
	rewrite ^/rsslounge/plugins/([^/]+)/(.*)$ /rsslounge/plugins/$1/public/$2;
	rewrite ^/rsslounge/favicons/(.*)$ /rsslounge/data/favicons/$1;
	rewrite ^/rsslounge/thumbnails/(.*)$ /rsslounge/data/thumbnails/$1;
	rewrite ^/rsslounge/javascript/(.*)$ /rsslounge/public/javascript/$1;
	rewrite ^/rsslounge/stylesheets/(.*)$ /rsslounge/public/stylesheets/$1;
	location /rsslounge {
		access_log      /var/log/nginx/rsslounge.access.log;
		location ~ \.php$ {
			include         /etc/nginx/fastcgi_params;
			fastcgi_param   SCRIPT_FILENAME  $document_root$fastcgi_script_name;
			fastcgi_pass    127.0.0.1:9000;
			fastcgi_param QUERY_STRING mod_rewrite=1&amp;$query_string; 
			fastcgi_index index.php;
		}
		if (!-e $request_filename) {
			rewrite ^.*$ /rsslounge/index.php last;
		}
	}
}</pre></div></div>

<p>J&#8217;ai pas mal cherché pour réussir à mettre les bonne règles de réécritures, en effet les <a href="http://code.google.com/p/rsslounge/wiki/Installation_and_FAQ">règles décrites sur la FAQ</a> décrivent une installation de RSS à la racine du serveur web et je ne suis pas du tout un expert en réécriture d&#8217;URL</p>
<p>&nbsp;</p>
<h2>Configuration</h2>
<p>On va ensuite sur l&#8217;URL de RSSLounge et on répond aux questions</p>
<p><a href="http://voidandany.free.fr/wp-content/uploads/2012-01-11_152656.png"><img class="aligncenter size-full wp-image-4461" title="2012-01-11_152656" src="http://voidandany.free.fr/wp-content/uploads/2012-01-11_152656.png" alt="" width="446" height="700" /></a>Si vous spécifiez une base de données spécifique a rsslounge il faudra penser à la créer auparavant :</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;">mysql <span style="color: #66cc66;">-</span>u root <span style="color: #66cc66;">-</span>p
<span style="color: #993333; font-weight: bold;">CREATE</span> <span style="color: #993333; font-weight: bold;">DATABASE</span> rsslounge ;</pre></div></div>

<p lang="sql">&nbsp;</p>
<p><a href="http://voidandany.free.fr/wp-content/uploads/2012-01-11_152708.png"><img class="aligncenter size-medium wp-image-4462" title="2012-01-11_152708" src="http://voidandany.free.fr/wp-content/uploads/2012-01-11_152708-300x111.png" alt="" width="300" height="111" /></a></p>
<h2>Utilisation</h2>
<p>On peut ensuite se connecter :</p>
<p><a href="http://voidandany.free.fr/wp-content/uploads/2012-01-11_150407.png"><img class="aligncenter size-medium wp-image-4457" title="2012-01-11_150407" src="http://voidandany.free.fr/wp-content/uploads/2012-01-11_150407-300x182.png" alt="" width="300" height="182" /></a>Et commencer à ajouter des flux,  ou importer ceux de google reader</p>
<p>Pour cela on exporte la liste de ses flux dans Google reader en cliquant sur l&#8217;engrenage en haut à droite et choisissant &laquo;&nbsp;Paramètre de Google Reader&nbsp;&raquo;<a href="http://voidandany.free.fr/wp-content/uploads/2012-01-11_153943.png"><img class="aligncenter size-full wp-image-4464" title="2012-01-11_153943" src="http://voidandany.free.fr/wp-content/uploads/2012-01-11_153943.png" alt="" width="282" height="196" /></a></p>
<p>&nbsp;</p>
<p>Puis on clique sur le lien &laquo;&nbsp;Télécharge&nbsp;&raquo; de la ligne &laquo;&nbsp;Vos abonnements&nbsp;&raquo; de l&#8217;onglet &laquo;&nbsp;Importer/exporter&nbsp;&raquo; :</p>
<p><a href="http://voidandany.free.fr/wp-content/uploads/2012-01-11_1540072.png"><img class="aligncenter size-medium wp-image-4467" title="2012-01-11_154007" src="http://voidandany.free.fr/wp-content/uploads/2012-01-11_1540072-297x300.png" alt="" width="297" height="300" /></a></p>
<p>Cela sauvegarde la liste de vos abonnements sous la forme d&#8217;un fichier XML</p>
<p>Puis sous RSSLounge on clique sur les engrenages, on sélectionne &laquo;&nbsp;OPML Import&nbsp;&raquo; et on ouvre le fichier XML précédemment sauvegardé :</p>
<p><a href="http://voidandany.free.fr/wp-content/uploads/2012-01-11_150451.png"><img class="aligncenter size-full wp-image-4458" title="2012-01-11_150451" src="http://voidandany.free.fr/wp-content/uploads/2012-01-11_150451.png" alt="" width="186" height="276" /></a></p>
<p>RSSLounge commence alors l&#8217;import et la mise à jour des flux (cela prend un certain temps).</p>
<p>In fine on peut lire ses news&#8230;.</p>
<p><a href="http://voidandany.free.fr/wp-content/uploads/2012-01-11_150915.png"><img class="aligncenter size-full wp-image-4459" title="2012-01-11_150915" src="http://voidandany.free.fr/wp-content/uploads/2012-01-11_150915.png" alt="" width="600" height="334" /></a></p>
<p>&nbsp;</p>
<h3>Conclusion</h3>
<p>RSSLounge change un peu de Google Reader, mais est globalement agréable à utiliser, <a href="http://code.google.com/p/rsslounge/wiki/Shortcuts">les raccourcis</a> sont pratiques, l&#8217;interface est claire et il rempli correctement son boulot</p>
<p>MAIS</p>
<p>sur un Dockstar ce n&#8217;est tout simplement pas possible, ça rame à mort, dommage&#8230;.</p>
<p>&nbsp;</p>
<p><strong><span style="text-decoration: underline;"><em>Sources : </em></span></strong></p>
<ul>
<li><a href="http://sebsauvage.net/rhaa/index.php?2011/09/30/12/59/26-adieu-googlereader-bonjour-rss-lounge">Adieu GoogleReader, bonjour RSS Lounge</a></li>
<li><a title="rssLounge, un excellent gestionnaire de flux RSS !" href="http://www.generation-linux.fr/index.php?post/2011/07/02/rssLounge%2C-un-excellent-gestionnaire-de-flux-RSS-%21">rssLounge, un excellent gestionnaire de flux RSS !</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://voidandany.free.fr/index.php/rsslounge-se-passer-de-google-reader-configuration-avec-nginx/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mon éditeur de texte &#171;&#160;parfait&#160;&#187; : jEdit</title>
		<link>http://voidandany.free.fr/index.php/mon-editeur-de-texte-parfait-jedit/</link>
		<comments>http://voidandany.free.fr/index.php/mon-editeur-de-texte-parfait-jedit/#comments</comments>
		<pubDate>Fri, 06 Jan 2012 14:37:25 +0000</pubDate>
		<dc:creator>voidAndAny</dc:creator>
				<category><![CDATA[software]]></category>
		<category><![CDATA[edit]]></category>

		<guid isPermaLink="false">http://voidandany.free.fr/?p=2518</guid>
		<description><![CDATA[Pour un fois voici un article à la fois pour Windows et pour Linux et pour cause le logiciel que je présente est multi-plateforme puisqu&#8217;en Java. Je m&#8217;attarderais ici essentiellement a son installation et configuration sous Windows (une fois n&#8217;est &#8230; <a href="http://voidandany.free.fr/index.php/mon-editeur-de-texte-parfait-jedit/">Continuer la lecture <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Pour un fois voici un article à la fois pour Windows et pour Linux et pour cause le logiciel que je présente est multi-plateforme puisqu&#8217;en Java.</p>
<p>Je m&#8217;attarderais ici essentiellement a son installation et configuration sous Windows (une fois n&#8217;est pas coutume) puisque pour l&#8217;instant je n&#8217;en ai pas trouvé l&#8217;utilité sous Linux</p>
<p>Sous Windows l&#8217;éditeur texte par défaut est le Notepad autant dire le strict minimum or si on développe un temps soit peu ou si on veut éditer des fichiers volumineux,ou si on édite des fichiers provenant de différents OS (Windows / Linux, les fameux caractères de fin de lignes), le Notepad Windows ne convient pas du tout.</p>
<p>Après en avoir essayé de nombreux (notepad++, pspad, ultraEdit, etc), mon choix s&#8217;est porté sur jEdit, essentiellement pour sa gestion des expressions régulière qui est pour moi la plus complète (sous Windows et aux derniers tests effectués datant de plus de 3 ans).</p>
<p>Le site du logiciel :  <a href="http://www.jedit.org/index.php">http://www.jedit.org</a></p>
<h2>Installation</h2>
<p>L&#8217;installation sous Windows est assez classique (on clique, on clique), hormis les les configuration suivantes :</p>
<p><a href="http://voidandany.free.fr/wp-content/uploads/2012-01-06_110018.png"><img class="aligncenter size-full wp-image-4430" title="2012-01-06_110018" src="http://voidandany.free.fr/wp-content/uploads/2012-01-06_110018.png" alt="" width="503" height="392" /></a>Je n&#8217;installe pas la documentation de l&#8217;API, n&#8217;ayant pas pour l&#8217;instant franchi le pas du développement de macros ou de plugins pour jEdit.</p>
<p><a href="http://voidandany.free.fr/wp-content/uploads/2012-01-06_110030.png"><img class="aligncenter size-full wp-image-4431" title="2012-01-06_110030" src="http://voidandany.free.fr/wp-content/uploads/2012-01-06_110030.png" alt="" width="503" height="392" /></a>Aucun raccourcis et je ne démarre pas le serveur jEdit (voir à quoi cela sert <a href="http://community.jedit.org/?q=node/view/3059">ici</a>) au démarrage de Windows, ce dernier est déjà suffisamment long à démarrer</p>
<p>On peut lancer jEdit, voici ce a quoi il ressemble avant toute configuration :</p>
<p><a href="http://voidandany.free.fr/wp-content/uploads/2012-01-06_1101261.png"><img class="aligncenter size-full wp-image-4429" title="2012-01-06_110126" src="http://voidandany.free.fr/wp-content/uploads/2012-01-06_1101261.png" alt="" width="600" height="462" /></a></p>
<h2>Traduction</h2>
<p>Par défaut jEdit n&#8217;est pas en Français et il n&#8217;existe pas de traduction officiel, mais <a href="http://jojaba.free.fr/?/Traductions-diverses/Traduction-jEdit2">une officieuse</a> qui n&#8217;est pas à jour (Traduction 4.3.1 alors qu&#8217;on est en version 4.4.2) mais cela fonctionne tout de même très bien.</p>
<p>Pour ma part je n&#8217;utilise que la traduction de l&#8217;interface (pas des macros / docs)</p>
<p>On télécharge le <a href="http://jojaba-code.googlecode.com/files/jedit_gui-LatestVersion-QuickNotepad-for-jedit-4.3.1-FR.zip">fichier zip contenant les properties</a> et on le décompresse dans C:\Program Files\jEdit\properties et on peut re-démarrer jEduit</p>
<h2>Configuration</h2>
<p>En première configuration je décoche l&#8217;affichage de l&#8217;astuce du jour&#8230;</p>
<p>Puis on va dans &laquo;&nbsp;Utilitaire&nbsp;&raquo; &gt; &laquo;&nbsp;Options générales&#8230;&nbsp;&raquo;</p>
<p><a href="http://voidandany.free.fr/wp-content/uploads/2012-01-06_115810.png"><img class="aligncenter size-full wp-image-4433" title="2012-01-06_115810" src="http://voidandany.free.fr/wp-content/uploads/2012-01-06_115810.png" alt="" width="600" height="216" /></a>Voici les configurations que j&#8217;effectue systématiquement :</p>
<p>jEdit &gt; Générales</p>
<ul>
<li>Décocher &nbsp;&raquo;Rétablir au démarrage les fichiers précédemment ouverts&nbsp;&raquo;</li>
</ul>
<p>jEdit &gt; Apparences</p>
<ul>
<li>Décocher &laquo;&nbsp;Afficher les astuces au démarrage&nbsp;&raquo;</li>
</ul>
<p>jEdit &gt; Encodage</p>
<ul>
<li>Sélectionner les encodages avec lesquels vous travaillez (je laisse juste UTF8 et UTF8Y) pour éviter ce genre de liste à rallonge lors d&#8217;un changement d&#8217;encodage : </li>
</ul>
<p><a href="http://voidandany.free.fr/wp-content/uploads/2012-01-06_140118.png"><img class="aligncenter size-medium wp-image-4436" title="2012-01-06_140118" src="http://voidandany.free.fr/wp-content/uploads/2012-01-06_140118-300x228.png" alt="" width="300" height="228" /></a></p>
<ul>
<li>Sur cette même page il est possible de choisir l&#8217;encodage par défaut</li>
</ul>
<p>jEdit &gt; Marge</p>
<ul>
<li>Côcher &laquo;&nbsp;Numérotation des lignes&nbsp;&raquo; </li>
</ul>
<p>jEdit &gt; Serveurs Proxies</p>
<ul>
<li>Si vous êtes en entreprise, il y a de forte chance qu&#8217;il y ait un proxy il convient donc de l&#8217;activer et de l paramétrer ici.</li>
</ul>
<p>jEdit &gt; Gestionnaire de plugin</p>
<ul>
<li>Cliquer sur &laquo;&nbsp;Mettre à jour la liste des miroirs&nbsp;&raquo;</li>
<li>Sélectionner un miroir Français (free par exemple)</li>
</ul>
<p>jEdit &gt; Enregistrement &amp; Sauvegarde</p>
<ul>
<li>Mettre 5 dans la zone Nombre maximum de sauvegarde</li>
<li>Mettre un dossier de sauvegarde (évite de polluer ses dossiers avec des fichiers ~)</li>
</ul>
<p>Voila pour mes configurations de bases mais jEdit est ultra-paramétrable beaucoup d&#8217;autres configuration sont possible (je n&#8217;ai jamais pris le temps de m&#8217;y pencher sérieusement)</p>
<h2>Installation de plugins</h2>
<p>Une des forces de jEdit, l&#8217;installation de plugins, ajoutant des fonctionnalités ou modifiant son comportement, en voici quelques uns que j&#8217;utilise.</p>
<p>L&#8217;installation se fait en allant dans &laquo;&nbsp;Plugins&nbsp;&raquo; &gt; &laquo;&nbsp;Gestionnaire de plugins&#8230;&nbsp;&raquo; puis dans l&#8217;onglet &laquo;&nbsp;Installation&nbsp;&raquo; il suffit de cocher la case face au(x) plugin(s) voulu(s) et de cliquer sur &laquo;&nbsp;Installer&nbsp;&raquo;</p>
<h3>Ajout d&#8217;onglets : BufferTabs</h3>
<p>Par défaut la sélection des différents fichiers ouverts (tampons dans le jargon jEdit) se fait via une liste déroulante, le plugin BufferTabs ajoute des onglets.</p>
<p>Après l&#8217;installation il suffit d&#8217;activer le plugin en allant dans &laquo;&nbsp;Plugins&nbsp;&raquo; et en cliquant sur &laquo;&nbsp;BufferTabs&nbsp;&raquo;</p>
<p>On configure ensuite le plugin en allant dans &laquo;&nbsp;Plugins&nbsp;&raquo; &gt; &laquo;&nbsp;Option des plugins&nbsp;&raquo; et sélectionnant &laquo;&nbsp;BufferTabs&nbsp;&raquo;</p>
<ul>
<li>Cocher &laquo;&nbsp;Enable Buffertabs by default&nbsp;&raquo;</li>
<li>Sélectionner &laquo;&nbsp;Top&nbsp;&raquo; pour &laquo;&nbsp;location of BufferTabs&nbsp;&raquo;</li>
</ul>
<p>La liste déroulant faisant doublon avec les onglets on la désactive :</p>
<ul>
<li>Menu &laquo;&nbsp;Affichage&nbsp;&raquo; dé-selectionner &laquo;&nbsp;afficher le sélecteur de tampons&nbsp;&raquo;</li>
</ul>
<p><a href="http://voidandany.free.fr/wp-content/uploads/2012-01-06_135223.png"><img class="aligncenter size-full wp-image-4435" title="2012-01-06_135223" src="http://voidandany.free.fr/wp-content/uploads/2012-01-06_135223.png" alt="" width="584" height="445" /></a></p>
<p>&nbsp;</p>
<h3>Travailler avec des fichiers XML</h3>
<p>Le plugin XML (installe 4-5 plugins par dépendance) permet de travailler aisément avec des fichiers XML, ne serait ce que le reformatage :</p>
<p>Avant :</p>
<p><a href="http://voidandany.free.fr/wp-content/uploads/2012-01-06_143645.png"><img class="aligncenter size-medium wp-image-4437" title="2012-01-06_143645" src="http://voidandany.free.fr/wp-content/uploads/2012-01-06_143645-300x259.png" alt="" width="300" height="259" /></a></p>
<p>Après :</p>
<p><a href="http://voidandany.free.fr/wp-content/uploads/2012-01-06_143733.png"><img class="aligncenter size-medium wp-image-4438" title="2012-01-06_143733" src="http://voidandany.free.fr/wp-content/uploads/2012-01-06_143733-300x291.png" alt="" width="300" height="291" /></a>Visualisation de la structure du document dans le Sidekick (plugin dépendant) :</p>
<h3><a href="http://voidandany.free.fr/wp-content/uploads/2012-01-06_145220.png"><img class="aligncenter size-full wp-image-4439" title="2012-01-06_145220" src="http://voidandany.free.fr/wp-content/uploads/2012-01-06_145220.png" alt="" width="192" height="294" /></a>Programmation PHP : PhpParser</h3>
<p>Comme son nom l&#8217;indique permet de faciliter le travail avec les fichiers php</p>
<h3>Gestion des fichiers en projet : ProjectViewer</h3>
<h3><a href="http://voidandany.free.fr/wp-content/uploads/2012-01-06_145707.png"><img class="aligncenter size-full wp-image-4440" title="2012-01-06_145707" src="http://voidandany.free.fr/wp-content/uploads/2012-01-06_145707.png" alt="" width="332" height="232" /></a>Travail sur les fichiers textes : TextTool</h3>
<p>Permet notamment de trier un fichier, supprimer les doublons, etc</p>
<h3>Voir les caractères spéciaux : Whitespace</h3>
<p><a href="http://voidandany.free.fr/wp-content/uploads/2012-01-06_151342.png"><img class="aligncenter size-full wp-image-4441" title="2012-01-06_151342" src="http://voidandany.free.fr/wp-content/uploads/2012-01-06_151342.png" alt="" width="198" height="111" /></a></p>
<h3></h3>
<h3>Edition de fichier distant via FTP ou SFTP : FTP</h3>
<p>FTP c&#8217;est le nom du plugin, une fois installé le plus simple pour l&#8217;utiliser et d&#8217;ancrer l&#8217;explorateur de fichier, pour cela dans &laquo;&nbsp;Utilitaires&nbsp;&raquo; &gt; &laquo;&nbsp;Option Générales&#8230;&nbsp;&raquo; dérouler &laquo;&nbsp;jEdit&nbsp;&raquo; &gt; &laquo;&nbsp;Ancrage&nbsp;&raquo; et sélectionner l&#8217;ancrage voulu (left / right &#8230;) pour le panneau &laquo;&nbsp;Explorateur&nbsp;&raquo;</p>
<p>Dans le panneau &laquo;&nbsp;Explorateur&nbsp;&raquo;, cliquer sur &laquo;&nbsp;Plugins&nbsp;&raquo; &gt; &laquo;&nbsp;FTP&nbsp;&raquo; et choisir &laquo;&nbsp;Connect to FTP Server&nbsp;&raquo; pour une connexion FTP classique et &nbsp;&raquo;Connect to Secure FTP Server&nbsp;&raquo; pour une connexion SFTP (ou SSH), remplir les données de connexion.</p>
<p>Le panneau de l&#8217;explorateur liste alors les fichiers distants :</p>
<p><a rel="attachment wp-att-4638" href="http://voidandany.free.fr/index.php/mon-editeur-de-texte-parfait-jedit/2012-01-26_142234/"><img class="aligncenter size-medium wp-image-4638" title="2012-01-26_142234" src="http://voidandany.free.fr/wp-content/uploads/2012-01-26_142234-300x282.png" alt="" width="300" height="282" /></a></p>
<p>En cas de connexion via SSH, il n&#8217;est pas nécessaire de renseigner de clé privé&#8230;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>Voila pour le principal, jEdit est ultra-puissant mais il faut y passer un peu de temps pour le paramétrer à son gout.</p>
<p>Pour plus de détails (en anglais) voir <a href="http://taat.pl/en/jedit/">cet article</a></p>
<p>&nbsp;</p>
<p><span style="text-decoration: underline;"><em><strong>PS :</strong></em></span></p>
<p>je disais en début d&#8217;article que jEdit était le seul éditeur texte gérant correctement les expressions régulières, voici un exemple, l&#8217;utilisation des références arrières.</p>
<p>Soit les dates suivantes :</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">20011015
20010812
20011205
20010622
20010504
20010318
20010616
20010101</pre></div></div>

<p>Que l&#8217;on veut transformer ainsi :</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">15/10/2001
12/08/2001
05/12/2001
22/06/2001
04/05/2001
18/03/2001
16/06/2001
01/01/2001</pre></div></div>

<p>On utilise l&#8217;expression régulière suivantes (pas optimisé, c&#8217;est juste un exemple) :</p>
<p>Rechercher : ([0-9]{4})([0-9]{2})([0-9]{2})</p>
<p>Remplacer : $3/$2/$1</p>
<p>Et voila&#8230;</p>
<p>Notepad++ ne le permet pas.</p>
]]></content:encoded>
			<wfw:commentRss>http://voidandany.free.fr/index.php/mon-editeur-de-texte-parfait-jedit/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Faire apparaître les icônes du menu système d’Ubuntu (Gnome 2.x)</title>
		<link>http://voidandany.free.fr/index.php/faire-apparaitre-les-icones-du-menu-systeme-d%e2%80%99ubuntu-gnome-2-x/</link>
		<comments>http://voidandany.free.fr/index.php/faire-apparaitre-les-icones-du-menu-systeme-d%e2%80%99ubuntu-gnome-2-x/#comments</comments>
		<pubDate>Fri, 06 Jan 2012 09:54:10 +0000</pubDate>
		<dc:creator>voidAndAny</dc:creator>
				<category><![CDATA[software]]></category>
		<category><![CDATA[desktop]]></category>
		<category><![CDATA[gnome]]></category>

		<guid isPermaLink="false">http://voidandany.free.fr/?p=2888</guid>
		<description><![CDATA[A l&#8217;heure des nouvelles interfaces de bureau (Unity, Gnome-shell) cet astuce est sans doute inutile. Mais je n&#8217;utilise pas ces nouvelle interfaces, je suis resté sur Ubuntu 11.04 avec Gnome 2.x et j&#8217;ai ce tips dans mes brouillons d&#8217;article depuis pas mal &#8230; <a href="http://voidandany.free.fr/index.php/faire-apparaitre-les-icones-du-menu-systeme-d%e2%80%99ubuntu-gnome-2-x/">Continuer la lecture <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>A l&#8217;heure des nouvelles interfaces de bureau (Unity, Gnome-shell) cet astuce est sans doute inutile.</p>
<p>Mais je n&#8217;utilise pas ces nouvelle interfaces, je suis resté sur Ubuntu 11.04 avec Gnome 2.x et j&#8217;ai ce tips dans mes brouillons d&#8217;article depuis pas mal de temps. ne voulant pas le perdre je le publie.</p>
<p>Par défaut depuis Gnome 2.3 le menu système n&#8217;a plus d&#8217;icônes :</p>
<p><a href="http://voidandany.free.fr/wp-content/uploads/Sélection_072.png"><img class="aligncenter size-full wp-image-4417" title="Sélection_072" src="http://voidandany.free.fr/wp-content/uploads/Sélection_072.png" alt="" width="197" height="277" /></a></p>
<p>Pour les faire réapparaître, il suffit de lancer la commande :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">gconftool-<span style="color: #000000;">2</span> <span style="color: #660033;">--type</span> Boolean <span style="color: #660033;">--set</span> <span style="color: #000000; font-weight: bold;">/</span>desktop<span style="color: #000000; font-weight: bold;">/</span>gnome<span style="color: #000000; font-weight: bold;">/</span>interface<span style="color: #000000; font-weight: bold;">/</span>menus_have_icons True</pre></div></div>

<p>Et voila le boulot :</p>
<p><a href="http://voidandany.free.fr/wp-content/uploads/Sélection_073.png"><img class="aligncenter size-full wp-image-4416" title="Sélection_073" src="http://voidandany.free.fr/wp-content/uploads/Sélection_073.png" alt="" width="224" height="286" /></a></p>
<p>&nbsp;</p>
<p><span style="text-decoration: underline;"><em><strong>Sources :</strong></em></span></p>
<ul>
<li><a title="Lien permanent vers Faire apparaître les icônes du menu système d’Ubuntu" rel="bookmark" href="http://www.clapico.com/2010/07/05/icones/">Faire apparaître les icônes du menu système d’Ubuntu</a></li>
<li><a title="Permanent Link: How to Enable Icons on the Ubuntu System Menu (Minor Annoyances)" rel="bookmark" href="http://www.howtogeek.com/howto/21149/how-to-enable-icons-on-the-ubuntu-system-menu-minor-annoyances/">How to Enable Icons on the Ubuntu System Menu (Minor Annoyances)</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://voidandany.free.fr/index.php/faire-apparaitre-les-icones-du-menu-systeme-d%e2%80%99ubuntu-gnome-2-x/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Générer des flux RSS complets à partir des flux tronqués (service auto-hébergé)</title>
		<link>http://voidandany.free.fr/index.php/generer-des-flux-rss-complets-a-partir-des-flux-tronques-service-auto-heberge/</link>
		<comments>http://voidandany.free.fr/index.php/generer-des-flux-rss-complets-a-partir-des-flux-tronques-service-auto-heberge/#comments</comments>
		<pubDate>Thu, 05 Jan 2012 14:32:46 +0000</pubDate>
		<dc:creator>voidAndAny</dc:creator>
				<category><![CDATA[Non classé]]></category>
		<category><![CDATA[site web]]></category>
		<category><![CDATA[webapp]]></category>

		<guid isPermaLink="false">http://voidandany.free.fr/?p=4388</guid>
		<description><![CDATA[Pour ma veille je suis 281 flux RSS (après avoir fait du ménage ce matin), or il existe quelques sites qui ne proposent qu&#8217;une version tronquée des articles, par exemple Numérama : &#160; Je comprends leurs motivations mais ça m&#8217;enquiquine (pour être &#8230; <a href="http://voidandany.free.fr/index.php/generer-des-flux-rss-complets-a-partir-des-flux-tronques-service-auto-heberge/">Continuer la lecture <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Pour ma veille je suis 281 flux RSS (après avoir fait du ménage ce matin), or il existe quelques sites qui ne proposent qu&#8217;une <strong>version tronquée des articles</strong>, par exemple Numérama :</p>
<p style="text-align: center;"><a href="http://voidandany.free.fr/wp-content/uploads/2012-01-04_105549.png"><img class="aligncenter" title="2012-01-04_105549" src="http://voidandany.free.fr/wp-content/uploads/2012-01-04_105549.png" alt="" width="508" height="246" /></a></p>
<p>&nbsp;</p>
<p>Je comprends leurs motivations mais ça m&#8217;enquiquine (pour être poli).</p>
<p>Je me suis donc mis en quête d&#8217;un service permettant d&#8217;<strong>avoir le flux complet </strong>à partir d&#8217;un flux tronqué.</p>
<p>J&#8217;ai tout d&#8217;abord trouvé le service <a href="http://fulltextrssfeed.com/">Full Text RSS Feed Builder</a>, le premier test n&#8217;a pas été concluant le jour même mais semble avoir fonctionné les jours suivants (une histoire de cache dans Google Reader ?)</p>
<p>Mais qu&#8217;importe puisqu&#8217;entre temps je me suis souvenu que j&#8217;avais bookmarké un article décrivant un script remplissant le même rôle et pouvant être <strong>auto-hébergé</strong> : <a href="http://blog.tomamplius.net/index.php?post/2010/04/29/fivefilters-%3A-RSS-avec-les-articles-complets">fivefilters : RSS avec les articles complets</a></p>
<p>Le service s&#8217;appelle<strong> <a href="http://fivefilters.org/content-only/">Create Full-Text Feeds</a></strong> de <a href="http://fivefilters.org/content-only/">fivefilters.org</a></p>
<p>Par contre depuis que <a href="http://blog.tomamplius.net/index.php?post/2010/04/29/fivefilters-%3A-RSS-avec-les-articles-complets">Tom@mplius à publié son article</a> (Mai 2010) les conditions de distributions semblent avoir changées, le site <a href="http://fivefilters.org/content-only/">fivefilters.org</a> ne propose plus que son service en ligne gratuit mais limité (3 articles max par flux) et il faut payer (20 €) pour avoir les sources et l’auto-héberger.</p>
<p>En cherchant un peu j&#8217;ai trouvé le site sur lequel les <strong>sources</strong> de l&#8217;ancienne version sont distribués : <a href="http://code.fivefilters.org/p/full-text-rss/">http://code.fivefilters.org/p/full-text-rss/</a></p>
<p>Il s&#8217;agit de la version 2.7 et en payant on a la version 2.9, à vous de voir si <a href="http://fivefilters.org/content-only/changelog.txt">les changements</a> entre ces 2 versions vous sont nécessaires, en ce qui me me concerne la 2.7 me convient.</p>
<p>Pour <strong>l&#8217;installation</strong>, c&#8217;est un peu comme tous les services web :</p>
<ul>
<li><a href="http://code.fivefilters.org/p/full-text-rss/source/download/master/">Téléchargement des sources</a> </li>
<li>Décompression dans un répertoire de votre serveur web</li>
<li>Fixer les droits sur les fichiers pour s&#8217;assurer que c&#8217;est l&#8217;utilisateur faisant  tourner votre serveur web (www-data) qui est propriétaire des fichiers</li>
<li>Paramétrage de votre serveur web pour prendre en compte ce nouveau site</li>
</ul>
<p>Et on peut tester en allant sur l&#8217;URL de votre serveur web :</p>
<p style="text-align: center;"><a href="http://voidandany.free.fr/wp-content/uploads/2012-01-04_110342.png"><img class="aligncenter" title="2012-01-04_110342" src="http://voidandany.free.fr/wp-content/uploads/2012-01-04_110342.png" alt="" width="420" height="329" /></a></p>
<p>Un peu comme service gratuit <a href="http://fivefilters.org/content-only/">fivefilters.org</a> on entre l&#8217;URL du flux compléter et on valide.</p>
<p>Par contre à la différence du service gratuit hébergé, on a accès aux options notamment le nombre d&#8217;article par flux.</p>
<p>Un petit test avec le flux de Numérama, résultat de la page :</p>
<p style="text-align: center;"><a href="http://voidandany.free.fr/wp-content/uploads/2012-01-04_110249.png"><img class="aligncenter size-full wp-image-4398" title="2012-01-04_110249" src="http://voidandany.free.fr/wp-content/uploads/2012-01-04_110249.png" alt="" width="420" height="316" /></a><a href="http://voidandany.free.fr/wp-content/uploads/2012-01-04_135433.png"></a></p>
<p>&nbsp;</p>
<p style="text-align: left;">On copie l&#8217;URL résultante et hop on ajoute le flux dans Google Reader, ça marche parfaitement&#8230;.<a href="http://voidandany.free.fr/wp-content/uploads/2012-01-04_135433.png"><br />
 </a><a href="http://voidandany.free.fr/wp-content/uploads/2012-01-04_110342.png"><br />
 </a><a href="http://voidandany.free.fr/wp-content/uploads/2012-01-04_105549.png"></a><a href="http://voidandany.free.fr/wp-content/uploads/2012-01-04_135433.png"><img class="aligncenter" title="2012-01-04_135433" src="http://voidandany.free.fr/wp-content/uploads/2012-01-04_135433.png" alt="" width="420" height="412" /></a></p>
<p>&nbsp;</p>
<p>J&#8217;ai ensuite effectué quelques configurations supplémentaires.</p>
<p>En premier lieu il faut copier le fichier config.php en custom_config.php et éditer ce dernier.</p>
<p><span style="text-decoration: underline;"><strong>Activation du cache :</strong></span></p>
<p>Cela se fait simplement en positionnant la variable suivante :</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$options</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">caching</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">;</span></pre></div></div>

<p>Il faut ensuite créer le répertoire paramétré dans $options-&gt;cache_dir et 2 sous répertoires rss et rss-with-key en effet les sources 2.7 ne contiennent pas ces répertoires et s&#8217;assurer que ces répertoires appartiennent à l&#8217;utilisateur faisant  tourner votre serveur web (www-data).</p>
<p><span style="text-decoration: underline;"><strong>Protection du service : </strong></span></p>
<p>Le service fonctionne parfaitement mais je veux en protéger l&#8217;accès, en effet je ne souhaite pas que tout le monde puisse l&#8217;utiliser.</p>
<p>Full Text Feed contient un mécanisme de clé permettant de différencier les utilisateur avec clé de ceux sans clé (en terme de fonctionnalité), mais malgré ce qui est indiqué dans <a href="http://help.fivefilters.org/customer/portal/articles/223410-configure">cette page</a>, l&#8217;ajout de la variable $options-&gt;key_required à true n’oblige pas l&#8217;utilisation d&#8217;une clé</p>
<p>J&#8217;ai donc modifié les sources pour le permettre. Dans le fichier makefulltextfeed.php j&#8217;ai ajouté le test  suivant :</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$options</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">key_required</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #000088;">$valid_key</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #990000;">die</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'A valid key is mandatory'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Après le test suivant :</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$valid_key</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_GET</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'key'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_GET</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'hash'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$options</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">api_keys</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#40;</span>int<span style="color: #009900;">&#41;</span><span style="color: #000088;">$_GET</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'key'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$valid_key</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$_GET</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'hash'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">==</span> <span style="color: #990000;">sha1</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$options</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">api_keys</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#40;</span>int<span style="color: #009900;">&#41;</span><span style="color: #000088;">$_GET</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'key'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #000088;">$url</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Dans le fichier custom_config.php on indique ensuite la/les clés valides et l&#8217;option indiquant qu&#8217;une clé est obligatoire :</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$options</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">api_keys</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$options</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">api_keys</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'xxxx'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$options</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">key_required</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://voidandany.free.fr/index.php/generer-des-flux-rss-complets-a-partir-des-flux-tronques-service-auto-heberge/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Partager un lien dans Shaarli directement depuis Google Reader</title>
		<link>http://voidandany.free.fr/index.php/partager-un-lien-dans-shaarli-directement-depuis-google-reader/</link>
		<comments>http://voidandany.free.fr/index.php/partager-un-lien-dans-shaarli-directement-depuis-google-reader/#comments</comments>
		<pubDate>Wed, 16 Nov 2011 17:38:12 +0000</pubDate>
		<dc:creator>voidAndAny</dc:creator>
				<category><![CDATA[Non classé]]></category>
		<category><![CDATA[site web]]></category>
		<category><![CDATA[shaarli]]></category>

		<guid isPermaLink="false">http://voidandany.free.fr/?p=4358</guid>
		<description><![CDATA[Comme indiqué ici j&#8217;utilise le script de sebsauvage Shaarli pour stocker mes bookmarks (et peut être un jour les partager) En attendant d&#8217;installer et d&#8217;utiliser RSSLounge (un jour je vais le tester) j&#8217;utilise Google Reader et je veux pouvoir ajouter &#8230; <a href="http://voidandany.free.fr/index.php/partager-un-lien-dans-shaarli-directement-depuis-google-reader/">Continuer la lecture <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Comme indiqué <a title="Outil de bookmarks en ligne : Shaarli" href="http://voidandany.free.fr/index.php/outil-de-bookmarks-en-ligne-shaarli/">ici</a> j&#8217;utilise le script de <a href="http://sebsauvage.net/">sebsauvage</a> <a href="http://sebsauvage.net/wiki/doku.php?id=php:shaarli">Shaarli</a> pour stocker mes bookmarks (et peut être un jour les partager)</p>
<p>En attendant d&#8217;installer et d&#8217;utiliser <a href="http://rsslounge.aditu.de/">RSSLounge</a> (un jour je vais le tester) j&#8217;utilise Google Reader et je veux pouvoir ajouter un marque-page dans mon Shaarli directement depuis Google Reader.</p>
<p>Et c&#8217;est super simple.</p>
<p>On va dnas les paramètres de Google Reader en cliquant sur le petit engrenage en haut à droite de l&#8217;interface de Google Reader</p>
<p><a href="http://voidandany.free.fr/wp-content/uploads/2011-11-16_175125.png"><img class="aligncenter size-full wp-image-4360" title="2011-11-16_175125" src="http://voidandany.free.fr/wp-content/uploads/2011-11-16_175125.png" alt="" width="239" height="95" /></a></p>
<p>&nbsp;</p>
<p>Ensuite on se place sur l&#8217;onglet &laquo;&nbsp;Envoyer à&nbsp;&raquo;</p>
<p><a href="http://voidandany.free.fr/wp-content/uploads/2011-11-16_163018.png"><img class="aligncenter size-full wp-image-4362" title="2011-11-16_163018" src="http://voidandany.free.fr/wp-content/uploads/2011-11-16_163018.png" alt="" width="610" height="99" /></a></p>
<p>&nbsp;</p>
<p>Puis on clique sur &laquo;&nbsp;créer un lien personnalisé&nbsp;&raquo; (tout en bas)</p>
<p><a href="http://voidandany.free.fr/wp-content/uploads/2011-11-16_163052.png"><img class="aligncenter size-full wp-image-4361" title="2011-11-16_163052" src="http://voidandany.free.fr/wp-content/uploads/2011-11-16_163052.png" alt="" width="516" height="285" /></a></p>
<p>Pour le nom on met ce que l&#8217;on veut et pour l&#8217;URL on met l&#8217;adresse de son Shaarli avec les paramètres title, url et source ainsi (à adapter) :</p>
<p>
<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">http://www.[votre domaine]/shaarli/index.php?post=${url}&amp;title=${title}&amp;source=greader</pre></div></div>

</p>
<p>Et voila on peut revenir à l&#8217;interface de Google Reader et tout en bas des articles dans l&#8217;option &laquo;&nbsp;Envoyer à&nbsp;&raquo;, votre lien Shaarli apparaît :</p>
<p><a href="http://voidandany.free.fr/wp-content/uploads/2011-11-16_183212.png"><img class="aligncenter size-full wp-image-4364" title="2011-11-16_183212" src="http://voidandany.free.fr/wp-content/uploads/2011-11-16_183212.png" alt="" width="609" height="255" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://voidandany.free.fr/index.php/partager-un-lien-dans-shaarli-directement-depuis-google-reader/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Administrer sa base de données MySQL sans phpMyAdmin</title>
		<link>http://voidandany.free.fr/index.php/administrer-sa-base-de-donnees-mysql-sans-phpmyadmin/</link>
		<comments>http://voidandany.free.fr/index.php/administrer-sa-base-de-donnees-mysql-sans-phpmyadmin/#comments</comments>
		<pubDate>Tue, 27 Sep 2011 19:09:43 +0000</pubDate>
		<dc:creator>voidAndAny</dc:creator>
				<category><![CDATA[software]]></category>
		<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://voidandany.free.fr/?p=4247</guid>
		<description><![CDATA[Lorsque l&#8217;on a une base de donnée MySQL et que l&#8217;on veut l&#8217;administrer le plus souvent on installe phpMyAdmin. Or si on ne souhaite administrer cette base qu&#8217;en local (ou via le LAN) je trouve qu&#8217;installer une application web n&#8217;est &#8230; <a href="http://voidandany.free.fr/index.php/administrer-sa-base-de-donnees-mysql-sans-phpmyadmin/">Continuer la lecture <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Lorsque l&#8217;on a une base de donnée MySQL et que l&#8217;on veut l&#8217;administrer le plus souvent on installe <a href="http://www.phpmyadmin.net/">phpMyAdmin</a>. Or si on ne souhaite administrer cette base qu&#8217;en local (ou via le LAN) je trouve qu&#8217;installer une application web n&#8217;est pas forcément adapté et j&#8217;ai clairement une préférence pour l&#8217;installation d&#8217;un client dit &laquo;&nbsp;lourd&nbsp;&raquo;</p>
<p>C&#8217;est pour cela que j&#8217;installe MySQL Query Browser :</p>
<p><a href="http://voidandany.free.fr/wp-content/uploads/MySQL-Query-Browser-yoann@192.168.1.1113306_039.resized.png"><img class="aligncenter size-full wp-image-4344" title="MySQL Query Browser - yoann@192.168.1.111:3306_039.resized" src="http://voidandany.free.fr/wp-content/uploads/MySQL-Query-Browser-yoann@192.168.1.1113306_039.resized.png" alt="" width="640" height="420" /></a></p>
<p>Cet outil est fourni par l&#8217;éditeur MySQL lui même.</p>
<p>&nbsp;</p>
<p>Pour l&#8217;installation sur le PC client (desktop) :</p>

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

<p>Et sur le serveur il faut faire quelques paramétrages pour autoriser MySQL Query Browser à se connecter.</p>
<p>Éditer votre fichier my.cnf :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">vim</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>mysql<span style="color: #000000; font-weight: bold;">/</span>my.cnf</pre></div></div>

<p>Et commenter la ligne bind-address :</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># Instead of skip-networking the default is now to listen only on
 # localhost which is more compatible and is not less secure.
 #bind-address           = 127.0.0.1
 </pre></div></div>

<p>Il faut ensuite donner les droits à votre utilisateur distant à se connecter, ouvrir une invite de commande mysql :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">mysql <span style="color: #660033;">-u</span> root <span style="color: #660033;">-p</span>
 Enter password: <span style="color: #7a0874; font-weight: bold;">&#91;</span>votre mot de passe root<span style="color: #7a0874; font-weight: bold;">&#93;</span></pre></div></div>

<p>Et lancer les commandes SQL suivante :</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">mysql&gt; grant all privileges on *.* to [utilisateur souhaité]@[adresse IP de votre machine distante] identified by &quot;[mot de passe souhaité]&quot;;
 Query OK, 0 rows affected (0.00 sec)
&nbsp;
mysql&gt; flush privileges;
 Query OK, 0 rows affected (0.00 sec)
&nbsp;
mysql&gt; quit
 Bye</pre></div></div>

<p>Sur le client il ne vous reste plus qu&#8217;a vous connecter à MySQL Query Browser avec l&#8217;utilisateur et le mot de passe que vous venez de définir :</p>
<p><a href="http://voidandany.free.fr/wp-content/uploads/MySQL-Query-Browser_038.png"><img class="aligncenter size-full wp-image-4343" title="MySQL Query Browser_038" src="http://voidandany.free.fr/wp-content/uploads/MySQL-Query-Browser_038.png" alt="" width="432" height="396" /></a></p>
<p><span style="text-decoration: underline;"><em><strong>Rque :</strong></em></span> Pour des taches plus administratives, dans la même série il existe MySQL Administrator :</p>
<p><a href="http://voidandany.free.fr/wp-content/uploads/MySQL-Administrator-yoann@192.168.1.1113306_040.resized.png"><img class="aligncenter size-full wp-image-4342" title="MySQL Administrator yoann@192.168.1.111:3306_040.resized" src="http://voidandany.free.fr/wp-content/uploads/MySQL-Administrator-yoann@192.168.1.1113306_040.resized.png" alt="" width="640" height="475" /></a></p>
<p>Qui s&#8217;installe avec :</p>

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

<p><span style="text-decoration: underline;"><em><strong>Rque 2</strong></em></span> : il semblerait que ces 2 outils aient fusionnée dans un bundle <a href="http://dev.mysql.com/downloads/workbench/5.2.html">MySQL Workbench (GUI Tool)</a> mais le paquet n&#8217;est pas encore dans les dépôts</p>
]]></content:encoded>
			<wfw:commentRss>http://voidandany.free.fr/index.php/administrer-sa-base-de-donnees-mysql-sans-phpmyadmin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Script de mise à jour de Shaarli</title>
		<link>http://voidandany.free.fr/index.php/script-de-mise-a-jour-de-shaarli/</link>
		<comments>http://voidandany.free.fr/index.php/script-de-mise-a-jour-de-shaarli/#comments</comments>
		<pubDate>Mon, 26 Sep 2011 19:50:58 +0000</pubDate>
		<dc:creator>voidAndAny</dc:creator>
				<category><![CDATA[software]]></category>
		<category><![CDATA[dockstar]]></category>
		<category><![CDATA[shaarli]]></category>
		<category><![CDATA[webapp]]></category>

		<guid isPermaLink="false">http://voidandany.free.fr/?p=4337</guid>
		<description><![CDATA[Dans mon dernier article je présentais Shaarli développé par Sebsauvage, ce dernier en plus d&#8217;avoir fait un formidable travail, le met à jour très très régulièrement et la liste des améliorations à venir est encore bien fournie. Bref bien que &#8230; <a href="http://voidandany.free.fr/index.php/script-de-mise-a-jour-de-shaarli/">Continuer la lecture <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Dans <a title="Outil de bookmarks en ligne : Shaarli" href="http://voidandany.free.fr/index.php/outil-de-bookmarks-en-ligne-shaarli/">mon dernier article</a> je présentais <a href="http://sebsauvage.net/wiki/doku.php?id=php:shaarli">Shaarli</a> développé par Sebsauvage, ce dernier en plus d&#8217;avoir fait un formidable travail, <a href="http://sebsauvage.net/wiki/doku.php?id=php:shaarli#history">le met à jour très très régulièrement</a> et la <a href="http://sebsauvage.net/wiki/doku.php?id=php:shaarli#ideas_fixme">liste des améliorations à venir</a> est encore bien fournie.</p>
<p>Bref bien que le déploiement soit simplissime, je suis feignant et j&#8217;ai écrit un petit script maison qui le fait pour moi :</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>
&nbsp;
<span style="color: #007800;">REP_INTALLATION</span>=<span style="color: #ff0000;">&quot;/var/www/shaarli&quot;</span>
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>sebsauvage.net<span style="color: #000000; font-weight: bold;">/</span>files<span style="color: #000000; font-weight: bold;">/</span>shaarli.zip
<span style="color: #c20cb9; font-weight: bold;">unzip</span> <span style="color: #660033;">-d</span> shaarli_tmp shaarli.zip
&nbsp;
<span style="color: #007800;">version_en_ligne</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">cat</span> shaarli_tmp<span style="color: #000000; font-weight: bold;">/</span>index.php <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #660033;">-Ei</span> <span style="color: #ff0000;">&quot;'shaarli_version'&quot;</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #660033;">-rn</span> <span style="color: #ff0000;">&quot;s/.*,'(.*)'.*/\1/p&quot;</span><span style="color: #000000; font-weight: bold;">`</span>
<span style="color: #007800;">version_installee</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #007800;">$REP_INTALLATION</span><span style="color: #000000; font-weight: bold;">/</span>index.php <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #660033;">-Ei</span> <span style="color: #ff0000;">&quot;'shaarli_version'&quot;</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #660033;">-rn</span> <span style="color: #ff0000;">&quot;s/.*,'(.*)'.*/\1/p&quot;</span><span style="color: #000000; font-weight: bold;">`</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$version_en_ligne</span>&quot;</span> <span style="color: #000000; font-weight: bold;">!</span>= <span style="color: #ff0000;">&quot;<span style="color: #007800;">$version_installee</span>&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>;
<span style="color: #000000; font-weight: bold;">then</span>  
 <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Version installée (<span style="color: #007800;">$version_installee</span>) différente de la dernière version disponible (<span style="color: #007800;">$version_en_ligne</span>)&quot;</span>
 <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Installation en cours...&quot;</span>
 <span style="color: #c20cb9; font-weight: bold;">mv</span> shaarli_tmp<span style="color: #000000; font-weight: bold;">/*</span> <span style="color: #007800;">$REP_INTALLATION</span>
<span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-rf</span> shaarli_tmp
<span style="color: #c20cb9; font-weight: bold;">rm</span> shaarli.zip</pre></div></div>

<p>Il faudra évidemment que l&#8217;utilisateur qui lance le script ait les droits d&#8217;écriture dans le répertoire d’installation de Shaarli (ce que j&#8217;ai résolu en ajoutant mon utilisateur au groupe www-data propriétaire du répertoire).</p>
<p>Une petite tache cron tous les 2 jours et voila mon shaarli toujours à jour&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://voidandany.free.fr/index.php/script-de-mise-a-jour-de-shaarli/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Outil de bookmarks en ligne : Shaarli</title>
		<link>http://voidandany.free.fr/index.php/outil-de-bookmarks-en-ligne-shaarli/</link>
		<comments>http://voidandany.free.fr/index.php/outil-de-bookmarks-en-ligne-shaarli/#comments</comments>
		<pubDate>Tue, 20 Sep 2011 20:01:15 +0000</pubDate>
		<dc:creator>voidAndAny</dc:creator>
				<category><![CDATA[site web]]></category>
		<category><![CDATA[dockstar]]></category>
		<category><![CDATA[webapp]]></category>

		<guid isPermaLink="false">http://voidandany.free.fr/?p=4317</guid>
		<description><![CDATA[Une nouvelle fonctionnalité pour mon Dockstar un service de marque-pages en ligne. Cela me permettra ainsi d’accéder à mes bookmark de n&#8217;importe où, d&#8217;en partager certains, de purger un peu le dossier &#171;&#160;Marque-pages non classés&#160;&#187; de Firefox et de résoudre &#8230; <a href="http://voidandany.free.fr/index.php/outil-de-bookmarks-en-ligne-shaarli/">Continuer la lecture <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Une nouvelle fonctionnalité pour mon <a href="http://voidandany.free.fr/index.php/tag/dockstar/">Dockstar</a> un <strong>service de marque-pages en ligne</strong>.</p>
<p>Cela me permettra ainsi d’accéder à mes bookmark de n&#8217;importe où, d&#8217;en partager certains, de purger un peu le dossier &laquo;&nbsp;Marque-pages non classés&nbsp;&raquo; de Firefox et de résoudre les problèmes de synchronisation entre PC / navigateur.</p>
<p>Petit aparte concernant ce dernier point : j&#8217;ai bien mis en œuvre un <a title="Installer un serveur Firefox Sync minimal avec NGINX (ex Weave)" href="http://voidandany.free.fr/index.php/installer-un-serveur-firefox-sync-minimal-avec-nginx-ex-weave/">serveur sync</a> mais il ne répond que partiellement à mes besoins : pas d&#8217;addon pour chrome/IE, pas de consultation en ligne et pas de synchronisation partiel des marques pages (Xmark répond à tous ces besoins mais dans ma quête d&#8217;indépendance j&#8217;ai décidé de m&#8217;en passer&#8230;)</p>
<p>Revenons au sujet de cet article, je voulais mettre en œuvre un <strong>Delicious ou Diigo auto-hébergé</strong>&#8230;</p>
<p>Lors de mes premières recherches (lorsque je référençait ce que je voudrais voir tourner sur mon Dockstar) j&#8217;avais trouvé <a hreflang="en" href="http://sourceforge.net/projects/scuttle/">Scuttle</a> puis son &laquo;&nbsp;remplaçant&nbsp;&raquo; <a hreflang="fr" href="https://sourceforge.net/projects/semanticscuttle/">SemanticScuttle</a> et puis ayant des chantiers prioritaires j&#8217;en étais resté là.</p>
<p>Il y a quelques jours un blogueur que je respect pour son éthique (en plus d&#8217;avoir des articles très intéressants) aka <a href="http://sebsauvage.net/">sebsauvage</a> à publié ceci :<a href="http://sebsauvage.net/rhaa/index.php?2011/09/16/09/29/58-adieu-delicious-diigo-et-stumbleupon-salut-shaarli-"> Adieu Delicious, Diigo et StumbleUpon. Salut Shaarli !</a></p>
<p>Il ne m&#8217;en a pas fallu plus pour que le sujet revienne sur le devant de la scène. Qui plus est l&#8217;installation de son outil de bookmarks en ligne <a href="http://sebsauvage.net/wiki/doku.php?id=php:shaarli">Shaarli</a> est simplissime donc il ne m&#8217;a pas fallu beaucoup de temps.</p>
<p>Pas de dépendances exotique, pas de base de données juste un serveur web et php&#8230;</p>
<p>On télécharge l&#8217;archive, on la décompresse dans son arborescence web, on s&#8217;assure que les droits sont bons</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">mkdir</span> shaarli
<span style="color: #7a0874; font-weight: bold;">cd</span> shaarli
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>sebsauvage.net<span style="color: #000000; font-weight: bold;">/</span>files<span style="color: #000000; font-weight: bold;">/</span>shaarli_0.0.14beta.zip
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">unzip</span> shaarli_0.0.14beta.zip
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">chown</span> www-data:www-data ..<span style="color: #000000; font-weight: bold;">/</span>shaarli <span style="color: #660033;">-R</span></pre></div></div>

<p>(Lignes de commande à adapter à sa configuration, lien de téléchargement à mettre à jour, Sebsauvage met à jour son script tous les jours&#8230;)</p>
<p>&nbsp;</p>
<p>Ensuite on paramètre son serveur web pour autoriser l&#8217;accès au répertoire créé, on se connecte sur le site, on choisi un login et mot de passe et on drag/drop le snippet dans sa barre des marques page de son navigateur et voila tout est prèt.</p>
<p>Plus de détails <a href="http://sebsauvage.net/wiki/doku.php?id=php:shaarli">sur le wiki de Sebsauvage</a>.</p>
<p>Page principal du service :</p>
<p><a href="http://voidandany.free.fr/wp-content/uploads/Sélection_039.resized1.png"><img class="aligncenter size-full wp-image-4327" title="Sélection_039.resized" src="http://voidandany.free.fr/wp-content/uploads/Sélection_039.resized1.png" alt="" width="455" height="480" /></a></p>
<p>&nbsp;</p>
<p>Page, pop-up d&#8217;ajout de marque-page</p>
<p><a href="http://voidandany.free.fr/wp-content/uploads/Sélection_039.resized1.png"></a><a href="http://voidandany.free.fr/wp-content/uploads/Sélection_0381.png"><img class="aligncenter size-full wp-image-4325" title="Sélection_038" src="http://voidandany.free.fr/wp-content/uploads/Sélection_0381.png" alt="" width="607" height="339" /></a></p>
<p>Après quelques jours de tests <strong>je suis comblé</strong>, c&#8217;est simple, ça fonctionne, parfaitement dans l&#8217;esprit <a href="http://fr.wikipedia.org/wiki/Keep_it_Simple,_Stupid">KISS</a>, le design  pourrait être amélioré mais cela va, présence de bookmarks publiques et privés, une description du bookmark, des tags (une discipline à prendre)&#8230;.</p>
<p>&nbsp;</p>
<p><span style="text-decoration: underline;"><em><strong>Sources : </strong></em></span></p>
<p>Autres outils :<a title="Scuttle : bookmark manager" href="http://blog.tomamplius.net/index.php?post/2010/05/23/Scuttle-%3A-bookmark-manager"></a></p>
<ul>
<li><a title="Scuttle : bookmark manager" href="http://blog.tomamplius.net/index.php?post/2010/05/23/Scuttle-%3A-bookmark-manager">Scuttle : bookmark manager</a></li>
<li><a href="http://blog.tomamplius.net/index.php?post/2010/10/08/Migration-de-Scuttle-vers-SemanticScuttle">Scuttle vers SemanticScuttle</a></li>
<li><a href="http://sourceforge.net/projects/semanticscuttle/">SemanticScuttle</a> </li>
<li><a href="http://sarahhaim.wordpress.com/2008/05/15/6-outils-de-bookmarking-delicious-lik/">Revue : 6 outils de bookmarking opensource (del.icio.us like) « Opensource et médias sociaux</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://voidandany.free.fr/index.php/outil-de-bookmarks-en-ligne-shaarli/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Ecouter sa musique partout sans Google Music : Ampache, Subsonic et co</title>
		<link>http://voidandany.free.fr/index.php/ecouter-sa-musique-partout-sans-google-music-ampache-subsonic-et-co/</link>
		<comments>http://voidandany.free.fr/index.php/ecouter-sa-musique-partout-sans-google-music-ampache-subsonic-et-co/#comments</comments>
		<pubDate>Mon, 19 Sep 2011 20:16:28 +0000</pubDate>
		<dc:creator>voidAndAny</dc:creator>
				<category><![CDATA[site web]]></category>
		<category><![CDATA[dockstar]]></category>
		<category><![CDATA[musique]]></category>
		<category><![CDATA[webapp]]></category>

		<guid isPermaLink="false">http://voidandany.free.fr/?p=4150</guid>
		<description><![CDATA[Le dernier service Google à la mode est Google Music. Vous confiez/uploadez toute votre musique à Google et vous pouvez y accéder via une interface Web ou une application Android. C&#8217;est bien mais ce n&#8217;est pas révolutionnaire (à part peut &#8230; <a href="http://voidandany.free.fr/index.php/ecouter-sa-musique-partout-sans-google-music-ampache-subsonic-et-co/">Continuer la lecture <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Le dernier service Google à la mode est Google Music. Vous confiez/uploadez toute votre musique à Google et vous pouvez y accéder via une interface Web ou une application Android.</p>
<p>C&#8217;est bien mais ce n&#8217;est pas révolutionnaire (à part peut être le fait que Google &laquo;&nbsp;offre&nbsp;&raquo; 100Go de stockage dans le cloud) et cela fait une chose de plus (un bout de votre vie) que vous confiez à un géant du Web.</p>
<p>Cette idée de <strong>bibliothèque musicale sur le web</strong>, accessible de partout, je l&#8217;ai depuis pas mal de temps (voir <a title="Lien permanent vers Marques pages : Choisir un lecteur audio pour Ubuntu" rel="bookmark" href="../index.php/marques-pages-choisir-un-lecteur-audio-pour-ubuntu/">Marques pages : Choisir un lecteur audio pour Ubuntu</a> et plus particulièrement la fin Lecteurs audio « client-serveur ») et après pas mal de tests, d&#8217;exploration de solutions non pérennes (daap, icecast, etc), j&#8217;ai enfin trouvé <a href="http://ampache.org/"><em><em>Ampache.</em></em></a></p>
<p>Dans cet article je vais décrire l&#8217;<strong>installation d&#8217;Ampache</strong> mais aussi d&#8217;autres logiciels ayant la même vocation :</p>
<ul>
<li><a href="http://www.subsonic.org/pages/index.jsp">Subsonic</a></li>
<li><a href="http://web.psung.name/zeya/">Zeya</a></li>
<li><a href="http://www.pancake.org/zina">Zina</a></li>
<li><a href="http://github.com/daveisadork/Blofeld">Blofeld</a></li>
<li><a href="https://github.com/chaffneue/streeme">Streeme</a></li>
</ul>
<p>Mes critère de choix, outre la possibilité d&#8217;écouter ma musique via internet était que le service doit pouvoir fonctionner sur mon <a title="Marques-pages : Un mini serveur le Seagate Dockstar" href="http://voidandany.free.fr/index.php/marques-pages-un-mini-serveur-le-seagate-dockstar/">Dockstar</a> avec son petit processeur ARM et ses 128 Mo de RAM !!</p>
<p>&nbsp;</p>
<h2>Ampache</h2>
<p>Commençons par le gagnant.</p>
<p>Ampache n&#8217;est pas le logiciel le plus beau ni celui offrant le plus fonctionnalité mais il offre l&#8217;immense avantage de s&#8217;installer sur un pile serveur web + MySQL et de ne pas consommer trop de ressources</p>
<p>Ampache est dans les dépôts Debian (avec une petite particularité nous le verrons plus tard) on l&#8217;installe donc avec son gestionnaire de paquet préféré (aptitude pour moi) :</p>

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


<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">Les NOUVEAUX paquets suivants vont être installés :
 ampache libjs-prototype{a} libmysqlclient16{a} libnusoap-php{a} libphp-snoopy{a} mysql-common{a} php5{a} php5-auth-pam{a}
 php5-mysql{a} php5-xmlrpc{a} ttf-freefont{a}
 Les paquets suivants sont RECOMMANDÉS mais ne seront pas installés :
 ampache-themes apache2-mpm-prefork eyed3 javascript-common lighttpd x-ttcidfont-conf
 0 paquets mis à jour, 11 nouvellement installés, 0 à enlever et 0 non mis à jour.
 Il est nécessaire de télécharger 4 177 ko/6 087 ko d'archives. Après dépaquetage, 17,9 Mo seront utilisés.</pre></div></div>

<p>On remarquera que le paquet conseil d&#8217;installer apache ou lighttpd, mais j&#8217;ai déjà <a title="Installer un serveur web (nginx) sur le Seagate Dockstar" href="http://voidandany.free.fr/index.php/installer-un-serveur-web-nginx-sur-le-seagate-dockstar/">NGINX</a> d&#8217;installé&#8230;</p>
<p>On <a title="Lien permanent vers Installer et configurer Mysql sur le Dockstar" rel="bookmark" href="../index.php/installer-et-configurer-mysql-sur-le-dockstar/">Installera aussi le serveur MySQL</a>, bien qu&#8217;il ne soit pas dans les paquets nécessaires ni recommandés (pour la bonne raison que l&#8217;on peut utiliser une base distante)</p>
<p>Le paquet Ampache installe les pages HTML/php constituant le logiciel dans /usr/share/ampache  et il faut donc les rendre accessible de son serveur web, j&#8217;ai pour ma part choisi de créer un lien symbolique entre la racine de mon serveur web et le répertoire d&#8217;Ampache :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www
<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>ampache<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span> ampache
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">chown</span> www-data:www-data ampache<span style="color: #000000; font-weight: bold;">/</span> <span style="color: #660033;">-R</span></pre></div></div>

<p>On se connecte ensuite à son serveur Web :</p>
<p>http://IP-du-serveur/ampache</p>
<p>Et on passe les différents écran de configuration :</p>
<p>Tout d&#8217;abord on vérifie que tous les pré-requis système sont présents :</p>
<p><a href="http://voidandany.free.fr/wp-content/uploads/Sélection_025.resized1.png"><img class="aligncenter size-full wp-image-4294" title="Sélection_025.resized" src="http://voidandany.free.fr/wp-content/uploads/Sélection_025.resized1.png" alt="" width="640" height="452" /></a>Dans mon cas j&#8217;ai eu un problème avec le pré-requis &laquo;&nbsp;MySQL for php&nbsp;&raquo; et ce malgré l&#8217;installation du paquet php5-mysql, je l&#8217;ai corrigé en <a href="http://voidandany.free.fr/index.php/ajouter-le-support-mysql-a-php/">ajoutant une ligne dans mon php.ini</a></p>
<p>Sélectionner ensuite la langue d&#8217;installation.</p>
<p>&nbsp;</p>
<p>Renseigner ensuite les données MySQL : l&#8217;utilisateur root, son mot de passe, la machine hébergeant MySQL (localhost le plus souvant) et le nom de la base à créer (ampache pour faire simple)</p>
<p>On indique aussi que l&#8217;on veut créer un nouvel utilisateur MySQL nommé ampache (ou comme vous le souhaitez)</p>
<p><a href="http://voidandany.free.fr/wp-content/uploads/Sélection_026.resized1.png"><img class="aligncenter size-full wp-image-4295" title="Sélection_026.resized" src="http://voidandany.free.fr/wp-content/uploads/Sélection_026.resized1.png" alt="" width="546" height="480" /></a></p>
<p>Ayant faire divers essai j&#8217;ai remarqué que si on coche la case &laquo;&nbsp;Ecraser la configuration existante&nbsp;&raquo; on a l&#8217;erreur :</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">Error: Unable to make Database Connection Access denied for user 'root'@'localhost' (using password: NO)</pre></div></div>

<p>Si on a déjà une base ampache que l&#8217;on souhaite écraser, il n&#8217;y a pas d&#8217;autre moyen que de supprimer les tables et la base précédente via un requeteur</p>
<p>&nbsp;</p>
<p>Normalement à l&#8217;étape suivante la base, l&#8217;utilisateur dédié et les table doivent être créés, on indique alors les informations choisies précédemment (nom de la base, utilisateur et mot de passe de ce dernier)</p>
<p><a href="http://voidandany.free.fr/wp-content/uploads/Sélection_027.resized.png"><img class="aligncenter size-full wp-image-4296" title="Sélection_027.resized" src="http://voidandany.free.fr/wp-content/uploads/Sélection_027.resized.png" alt="" width="616" height="480" /></a></p>
<p>Le bouton &laquo;&nbsp;écrire la configuration&nbsp;&raquo; télécharge un fichier ampache.cfg.php   qu&#8217;il faut copier sous /var/www/ampache/config (penser au droit accès)</p>
<p>Un fois copié, cliquer sur le lien &laquo;&nbsp;teste de la configuration&nbsp;&raquo; et tout devrait être OK :<a href="../wp-content/uploads/S%C3%A9lection_029.resized.png"><br />
 </a><a href="http://voidandany.free.fr/wp-content/uploads/Sélection_029.png"><img class="aligncenter size-full wp-image-4305" title="Sélection_029" src="http://voidandany.free.fr/wp-content/uploads/Sélection_029.png" alt="" width="213" height="49" /></a></p>
<p>Créer ensuite un compte administrateur :</p>
<p><a href="http://voidandany.free.fr/wp-content/uploads/Sélection_029.png"></a><a href="http://voidandany.free.fr/wp-content/uploads/Sélection_030.resized.png"><img class="aligncenter size-full wp-image-4299" title="Sélection_030.resized" src="http://voidandany.free.fr/wp-content/uploads/Sélection_030.resized.png" alt="" width="640" height="355" /></a></p>
<p>Et la configuration est terminée, reste plus qu&#8217;a aller sur la page d&#8217;accueil et se logguer avec le compte administrateur défini précedemment :</p>
<p><a href="http://voidandany.free.fr/wp-content/uploads/Sélection_030.resized.png"></a><a href="http://voidandany.free.fr/wp-content/uploads/Sélection_031.resized.png"><img class="aligncenter size-full wp-image-4300" title="Sélection_031.resized" src="http://voidandany.free.fr/wp-content/uploads/Sélection_031.resized.png" alt="" width="574" height="480" /></a></p>
<p>Voici l&#8217;interface par défaut d&#8217;Ampache (vous verrez par la suite il y a d&#8217;autres logiciel plus beaux mais aussi des plus moches&#8230;)</p>
<p><a href="http://voidandany.free.fr/wp-content/uploads/Sélection_032.resized.png"><img class="aligncenter size-full wp-image-4301" title="Sélection_032.resized" src="http://voidandany.free.fr/wp-content/uploads/Sélection_032.resized.png" alt="" width="640" height="338" /></a></p>
<p>L&#8217;étape suivante à aller dans les pages de paramétrage et d&#8217;ajouter un répertoire contenant de la musique :</p>
<p><a href="http://voidandany.free.fr/wp-content/uploads/Sélection_033.resized.png"><img class="aligncenter size-full wp-image-4302" title="Sélection_033.resized" src="http://voidandany.free.fr/wp-content/uploads/Sélection_033.resized.png" alt="" width="640" height="441" /></a>Attention Ampache (via l&#8217;utilisateur www-data de votre serveur web) doit avoir accès en lecture aux fichiers&#8230;</p>
<p>&nbsp;</p>
<p>Pour la lecture de la musique Ampache propose de télécharger une playlist avec les adresses des morceaux sélectionnés (en http) ou de piloter un serveur MPD ou dans le cas qui nous intéresse de jouer la musique directement dans l&#8217;interface via un lecteur en Flash.</p>
<p>Or ce lecteur Flash n&#8217;est packagé dans l&#8217;archive Debian/Ubuntu (pour des raison de droits ?), il faut donc l&#8217;installer manuellement.</p>
<p>Pour cela télécharger l&#8217;archive des sources sur le site d&#8217;Ampache, la décompresser et copier les fichiers xspf_jukebox.fla et swf présents dans le répertoire module/flash dans le répertoire correspondant de votre installation.</p>
<p>&nbsp;</p>
<p>Enfin si on veut rendre Ampache plus (les goûts et les couleurs&#8230;) on pourra installer le paquet ampache-themes qui propose des thème supplémentaire par rapport a ceux embarqués par défaut.</p>
<p>Pour ma part j&#8217;ai installé un thème trouvé sur le forum d&#8217;Ampache :</p>
<h3><a href="http://ampache.org/forums/viewtopic.php?f=5&amp;t=3392#p16587">Fresh theme (r5 &#8211; now playing update)</a></h3>
<p><a href="http://voidandany.free.fr/wp-content/uploads/Sélection_038.resized.png"><img class="aligncenter size-full wp-image-4306" title="Sélection_038.resized" src="http://voidandany.free.fr/wp-content/uploads/Sélection_038.resized.png" alt="" width="640" height="311" /></a></p>
<p>&nbsp;</p>
<h2>Subsonic</h2>
<p>Subsonic a été le plus sérieux concurrent à Ampache.</p>
<p>Il est beau, bourré de fonctionnalité, ergonomique :</p>
<p><a href="http://voidandany.free.fr/wp-content/uploads/Sélection_013.resized.png"><img class="aligncenter size-full wp-image-4276" title="Sélection_013.resized" src="http://voidandany.free.fr/wp-content/uploads/Sélection_013.resized.png" alt="" width="640" height="410" /></a></p>
<p>MAIS il est en Java.</p>
<p>Il occupe donc beaucoup de place disque (90Mo rien que pour le JRE), mémoire et CPU.</p>
<p>Ces 2 derniers points sont bloquant pour mon Dockstar :</p>
<p><a href="http://voidandany.free.fr/wp-content/uploads/cpu-day3.png"><img class="aligncenter size-full wp-image-4265" title="memory-day3" src="http://voidandany.free.fr/wp-content/uploads/memory-day3.png" alt="" width="497" height="424" /><img class="aligncenter size-full wp-image-4264" title="cpu-day3" src="http://voidandany.free.fr/wp-content/uploads/cpu-day3.png" alt="" width="497" height="364" /></a></p>
<p>En pré-requis Subsonic à le JRE, sur un serveur comme le Dockstar il est impératif de prendre la version headless, sinon on se retrouve à télécharger xorg et 50 Mo supplémentaires de librairies graphiques&#8230;</p>

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


<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">Les NOUVEAUX paquets suivants vont être installés :
 ca-certificates-java{a} java-common{a} libavahi-client3{a}   libavahi-common-data{a} libavahi-common3{a} libcups2{a} libdbus-1-3{a}   libfreetype6{a} liblcms1{a} libnspr4-0d{a}
 libnss3-1d{a} openjdk-6-jre-headless openjdk-6-jre-lib{a} tzdata-java{a}
 Les paquets suivants sont RECOMMANDÉS mais ne seront pas installés :
 dbus icedtea-6-jre-cacao
 0 paquets mis à jour, 14 nouvellement installés, 0 à enlever et 0 non mis à jour.
 Il est nécessaire de télécharger 32,0 Mo/32,4 Mo d'archives. Après dépaquetage, 87,3 Mo seront utilisés.</pre></div></div>

<p>On téléchargera ensuite le paquet correspondant à Debian/Ubuntu sur la page du projet :</p>
<h3><a href="http://subsonic.org/"><em>Subsonic</em> » Free Music Streamer</a></h3>
<p>Et on l&#8217;installera :</p>

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

<p>Pour finir l&#8217;installation / la configuration il suffit d&#8217;aller sur le serveur sur lequel vous avez installé Subsonic sur le port 4040 :</p>
<p>http://IP-du-serveur:4040</p>
<p>On se connecte avec l&#8217;utilisateur et mot de passe &laquo;&nbsp;admin&nbsp;&raquo;</p>
<p><a href="http://voidandany.free.fr/wp-content/uploads/Sélection_0099.png"><img class="aligncenter size-full wp-image-4268" title="Sélection_009" src="http://voidandany.free.fr/wp-content/uploads/Sélection_0099.png" alt="" width="516" height="208" /></a></p>
<p>Et la page d&#8217;accueil s&#8217;affiche :</p>
<p><a href="http://voidandany.free.fr/wp-content/uploads/Sélection_010.resized.png"><img class="aligncenter size-full wp-image-4275" title="Sélection_010.resized" src="http://voidandany.free.fr/wp-content/uploads/Sélection_010.resized.png" alt="" width="640" height="389" /></a></p>
<p>Et indique les étapes à réaliser (les étapes sont cliquables) :</p>
<p><a href="http://voidandany.free.fr/wp-content/uploads/Sélection_0152.png"><img class="aligncenter size-full wp-image-4272" title="Sélection_015" src="http://voidandany.free.fr/wp-content/uploads/Sélection_0152.png" alt="" width="523" height="430" /></a></p>
<p>Premièrement pour des raisons de sécurité, changer le mot de passe administrateur :</p>
<p><a href="http://voidandany.free.fr/wp-content/uploads/Sélection_0162.png"><img class="aligncenter size-full wp-image-4273" title="Sélection_016" src="http://voidandany.free.fr/wp-content/uploads/Sélection_0162.png" alt="" width="498" height="403" /></a></p>
<p>Puis configurer les lieux de stockage de la musique :</p>
<p><a href="http://voidandany.free.fr/wp-content/uploads/Sélection_0173.png"><img class="aligncenter size-full wp-image-4274" title="Sélection_017" src="http://voidandany.free.fr/wp-content/uploads/Sélection_0173.png" alt="" width="626" height="320" /></a></p>
<p>Lorsque l&#8217;indexation est terminée on peut profiter de Subsonic</p>
<p><a href="http://voidandany.free.fr/wp-content/uploads/Sélection_0173.png"></a><a href="http://voidandany.free.fr/wp-content/uploads/Sélection_014.resized.png"><img class="aligncenter size-full wp-image-4277" title="Sélection_014.resized" src="http://voidandany.free.fr/wp-content/uploads/Sélection_014.resized.png" alt="" width="640" height="407" /></a></p>
<p>&#8230; pour peu que sa machine le supporte, c&#8217;est à dire pas un Dockstar, vraiment dommage &#8230;</p>
<p>&nbsp;</p>
<h2>Zeya</h2>
<p>Zeya est un petit serveur musical ne proposant que très peu de fonctionnalités : une liste de morceau, on en choisi un et il est joué dans le navigateur&#8230;</p>
<p><a href="../wp-content/uploads/S%C3%A9lection_007-600x370.png"><img title="Zeya " src="../wp-content/uploads/S%C3%A9lection_007-600x370.png" alt="" width="600" height="370" /></a></p>
<p>Zeya est disponible dans les dépôts Debian/Ubuntu (v0.4) il suffit donc de faire :</p>

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

<p>Sur ma Debian cela prend 8 675 ko et installe les paquets suivants :</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">libao-common{a} libao4{a} libboost-python1.42.0{a} libflac8{a} libogg0{a} libspeex1{a} libtag1-vanilla{a} libtag1c2a{a}
 libvorbis0a{a} libvorbisenc2{a} libvorbisfile3{a} python-simplejson{a} python-tagpy{a} vorbis-tools{a} zeya</pre></div></div>

<p>Et recommande les paquets suivants :</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">flac libjs-jquery mpg123 mpg321</pre></div></div>

<p>Le lancement de Zeya se fait ensuite avec un simple :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">zeya <span style="color: #660033;">--path</span>=<span style="color: #000000; font-weight: bold;">/</span>data<span style="color: #000000; font-weight: bold;">/</span>multimedia<span style="color: #000000; font-weight: bold;">/</span>Musiques</pre></div></div>

<p>Le premier démarrage est long car Zeya scanne le répertoire passé en paramètre en vue d&#8217;indexer les morceaux de musique qu&#8217;il contient :</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">Using 'dir' backend.
 Scanning for music in '/data/multimedia/Musiques/Musique'...
 TagLib: MPEG::Header::parse() -- Invalid sample rate.
&nbsp;
TagLib: MPEG::Properties::read() -- Could not find a valid last MPEG frame in the stream
&nbsp;
TagLib: Ogg::File::packet() -- Could not find the requested packet.
 TagLib: Vorbis::File::read() - Could not find the Vorbis comment header.
&nbsp;
TagLib: ID3v2.4 no longer supports the frame type RVAD.  It will be discarded from the tag.</pre></div></div>

<p>Les erreurs que j&#8217;ai eu (ci-dessus) seraient sûrement corrigées avec l&#8217;installation des paquets recommandés.</p>
<p>Ensuite Zeya démarre un serveur web sur le port  8080, sert l&#8217;interface et stream la musique :</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">Loading library...
 Listening on port 8080
 ::ffff:192.168.1.100 - - [16/Jun/2011 21:37:18] &quot;GET / HTTP/1.1&quot; 200 -
 ::ffff:192.168.1.100 - - [16/Jun/2011 21:37:18] &quot;GET /zeya.css HTTP/1.1&quot; 200 -
 ::ffff:192.168.1.100 - - [16/Jun/2011 21:37:18] &quot;GET /zeya.js HTTP/1.1&quot; 200 -
 ::ffff:192.168.1.100 - - [16/Jun/2011 21:37:18] &quot;GET /previous.png HTTP/1.1&quot; 200 -
 ::ffff:192.168.1.100 - - [16/Jun/2011 21:37:18] &quot;GET /play.png HTTP/1.1&quot; 200 -
 ::ffff:192.168.1.100 - - [16/Jun/2011 21:37:18] &quot;GET /next.png HTTP/1.1&quot; 200 -
 ::ffff:192.168.1.100 - - [16/Jun/2011 21:37:18] &quot;GET /pause.png HTTP/1.1&quot; 200 -
 ::ffff:192.168.1.100 - - [16/Jun/2011 21:37:18] &quot;GET /spinner.gif HTTP/1.1&quot; 200 -
 ::ffff:192.168.1.100 - - [16/Jun/2011 21:37:18] &quot;GET /repeat.png HTTP/1.1&quot; 200 -
 ::ffff:192.168.1.100 - - [16/Jun/2011 21:37:18] &quot;GET /shuffle.png HTTP/1.1&quot; 200 -
 ::ffff:192.168.1.100 - - [16/Jun/2011 21:37:18] &quot;GET /search.png HTTP/1.1&quot; 200 -
 ::ffff:192.168.1.100 - - [16/Jun/2011 21:37:18] &quot;GET /favicon.png HTTP/1.1&quot; 200 -
 ::ffff:192.168.1.100 - - [16/Jun/2011 21:37:18] &quot;GET /favicon.png HTTP/1.1&quot; 200 -
 ::ffff:192.168.1.100 - - [16/Jun/2011 21:37:18] &quot;GET /getlibrary HTTP/1.1&quot; 200 -
 ::ffff:192.168.1.100 - - [16/Jun/2011 21:38:03] &quot;GET /getcontent?key=3797 HTTP/1.1&quot; 200 -
 Handling request for /data/multimedia/Musiques/Musique/Renan Luce/Repenti/Renan Luce - 13 - LIris Et La Rose.ogg
 ::ffff:192.168.1.100 - - [16/Jun/2011 21:40:25] &quot;GET /getcontent?key=3785 HTTP/1.1&quot; 200 -
 Handling request for /data/multimedia/Musiques/Musique/Renan Luce/Repenti/Renan Luce - 01 - Les Voisines.ogg</pre></div></div>

<p>Comme indiqué précédemment Zeya est simplissime et il manque tout de même quelques fonctionnalités, notamment la possibilité de gérer sa liste de lecture, en effet Zeya joue les morceau les un derrière les autres sans possibilité de les ordonner (par contre on peut les sélectionner avec la zone de recherche), de plus il n&#8217;est pas possible d&#8217;avancer dans un morceau et enfin dernier critère de non choix, sur mon Dockstar la CPU monte à 100% et les morceaux coupent toutes les 5s</p>
<p>&nbsp;</p>
<p><strong>Rque : </strong>pour installer le dernière version (v0.5), télécharger le paquet sur le site du projet : <br />
 <a href="http://web.psung.name/zeya/">http://web.psung.name/zeya/</a></p>
<p>Installer les dépendances (et éventuellement les paquets recommandés voir ci-dessus)</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">vorbis-tools python-simplejson python-tagpy</pre></div></div>

<p>Et installer Zeya :</p>

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

<p>&nbsp;</p>
<h2>Zina</h2>
<p><a href="http://www.pancake.org/zina">Zina</a> ressemble un peu à Ampache, mais en moins beau et avec le MySQL optionnel.</p>
<p>De plus il n&#8217;est plus maintenu (ou tout du moins en pause) depuis Août 2010&#8230;</p>
<p>Pour l&#8217;installer on télécharge l&#8217;archive sur le site, on la décompresse dans un répertoire accessible du serveur web et voila :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">wget</span> https:<span style="color: #000000; font-weight: bold;">//</span>downloads.sourceforge.net<span style="color: #000000; font-weight: bold;">/</span>project<span style="color: #000000; font-weight: bold;">/</span>zina<span style="color: #000000; font-weight: bold;">/</span>Zina<span style="color: #000000; font-weight: bold;">/</span>2.0beta22<span style="color: #000000; font-weight: bold;">/</span>zina-2.0b22.tar.gz?<span style="color: #007800;">r</span>=<span style="color: #000000; font-weight: bold;">&amp;</span><span style="color: #007800;">ts</span>=<span style="color: #000000;">1315944029</span><span style="color: #000000; font-weight: bold;">&amp;</span><span style="color: #007800;">use_mirror</span>=freefr
<span style="color: #c20cb9; font-weight: bold;">mv</span> zina-2.0b22.tar.gz<span style="color: #000000; font-weight: bold;">*</span> zina-2.0b22.tar.gz
<span style="color: #c20cb9; font-weight: bold;">tar</span> <span style="color: #660033;">-xvf</span> zina-2.0b22.tar.gz
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">mv</span> zina<span style="color: #000000; font-weight: bold;">/</span> <span style="color: #000000; font-weight: bold;">/</span>data<span style="color: #000000; font-weight: bold;">/</span>www
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">chown</span> www-data.www-data <span style="color: #000000; font-weight: bold;">/</span>data<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>zina <span style="color: #660033;">-R</span></pre></div></div>

<p>Il suffit ensuite d&#8217;accéder à Zina en http (adresse en fonction de votre serveur web) : http://IP_erveur/zina/index.php</p>
<p>Zina permet de jouer la musique en téléchargeant une playlist contenant les lien http vers les morceaux sélectionnés</p>
<p><a href="../wp-content/uploads/S%C3%A9lection_0221.png"><img title="Sélection_022" src="../wp-content/uploads/S%C3%A9lection_0221.png" alt="" width="640" height="371" /></a></p>
<p>&nbsp;</p>
<p>Ou via un lecteur flash embarqué (d’ailleurs mieux intégré que celui d&#8217;Ampache)</p>
<p><a href="http://voidandany.free.fr/wp-content/uploads/Sélection_0242.png"><img class="aligncenter size-full wp-image-4293" title="Sélection_024" src="http://voidandany.free.fr/wp-content/uploads/Sélection_0242.png" alt="" width="640" height="410" /></a><a href="http://voidandany.free.fr/wp-content/uploads/Sélection_0221.png"><img class="aligncenter size-full wp-image-4292" title="Sélection_023" src="http://voidandany.free.fr/wp-content/uploads/Sélection_0231.png" alt="" width="640" height="266" /><br />
 </a><a href="http://voidandany.free.fr/wp-content/uploads/Sélection_0211.png"><img class="aligncenter size-full wp-image-4290" title="Sélection_021" src="http://voidandany.free.fr/wp-content/uploads/Sélection_0211.png" alt="" width="629" height="480" /></a></p>
<p><a href="http://voidandany.free.fr/wp-content/uploads/Sélection_0202.png"><img class="aligncenter size-full wp-image-4289" title="Sélection_020" src="http://voidandany.free.fr/wp-content/uploads/Sélection_0202.png" alt="" width="640" height="372" /></a></p>
<h2>Blofeld</h2>
<p>L&#8217;annonce de Blofeld est alléchante : <a rel="next" href="http://www.davehayes.org/2010/07/22/introducing-blofeld">Introducing Blofeld</a></p>
<p>Mais la phrase &laquo;&nbsp;Difficult to install and configure&nbsp;&raquo; en parlant des autres serveurs musicaux me fait doucement rire car je n&#8217;ai pas réussi à installer Blofeld, pire j&#8217;ai planté mon Dockstar ce qui m&#8217;a valu une belle frayeur (<a title="Mon Dockstar ne boot plus sous Debian" href="http://voidandany.free.fr/index.php/mon-dockstar-ne-boot-plus-sous-debian/">voir cet article</a>).</p>
<p>Peut être est ce dû au fait que j&#8217;ai essayé de l&#8217;installer sur une Debian ARM alors que l&#8217;auteur semble privilégier Ubuntu&#8230;</p>
<p>De plus depuis l&#8217;annonce le <a href="https://github.com/daveisadork/Blofeld">github du projet</a> ne semble pas beaucoup bouger&#8230;</p>
<p>&nbsp;</p>
<p>Voici les étapes que j&#8217;ai suivi :</p>
<p>Installation des dépendances (attention ça fait mal, pire que le JRE) :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">aptitude</span> <span style="color: #c20cb9; font-weight: bold;">install</span> python-cheetah python-imaging python-mutagen python-couchdbkit couchdb python-gst0.10 gstreamer0.10-ffmpeg python-cherrypy3</pre></div></div>

<p>Ce qui installe :</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">couchdb erlang-base{a} erlang-crypto{a} erlang-inets{a} erlang-mnesia{a} erlang-public-key{a} erlang-runtime-tools{a}
 erlang-ssl{a} erlang-tools{a} erlang-webtool{a} erlang-xmerl{a} gstreamer0.10-ffmpeg iso-codes{a} libavcodec52{a}
 libavformat52{a} libavutil49{a} libdirac-encoder0{a} libfaad2{a} libffi5{a} libgsm1{a} libgstreamer-plugins-base0.10-0{a}
 libgstreamer0.10-0{a} libicu44{a} libjs-jquery{a} liblcms1{a} libmozjs2d{a} libnspr4-0d{a} libogg0{a} liboil0.3{a}
 libopenjpeg2{a} liborc-0.4-0{a} libpostproc51{a} libpython2.6{a} libschroedinger-1.0-0{a} libspeex1{a} libswscale0{a}
 libtheora0{a} libvorbis0a{a} libvorbisenc2{a} python-anyjson{a} python-cheetah python-cjson{a} python-couchdbkit
 python-gobject{a} python-gst0.10 python-imaging python-libxml2{a} python-mutagen python-restkit{a}</pre></div></div>

<p>Soit plus de 110 Mo !!</p>
<p>Récupération et installation de Blofeld :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">wget</span> https:<span style="color: #000000; font-weight: bold;">//</span>github.com<span style="color: #000000; font-weight: bold;">/</span>daveisadork<span style="color: #000000; font-weight: bold;">/</span>Blofeld<span style="color: #000000; font-weight: bold;">/</span>zipball<span style="color: #000000; font-weight: bold;">/</span>0.2.5
<span style="color: #c20cb9; font-weight: bold;">mv</span> 0.2.5 blofeld.zip
<span style="color: #c20cb9; font-weight: bold;">unzip</span> blofeld.zip
<span style="color: #c20cb9; font-weight: bold;">mv</span> daveisadork-Blofeld-96c363e<span style="color: #000000; font-weight: bold;">/</span> blofeld</pre></div></div>

<p>Lancement :</p>

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

<p>Et là se fut le drame, la CPU est montée, le terminal ne répondait plus, la connexion SSH a été interrompue et j&#8217;ai du rebooter sauvagement le Dockstar avec pour conséquence de la planter&#8230;</p>
<p>Donc pas de copie d&#8217;écran&#8230;.</p>
<p>&nbsp;</p>
<h2>Streeme</h2>
<p>[Ajout du 17/06/2013]</p>
<p>Nouveau (enfin pas si nouveau que ça) venu, un serveur musical simple mais complet en HTML5 / PHP (Symfony 1)</p>
<h3><a rel="attachment wp-att-4765" href="http://voidandany.free.fr/index.php/ecouter-sa-musique-partout-sans-google-music-ampache-subsonic-et-co/selection_001-22/"><img class="aligncenter size-full wp-image-4765" title="Sélection_001" src="http://voidandany.free.fr/wp-content/uploads/Sélection_00121.png" alt="" width="639" height="398" /></a></h3>
<p>Installation des pré-requis :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">aptitude</span> <span style="color: #c20cb9; font-weight: bold;">install</span> php-pear curl php5-curl php5-gd <span style="color: #c20cb9; font-weight: bold;">ffmpeg</span>
<span style="color: #c20cb9; font-weight: bold;">sudo</span> pear <span style="color: #c20cb9; font-weight: bold;">install</span> HTTP_Download</pre></div></div>

<p>Clone du repo :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">git</span> clone https:<span style="color: #000000; font-weight: bold;">//</span>github.com<span style="color: #000000; font-weight: bold;">/</span>chaffneue<span style="color: #000000; font-weight: bold;">/</span>streeme.git streeme
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">mv</span> streeme<span style="color: #000000; font-weight: bold;">/</span> <span style="color: #000000; font-weight: bold;">/</span>data<span style="color: #000000; font-weight: bold;">/</span>www
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">chown</span> www-data.www-data <span style="color: #000000; font-weight: bold;">/</span>data<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>streeme <span style="color: #660033;">-R</span></pre></div></div>

<p>Création d&#8217;une base MySQL</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">mysql <span style="color: #660033;">-uroot</span> <span style="color: #660033;">-p</span>
CREATE DATABASE streeme  DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
grant usage on <span style="color: #000000; font-weight: bold;">*</span>.<span style="color: #000000; font-weight: bold;">*</span> to streeme<span style="color: #000000; font-weight: bold;">@</span>localhost identified by <span style="color: #ff0000;">'password'</span>;
grant all privileges on streeme.<span style="color: #000000; font-weight: bold;">*</span> to streeme<span style="color: #000000; font-weight: bold;">@</span>localhost ;</pre></div></div>

<p>Configuration :</p>
<p>&nbsp;</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>streeme
<span style="color: #c20cb9; font-weight: bold;">cp</span> config<span style="color: #000000; font-weight: bold;">/</span>databases.template.yml config<span style="color: #000000; font-weight: bold;">/</span>databases.yml
<span style="color: #c20cb9; font-weight: bold;">cp</span> apps<span style="color: #000000; font-weight: bold;">/</span>client<span style="color: #000000; font-weight: bold;">/</span>config<span style="color: #000000; font-weight: bold;">/</span>app.template.yml apps<span style="color: #000000; font-weight: bold;">/</span>client<span style="color: #000000; font-weight: bold;">/</span>config<span style="color: #000000; font-weight: bold;">/</span>app.yml
<span style="color: #c20cb9; font-weight: bold;">mkdir</span> cache
<span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #000000;">777</span> log cache</pre></div></div>

<p>&nbsp;</p>
<p>Édition de config/databases.yml et configuration de la section all (username, password)</p>
<p>Édition de apps/client/config/app.yml et configuration des attributs watched_folders,  allowed_file_types, ffmpeg_executable</p>
<p>Vidage des caches :</p>
<p>&nbsp;</p>

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

<p>&nbsp;</p>
<p>Vérification pré-requis Symfony</p>
<p>&nbsp;</p>

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

<p>&nbsp;</p>
<p>Construction des tables :</p>
<p>&nbsp;</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">.<span style="color: #000000; font-weight: bold;">/</span>symfony doctrine:build <span style="color: #660033;">--all</span> <span style="color: #660033;">--and-load</span></pre></div></div>

<p>&nbsp;</p>
<p>Scan de la librairie :</p>
<p>&nbsp;</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">.<span style="color: #000000; font-weight: bold;">/</span>symfony scan-media <span style="color: #660033;">--type</span>=filesystem</pre></div></div>

<p>&nbsp;</p>
<p>Scan des album art (n&#8217;a pas marché chez moi)</p>
<p>&nbsp;</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">.<span style="color: #000000; font-weight: bold;">/</span>symfony scan-art <span style="color: #660033;">--source</span>=folders
.<span style="color: #000000; font-weight: bold;">/</span>symfony scan-art <span style="color: #660033;">--source</span>=meta</pre></div></div>

<p>&nbsp;</p>
<p>Création d&#8217;un utilisateur :</p>
<p>&nbsp;</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">symfony guard:create-user your_username your_password</pre></div></div>

<p>&nbsp;</p>
<p>Ma conf NGINX :</p>
<p>&nbsp;</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">server {
 listen       8095;
 server_name  music.xxx.fr;
 root         /var/www/xxx.fr/streeme/web;
&nbsp;
 access_log      /var/log/nginx/streeme.access.log ;
 include         /etc/nginx/common.conf ;
&nbsp;
 location ~ (/\.|^/(config|test)) {
 deny all;
 }
&nbsp;
 index           index.php;
&nbsp;
 rewrite ^/art/([a-zA-Z0-9]+|all)/([a-zA-Z0-9]+|all)$ /proxy_art.php?hash=$1&amp;size=$2 last;
 rewrite ^/client_dev.php/art/([a-zA-Z0-9]+|all)/([a-zA-Z0-9]+|all)$ /proxy_art.php?hash=$1&amp;size=$2 last;
&nbsp;
 location ~ ^/(index|proxy_art)\.php$ {
 include         /etc/nginx/fastcgi_params;
 fastcgi_param   SCRIPT_FILENAME  $document_root$fastcgi_script_name;
 fastcgi_pass    127.0.0.1:9000;
 }
&nbsp;
 location / {
 index index.php;
 try_files $uri /index.php?$args;
 }
&nbsp;
 location /sf/ {
 root /var/www/xxx.fr/streeme/lib/vendor/symfony/data/web/sf/;
 }
&nbsp;
}
#Music-proxy
server {
 listen 8096;
&nbsp;
 root /var/www/xxx.fr/streeme/web;
&nbsp;
 location ~ (/\.|^/(config|test)) {
 deny all;
 }
&nbsp;
 rewrite ^/play/([a-zA-Z0-9.]+|all)$ /proxy_play.php?unique_song_id=$1 last;
 rewrite ^/client_dev.php/play/([a-zA-Z0-9]+|all)$ /proxy_play.php?unique_song_id=$1 last;
&nbsp;
 location ~ ^/(proxy_play)\.php$ {
 include         /etc/nginx/fastcgi_params;
 fastcgi_param   SCRIPT_FILENAME  $document_root$fastcgi_script_name;
 fastcgi_pass    127.0.0.1:9000;
 }
&nbsp;
 location / {
 index index.php;
 try_files $uri /index.php?$args;
 }
}</pre></div></div>

<p>&nbsp;</p>
<p>Ne reste plus qu&#8217;a rediriger les ports et se connecter sur l&#8217;URL choisie port 8095 (par défaut)</p>
<p>A l&#8217;usage :</p>
<ul>
<li>Plutôt propre</li>
<li>Rapide</li>
<li>Léger</li>
</ul>
<p>Mais</p>
<ul>
<li>Pas très maintenu</li>
<li>Pas ultra sexy</li>
<li>Pb d&#8217;encodage (peut sûrement se résoudre)</li>
<li>Pas d&#8217;album art  (peut sûrement se résoudre)</li>
<li>Listes de lecture capriceuses</li>
</ul>
<p>&nbsp;</p>
<h2>Autres serveurs musicaux (non testés)</h2>
<h3>Ampjuke</h3>
<p><a href="http://www.ampjuke.org/">Ampjuke</a></p>
<p><a href="http://voidandany.free.fr/wp-content/uploads/AmpJuke_0.8.4_welcome.png1.jpeg"><img class="aligncenter size-full wp-image-4310" title="AmpJuke_0.8.4_welcome.png" src="http://voidandany.free.fr/wp-content/uploads/AmpJuke_0.8.4_welcome.png1.jpeg" alt="" width="600" height="468" /></a>Pré-requis matériel au dela des capacités du Dockstar :</p>
<p>&laquo;&nbsp;Access to a Computer w. min. 500MB memory, and a CPU running not less than 800MHz.&nbsp;&raquo;</p>
<ul>
</ul>
<h3>Music Browser</h3>
<p><a href="http://musicbrowser.sourceforge.net/index.php">Music Browser </a></p>
<p>Plus maintenu depuis 2009 et pas dans mes goûts&#8230;</p>
<p><a href="../wp-content/uploads/screenshot.resized.jpg"><img title="screenshot.resized" src="../wp-content/uploads/screenshot.resized.jpg" alt="" width="640" height="335" /></a></p>
<ul>
</ul>
<h3>Jinzora</h3>
<p><a href="http://en.jinzora.com/">Jinzora &#8211; Jinzora :: Free Your Media!</a></p>
<p><a href="../wp-content/uploads/slick_artists_screenshotlarge.resized.jpg"><img title="slick_artists_screenshotlarge.resized" src="../wp-content/uploads/slick_artists_screenshotlarge.resized.jpg" alt="" width="598" height="480" /></a></p>
<ul>
</ul>
<h3>GNUMP3d</h3>
<p><a href="http://www.gnu.org/software/gnump3d/">GNUMP3d [GNU MP3/Media Streamer]</a></p>
<p>Plus maintenu depuis 2007&#8230;</p>
<h3>Tunez</h3>
<p><a href="http://tunez.sourceforge.net/">Tunez</a></p>
<p>Plus maintenu depuis 2004 (qui dit mieux)</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><span style="text-decoration: underline;"><em><strong>Sources :</strong></em></span></p>
<p><a rel="bookmark" href="http://blog.sleeplessbeastie.eu/156">Web based media manager</a></p>
<p><a href="http://forums.fedora-fr.org/viewtopic.php?id=24229">ampache &#8211; jinzora &#8211; subsonic &#8211; mp3act &#8211; netjuke etc&#8230;.</a></p>
<p><a href="http://forum.ubuntu-fr.org/viewtopic.php?pid=3961864">Retour d&#8217;experience sur streaming souhaité (Ampache, Jinzora,&#8230;)</a></p>
<p><a href="http://1000umbrellas.com/2011/01/08/my-favorite-ubuntu-linux-music-server">My Favorite Ubuntu Linux Music Server &#8211; 1000umbrellas.com</a></p>
<p>Zeya :</p>
<ul>
<li><a href="http://web.psung.name/zeya/">Zeya: bring your music anywhere</a></li>
<li><a href="http://psung.blogspot.com/2009/07/zeya-bring-your-music-anywhere.html">Zeya: bring your music anywhere &#8212; I Still Know What You Learned Last Summer</a></li>
<li> <a href="http://ubuntuguide.net/zeya-bring-your-music-anywhere-with-a-web-browser">Zeya-bring your music anywhere with a web browser</a></li>
</ul>
<p>Subsonic :</p>
<ul>
<li><a href="http://www.subsonic.org/pages/index.jsp">Subsonic » Free Music Streamer</a></li>
<li><a href="http://www.gizeek.com/2010/06/24/subsonic-votre-musique-partout/">[Tuto]Subsonic: Votre musique, partout. | Gizeek</a></li>
<li><a title="Permanent Link to Install Subsonic on Ubuntu Server" rel="bookmark" href="http://blog.lundscape.com/2009/05/install-subsonic-on-ubuntu-server/">Install Subsonic on Ubuntu Server</a> : installation du WAR sur Tomcat</li>
</ul>
<p>Ampache :</p>
<ul>
<li><a href="http://ampache.org/">Ampache</a></li>
<li><a rel="bookmark" href="http://blog.sleeplessbeastie.eu/165">Web based media manager that suits me best – Ampache</a></li>
<li><a rel="bookmark" href="http://blog.sleeplessbeastie.eu/181">Viridian – python based front-end for an Ampache</a></li>
<li><a href="http://mementolinux.wordpress.com/2010/02/04/ecouter-sa-musique-depuis-un-serveur-distant-grace-a-mpd-et-ampache/">Ecouter sa musique depuis un serveur distant grâce à MPD et AMPACHE</a></li>
<li><a href="http://www.think-underground.com/post/2008/07/08/Ampache-et-votre-collection-de-musique-vous-suit-partout">Ampache&#8230; et votre collection de musique vous suit partout</a></li>
</ul>
<ul>
</ul>
<p>Zina :</p>
<ul>
<li><a href="http://www.linux.com/archive/feed/153895">Managing your MP3s with Zina</a></li>
<li><a href="http://www.pancake.org/zina">Zina</a></li>
</ul>
<p>Blofeld</p>
<ul>
<li><a href="http://github.com/daveisadork/Blofeld">Blofeld</a></li>
<li><a title="Permanent Link to Introducing Blofeld" rel="bookmark" href="http://www.davehayes.org/2010/07/22/introducing-blofeld">Introducing Blofeld</a></li>
</ul>
<p>Streeme :</p>
<ul>
<li><a title="Permanent Link to Streeme on debian with nginx / php-fpm" rel="bookmark" href="http://www.cybermilitia.net/2013/03/21/streeme-on-debian-with-nginx-php-fpm/">Streeme on debian with nginx / php-fpm</a></li>
</ul>
<p>Solutions à base de MPD + IceCast</p>
<ul>
<li><a href="http://www.finiderire.com/post/2010/04/27/MPD-%3A-le-stream-%C3%A9tait-presque-parfait">MPD : le stream était presque parfait</a></li>
<li><a href="http://forum.ubuntu-fr.org/viewtopic.php?id=382213">MPD &amp; Icecast2 (Page 1) / Serveurs / Forum Ubuntu-fr.org</a></li>
<li><a href="http://news.softpedia.com/news/Streaming-Audio-Using-MPD-and-Icecast-52181.shtml">Streaming Audio Using MPD and Icecast &#8211; Softpedia</a></li>
<li><a href="http://fluoblog.wordpress.com/2008/11/10/mpd-icecast/">Faites de la radio avec MPD et IceCast2 « ((fluoblog))</a></li>
<li><a rel="bookmark" href="http://peterebbelink.wordpress.com/2009/02/18/icecast-streaming-server-operational/">IceCast streaming server operational</a></li>
<li><a title="Webradio : MPD + Icecast2 + Pitchfork" href="http://pasfaciletouslesjours.org/2008/01/webradio-mpd-icecast2-pitchfork/">Webradio : MPD + Icecast2 + Pitchfork</a></li>
<li><a title="Music 2.0: Pitchfork" rel="bookmark" href="http://blog.snyke.net/2007/05/10/music-20-pitchfork/">Music 2.0: Pitchfork</a></li>
</ul>
<div id="_mcePaste" class="mcePaste" style="position: absolute; left: -10000px; top: 21753px; width: 1px; height: 1px; overflow: hidden;"><a href="http://sebsauvage.net/wiki/doku.php?id=php:shaarli">sur mon wiki</a>.</div>
]]></content:encoded>
			<wfw:commentRss>http://voidandany.free.fr/index.php/ecouter-sa-musique-partout-sans-google-music-ampache-subsonic-et-co/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>Affichage d&#8217;un répertoire réseau contenant des pdf très (très) lent sous Ubuntu 11.04</title>
		<link>http://voidandany.free.fr/index.php/affichage-dun-repertoire-reseau-contenant-des-pdf-tres-tres-lent-sous-ubuntu-11-04/</link>
		<comments>http://voidandany.free.fr/index.php/affichage-dun-repertoire-reseau-contenant-des-pdf-tres-tres-lent-sous-ubuntu-11-04/#comments</comments>
		<pubDate>Tue, 13 Sep 2011 20:24:09 +0000</pubDate>
		<dc:creator>voidAndAny</dc:creator>
				<category><![CDATA[software]]></category>
		<category><![CDATA[natty]]></category>
		<category><![CDATA[pdf]]></category>

		<guid isPermaLink="false">http://voidandany.free.fr/?p=4278</guid>
		<description><![CDATA[Si vous êtes sous Ubuntu 11.04 et que vous naviguez dans un répertoire réseau (Répertoire distant accédé par NFS dons mon cas) contenant des fichiers PDF il va falloir prendre votre mal en patience. En effet Nautilus essai de faire &#8230; <a href="http://voidandany.free.fr/index.php/affichage-dun-repertoire-reseau-contenant-des-pdf-tres-tres-lent-sous-ubuntu-11-04/">Continuer la lecture <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Si vous êtes sous <strong>Ubuntu 11.04</strong> et que vous naviguez dans un <strong>répertoire réseau</strong> (Répertoire distant accédé par NFS dons mon cas) contenant des <strong>fichiers PDF</strong> il va falloir prendre votre mal en patience.</p>
<p>En effet Nautilus essai de faire un aperçu des fichiers PDF et c&#8217;est <strong>très long</strong>, voir cela le plante&#8230;.</p>
<p>Pour y remédier 2 solutions :</p>
<h2>Solution 1 : désactiver l&#8217;aperçu des fichiers pdf</h2>
<p>Lancer l&#8217;éditeur de configuration via la commande gconf-editor, dérouler l&#8217;arborescence desktop &gt; gnome &gt; thumbnailers &gt; application@pdf et décocher &laquo;&nbsp;enabled&nbsp;&raquo;<a href="http://voidandany.free.fr/wp-content/uploads/Sources-de-logiciels_037.png"><br />
 </a></p>
<h2>Solution 2 : Appliquer le correctif depuis les dépôts natty-proposed</h2>
<p>Ce problème est un bug connu <a href="https://bugs.launchpad.net/ubuntu/+source/evince/+bug/778638">#778638</a>, un correctif existe donc mais pas dans les dépôts &laquo;&nbsp;de base&nbsp;&raquo;</p>
<p>Activer si e n&#8217;est déjà fait les dépôts natty-proposed.</p>
<p>Pour cela lancer la logithèque Ubuntu puis dans le menu Edition sélectionner &laquo;&nbsp;Source des logiciels&nbsp;&raquo;.</p>
<p>Aller donc l&#8217;onglet &laquo;&nbsp;Mise à jour&nbsp;&raquo; et côcher &laquo;&nbsp;Mises à jour suggérés (natty-proposed)&nbsp;&raquo;</p>
<p><a href="../wp-content/uploads/Sources-de-logiciels_037.png"><img title="Sources de logiciels_037" src="../wp-content/uploads/Sources-de-logiciels_037.png" alt="" width="604" height="507" /></a></p>
<p>Fermer la fenêtre, ouvrir un terminal et saisir :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">aptitude</span> update 
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">aptitude</span> <span style="color: #c20cb9; font-weight: bold;">install</span> evince<span style="color: #000000; font-weight: bold;">/</span>natty-proposed evince-common<span style="color: #000000; font-weight: bold;">/</span>natty-proposed</pre></div></div>

<p lang="bash">Vous pouvez ensuite si vous le voulez désactiver le dépôt natty-proposed et refaire un update&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://voidandany.free.fr/index.php/affichage-dun-repertoire-reseau-contenant-des-pdf-tres-tres-lent-sous-ubuntu-11-04/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ajouter le support MySQL à php</title>
		<link>http://voidandany.free.fr/index.php/ajouter-le-support-mysql-a-php/</link>
		<comments>http://voidandany.free.fr/index.php/ajouter-le-support-mysql-a-php/#comments</comments>
		<pubDate>Mon, 12 Sep 2011 19:47:37 +0000</pubDate>
		<dc:creator>voidAndAny</dc:creator>
				<category><![CDATA[Brèves]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[dockstar]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://voidandany.free.fr/?p=4245</guid>
		<description><![CDATA[Lors de l&#8217;installation d&#8217;un script php qui utilise MySQL, le setup du script m&#8217;indiquait que je n&#8217;avais pas MySQL d&#8217;installé alors qu&#8217;il était bien présent sur ma machine. A l&#8217;image de ce que j&#8217;ai fait pour ajouter le support de &#8230; <a href="http://voidandany.free.fr/index.php/ajouter-le-support-mysql-a-php/">Continuer la lecture <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Lors de l&#8217;installation d&#8217;un script php qui utilise MySQL, le setup du script m&#8217;indiquait que je n&#8217;avais pas MySQL d&#8217;installé alors qu&#8217;il était bien présent sur ma machine.</p>
<p>A l&#8217;image de ce que j&#8217;ai fait pour <a href="http://voidandany.free.fr/index.php/ajouter-le-support-sqlite-a-php/">ajouter le support de SQLite à php</a> j&#8217;ai fait la même chose pour MySQL et le problème à été résolu.</p>
<p>Voici donc la manipulation.</p>
<p>Editer /etc/php5/cgi/php.ini (le chemin peut changer selon votre distribution, ici il s&#8217;agit de Debian) et y ajouter la ligne suivante dans la section &laquo;&nbsp;Dynamic Extensions&nbsp;&raquo;</p>
<p>
<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">extension=mysql.so</pre></div></div>

</p>
<p>Redémarrez php (si vous l’exécutez en fcgi) et voila le tour est joué</p>
<p><strong>Rque </strong>: afin de faire un copie d&#8217;écran du setup de mon script php pour illustrer cet article j&#8217;ai supprimé la dite ligne de mon php.ini et là bizarrerie de l&#8217;informatique, MySQL était tout de même détecté&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://voidandany.free.fr/index.php/ajouter-le-support-mysql-a-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Erreur lors de l&#8217;installation de MySQL sur Debian</title>
		<link>http://voidandany.free.fr/index.php/erreur-lors-de-linstallation-de-mysql-sur-debian/</link>
		<comments>http://voidandany.free.fr/index.php/erreur-lors-de-linstallation-de-mysql-sur-debian/#comments</comments>
		<pubDate>Wed, 07 Sep 2011 16:55:58 +0000</pubDate>
		<dc:creator>voidAndAny</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[Non classé]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[dockstar]]></category>
		<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://voidandany.free.fr/?p=4243</guid>
		<description><![CDATA[En fin de compte j&#8217;ai changé d&#8217;avis pour mon Dockstar et j&#8217;y ai installé MySQL, en effet la plupart des sites/scripts on en pré-requis MySQL. Or quand j&#8217;ai réinstallé MySQL : sudo aptitude install mysql-server mysql-client J&#8217;ai eu les erreurs suivantes &#8230; <a href="http://voidandany.free.fr/index.php/erreur-lors-de-linstallation-de-mysql-sur-debian/">Continuer la lecture <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>En fin de compte j&#8217;ai changé d&#8217;avis pour mon <a title="Marques-pages : Un mini serveur le Seagate Dockstar" href="http://voidandany.free.fr/index.php/marques-pages-un-mini-serveur-le-seagate-dockstar/">Dockstar</a> et j&#8217;y ai <a title="Installer et configurer Mysql sur le Dockstar" href="http://voidandany.free.fr/index.php/installer-et-configurer-mysql-sur-le-dockstar/">installé MySQL</a>, en effet la plupart des sites/scripts on en pré-requis MySQL.</p>
<p>Or quand j&#8217;ai réinstallé MySQL :</p>

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

<p>J&#8217;ai eu les erreurs suivantes :</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">Les paquets partiellement installés suivants seront configurés : 
 mysql-server mysql-server-5.1 
 Aucun paquet ne va être installé, mis à jour ou enlevé.
 0 paquets mis à jour, 0 nouvellement installés, 0 à enlever et 0 non mis à jour.
 Il est nécessaire de télécharger 0 o d'archives. Après dépaquetage, 0 o seront utilisés.
 Paramétrage de mysql-server-5.1 (5.1.49-3) ...
 Stopping MySQL database server: mysqld.
 /etc/init.d/mysql: WARNING: /etc/mysql/my.cnf cannot be read. See README.Debian.gz ... (warning).
 Starting MySQL database server: mysqld.
 /etc/init.d/mysql: line 120: /etc/mysql/debian-start: Aucun fichier ou dossier de ce type
 invoke-rc.d: initscript mysql, action &quot;start&quot; failed.
 dpkg : erreur de traitement de mysql-server-5.1 (--configure) :
 le sous-processus script post-installation installé a retourné une erreur de sortie d'état 127
 configured to not write apport reports
 dpkg : des problèmes de dépendances empêchent la configuration de mysql-server :
 mysql-server dépend de mysql-server-5.1 ; cependant :
 Le paquet mysql-server-5.1 n'est pas encore configuré.
 dpkg : erreur de traitement de mysql-server (--configure) :
 problèmes de dépendances - laissé non configuré
 configured to not write apport reports
 Des erreurs ont été rencontrées pendant l'exécution :
 mysql-server-5.1
 mysql-server
 E: Sub-process /usr/bin/dpkg returned an error code (1)
 Échec de l'installation d'un paquet. Tentative de réparation : 
 Paramétrage de mysql-server-5.1 (5.1.49-3) ...
 Stopping MySQL database server: mysqld.
 /etc/init.d/mysql: WARNING: /etc/mysql/my.cnf cannot be read. See README.Debian.gz ... (warning).
 Starting MySQL database server: mysqld.
 /etc/init.d/mysql: line 120: /etc/mysql/debian-start: Aucun fichier ou dossier de ce type
 invoke-rc.d: initscript mysql, action &quot;start&quot; failed.
 dpkg : erreur de traitement de mysql-server-5.1 (--configure) :
 le sous-processus script post-installation installé a retourné une erreur de sortie d'état 127
 dpkg : des problèmes de dépendances empêchent la configuration de mysql-server :
 mysql-server dépend de mysql-server-5.1 ; cependant :
 Le paquet mysql-server-5.1 n'est pas encore configuré.
 dpkg : erreur de traitement de mysql-server (--configure) :
 problèmes de dépendances - laissé non configuré
 Des erreurs ont été rencontrées pendant l'exécution :
 mysql-server-5.1
 mysql-server</pre></div></div>

<p>Voici la solution que j&#8217;ai trouvé sur <a href="http://ubuntuforums.org/showthread.php?t=814782">[ubuntu] mysql problem &#8211; Ubuntu Forums</a> :</p>
<p>Créer un fichier /etc/mysql/debian-start (avec sudo) et y copier ceci :</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;">#</span>
 <span style="color: #666666; font-style: italic;"># This script is executed by &quot;/etc/init.d/mysql&quot; on every (re)start.</span>
 <span style="color: #666666; font-style: italic;">#</span>
 <span style="color: #666666; font-style: italic;"># Changes to this file will be preserved when updating the Debian package.</span>
 <span style="color: #666666; font-style: italic;">#</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">source</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>mysql<span style="color: #000000; font-weight: bold;">/</span>debian-start.inc.sh
&nbsp;
<span style="color: #007800;">MYSQL</span>=<span style="color: #ff0000;">&quot;/usr/bin/mysql --defaults-file=/etc/mysql/debian.cnf&quot;</span>
 <span style="color: #007800;">MYADMIN</span>=<span style="color: #ff0000;">&quot;/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf&quot;</span>
 <span style="color: #007800;">MYUPGRADE</span>=<span style="color: #ff0000;">&quot;/usr/bin/mysql_upgrade --defaults-extra-file=/etc/mysql/debian.cnf&quot;</span>
 <span style="color: #007800;">MYCHECK</span>=<span style="color: #ff0000;">&quot;/usr/bin/mysqlcheck --defaults-file=/etc/mysql/debian.cnf&quot;</span>
 <span style="color: #007800;">MYCHECK_SUBJECT</span>=<span style="color: #ff0000;">&quot;WARNING: mysqlcheck has found corrupt tables&quot;</span>
 <span style="color: #007800;">MYCHECK_PARAMS</span>=<span style="color: #ff0000;">&quot;--all-databases --fast --silent&quot;</span>
 <span style="color: #007800;">MYCHECK_RCPT</span>=<span style="color: #ff0000;">&quot;root&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># The following commands should be run when the server is up but in background</span>
 <span style="color: #666666; font-style: italic;"># where they do not block the server start and in one shell instance so that</span>
 <span style="color: #666666; font-style: italic;"># they run sequentially. They are supposed not to echo anything to stdout.</span>
 <span style="color: #666666; font-style: italic;"># If you want to disable the check for crashed tables comment</span>
 <span style="color: #666666; font-style: italic;"># &quot;check_for_crashed_tables&quot; out.</span>
 <span style="color: #666666; font-style: italic;"># (There may be no output to stdout inside the background process!)</span>
 <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Checking for corrupt, not cleanly closed and upgrade needing tables.&quot;</span>
 <span style="color: #7a0874; font-weight: bold;">&#40;</span>
 upgrade_system_tables_if_necessary;
 check_root_accounts;
 check_for_crashed_tables;
 <span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #000000; font-weight: bold;">&gt;&amp;</span><span style="color: #000000;">2</span> <span style="color: #000000; font-weight: bold;">&amp;</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">0</span></pre></div></div>

<p>Rendre le fichier exécutable :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #000000;">755</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>mysql<span style="color: #000000; font-weight: bold;">/</span>debian-start</pre></div></div>

<p>Et reprendre l’installation (un dpkg reconfigure aurait sûrement aussi fait l&#8217;affaire):</p>

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

<p>Normalement il n&#8217;y a plus d&#8217;erreurs:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">Les paquets partiellement installés suivants seront configurés :
 mysql-server mysql-server-5.1
 Aucun paquet ne va être installé, mis à jour ou enlevé.
 0 paquets mis à jour, 0 nouvellement installés, 0 à enlever et 0 non mis à jour.
 Il est nécessaire de télécharger 0 o d'archives. Après dépaquetage, 0 o seront utilisés.
 Paramétrage de mysql-server-5.1 (5.1.49-3) ...
 Stopping MySQL database server: mysqld.
 Starting MySQL database server: mysqld.
 Checking for corrupt, not cleanly closed and upgrade needing tables..
 Paramétrage de mysql-server (5.1.49-3) ...</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://voidandany.free.fr/index.php/erreur-lors-de-linstallation-de-mysql-sur-debian/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installation d&#8217;un dépôt de fichier : Jyraphe (recalé)</title>
		<link>http://voidandany.free.fr/index.php/installation-dun-depot-de-fichier-jyraphe-recale/</link>
		<comments>http://voidandany.free.fr/index.php/installation-dun-depot-de-fichier-jyraphe-recale/#comments</comments>
		<pubDate>Tue, 06 Sep 2011 19:44:55 +0000</pubDate>
		<dc:creator>voidAndAny</dc:creator>
				<category><![CDATA[site web]]></category>
		<category><![CDATA[dockstar]]></category>
		<category><![CDATA[nginx]]></category>

		<guid isPermaLink="false">http://voidandany.free.fr/?p=4249</guid>
		<description><![CDATA[J&#8217;ai enfin eu le courage d&#8217;écrire un nouvel article, ce n&#8217;est pas l&#8217;inspiration ou les sujets qui manquent mais l&#8217;envie d&#8217;écrire de décrire&#8230;. Sur mon Dockstar je souhaite avoir un dépôt de fichier, un endroit ou je (ou des personnes &#8230; <a href="http://voidandany.free.fr/index.php/installation-dun-depot-de-fichier-jyraphe-recale/">Continuer la lecture <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>J&#8217;ai enfin eu le courage d&#8217;écrire un nouvel article, ce n&#8217;est pas l&#8217;inspiration ou les sujets qui manquent mais l&#8217;envie d&#8217;écrire de décrire&#8230;.</p>
<p>Sur mon Dockstar je souhaite avoir un <strong>dépôt de fichier</strong>, un endroit ou je (ou des personnes de confiance) puisse facilement uploader des fichiers et avoir un lien vers ce fichier.</p>
<p>Premier logiciel testé<em><em> </em></em><a href="http://home.gna.org/jyraphe/"><em><em>Jyraphe.</em></em></a></p>
<p>Pour casser le suspense je tiens à préciser tout de suite que ce dernier ne répond à mes attentes<em><em><br />
 </em></em></p>
<h3>Installation</h3>
<p>On télécharge et décompresse les sources :</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.gna.org<span style="color: #000000; font-weight: bold;">/</span>jyraphe<span style="color: #000000; font-weight: bold;">/</span>jyraphe-<span style="color: #000000;">0.5</span>.tar.gz
<span style="color: #c20cb9; font-weight: bold;">tar</span> <span style="color: #660033;">-xvf</span> jyraphe-<span style="color: #000000;">0.5</span>.tar.gz</pre></div></div>

<p>&nbsp;</p>
<p>Puis on installe le package <a href="http://www.gnu.org/s/gettext/"><em><em>gettext</em></em></a>, en effet jyraphe est livré avec les traductions Française mais il faut les &laquo;&nbsp;compiler&nbsp;&raquo; pour qu&#8217;elles soient accessibles :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">aptitude</span> <span style="color: #c20cb9; font-weight: bold;">install</span> <span style="color: #c20cb9; font-weight: bold;">gettext</span>
<span style="color: #7a0874; font-weight: bold;">cd</span> jyraphe
.<span style="color: #000000; font-weight: bold;">/</span>update-po.sh
.<span style="color: #000000; font-weight: bold;">/</span>update-mo.sh</pre></div></div>

<p>Cela créé le fichier Jyraphe.mo contenant la traduction Française de Jyraphe dans le sous-répertoire lib/locale/fr_FR.UTF-8/LC_MESSAGES/</p>
<p>&nbsp;</p>
<p>On déplace les scripts php vers son arborescence Web (à adapter)</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">mv</span> pub <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>jyraphe
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">chown</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>jyraphe <span style="color: #660033;">-R</span></pre></div></div>

<p>&nbsp;</p>
<p>Pour que le site soit accessible il se peut qu&#8217;il faille que vous configuriez votre serveur web, je ne décrirais pas ici cette étape&#8230;.</p>
<p>Puis on lance l&#8217;installeur :</p>
<pre>http://votre-domaine/jyraphe/install.php</pre>
<p><a href="http://voidandany.free.fr/wp-content/uploads/Sélection_036.png"><img class="aligncenter size-full wp-image-4250" title="Sélection_036" src="http://voidandany.free.fr/wp-content/uploads/Sélection_036.png" alt="" width="640" height="292" /></a>On choisi la langue, si l&#8217;interface n&#8217;est pas en Français quelque chose à dû mal se passer avec les scripts update-po/mo</p>
<p>&nbsp;</p>
<p><a href="http://voidandany.free.fr/wp-content/uploads/Sélection_037.png"><img class="aligncenter size-full wp-image-4251" title="Sélection_037" src="http://voidandany.free.fr/wp-content/uploads/Sélection_037.png" alt="" width="640" height="376" /></a>Jyraphe stockera les fichiers uploadé dans un sous-répertoire de sa racine web dans un répertoire var-xxxx où xxxx est généré aléatoirement</p>
<p>&nbsp;</p>
<p><a href="http://voidandany.free.fr/wp-content/uploads/Sélection_038.png"><img class="aligncenter size-full wp-image-4252" title="Sélection_038" src="http://voidandany.free.fr/wp-content/uploads/Sélection_038.png" alt="" width="640" height="368" /></a>Et voila c&#8217;est presque fini, il ne reste plus qu&#8217;a supprimer le script d’installation :</p>
<p>&nbsp;</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">rm</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>jyraphe<span style="color: #000000; font-weight: bold;">/</span>install.php</pre></div></div>

<p>&nbsp;</p>
<p>Jyraphe est prêt à l&#8217;emploi :</p>
<p><a href="http://voidandany.free.fr/wp-content/uploads/Sélection_039.resized.png"><img class="aligncenter size-full wp-image-4253" title="Sélection_039.resized" src="http://voidandany.free.fr/wp-content/uploads/Sélection_039.resized.png" alt="" width="640" height="299" /></a></p>
<p>Donc voici ma conclusion, <strong>j&#8217;ai aimé</strong>, la protection par mot de passe du téléchargement de fichier, la durée limitée de téléchargement (pas testé)</p>
<p>Mais voici les <strong>défauts </strong>rédhibitoires pour moi :</p>
<p><del>Il n&#8217;est pas possible de protéger l&#8217;upload de fichier, il n&#8217;y a pas d&#8217;authentification, n&#8217;importe qui peut uploader des fichier sur votre serveur (plutôt risqué).</del></p>
<p><del>J&#8217;ai bien pensé mettre <a title="Restreindre l’accès d’un site, d’un répertoire avec Nginx" href="http://voidandany.free.fr/index.php/restreindre-lacces-dun-site-dun-repertoire-avec-nginx/">un accès protégé par mot de passe</a> (équivalent du .htaccess pour apache) mais dès lors le téléchargement serait protégé par ce même mot de passe.</del></p>
<p>En fait si, voir Edit ci-dessous</p>
<p>&nbsp;</p>
<p>Enfin il n&#8217;y a pas d’administration pour purger les fichiers (pour cela il faut supprimer fichiers dans var-xxx/files et var-xxx/links) et lister les fichiers disponibles</p>
<p>&nbsp;</p>
<p>J&#8217;ai plus qu&#8217;à trouver un autre logiciel&#8230;</p>
<p>&nbsp;</p>
<p><span style="text-decoration: underline;"><strong>Edit :</strong></span></p>
<p>Le commentaire de <a rel="external nofollow" href="http://blog.tomamplius.net/">tomamplius</a> a piqué ma curiosité et j&#8217;ai voulu tester si sous NGINX il était possible de protéger spécifiquement un fichier, en l’occurrence le index.php pour empêcher l&#8217;ouverture à tous le monde de l&#8217;upload.</p>
<p>Et après pas mal d&#8217;essai voici ma configuration :</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">location /jyraphe {
        location ^~ /jyraphe/index.php {
		auth_basic            &quot;Section privee&quot;;
		auth_basic_user_file  $document_root/jyraphe/.htpasswd;
		include         /etc/nginx/fastcgi_params;
		fastcgi_param   SCRIPT_FILENAME  $document_root$fastcgi_script_name;
		fastcgi_pass    127.0.0.1:9000;
	}
	location ~ \.php$ {
		include         /etc/nginx/fastcgi_params;
		fastcgi_param   SCRIPT_FILENAME  $document_root$fastcgi_script_name;
		fastcgi_pass    127.0.0.1:9000;
	}
}</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://voidandany.free.fr/index.php/installation-dun-depot-de-fichier-jyraphe-recale/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Revenir à Firefox 4.0.1 (Windows)</title>
		<link>http://voidandany.free.fr/index.php/revenir-a-firefox-4-0-1-windows/</link>
		<comments>http://voidandany.free.fr/index.php/revenir-a-firefox-4-0-1-windows/#comments</comments>
		<pubDate>Fri, 24 Jun 2011 09:00:46 +0000</pubDate>
		<dc:creator>voidAndAny</dc:creator>
				<category><![CDATA[Brèves]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[firefox]]></category>

		<guid isPermaLink="false">http://voidandany.free.fr/?p=4201</guid>
		<description><![CDATA[Firefox 5.0 est sorti cette semaine, bien que n&#8217;apportant aucune révolution j&#8217;ai voulu l&#8217;installer sur mon poste de travail sous Windows XP. L&#8217;installation s&#8217;est déroulé sans problème mais au démarrage j&#8217;ai eu cette erreur : Echofon (extension twitter) n&#8217;arrive pas &#8230; <a href="http://voidandany.free.fr/index.php/revenir-a-firefox-4-0-1-windows/">Continuer la lecture <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><strong>Firefox 5.0</strong> est sorti cette semaine, bien que n&#8217;apportant aucune révolution j&#8217;ai voulu l&#8217;installer sur mon poste de travail sous Windows XP.</p>
<p>L&#8217;installation s&#8217;est déroulé sans problème mais au démarrage j&#8217;ai eu cette erreur :</p>
<p><a href="http://voidandany.free.fr/wp-content/uploads/2011-06-24_105204.png"><img class="aligncenter size-full wp-image-4202" title="Erreur echofon 2.0.8" src="http://voidandany.free.fr/wp-content/uploads/2011-06-24_105204.png" alt="" width="562" height="126" /></a></p>
<p>Echofon (extension twitter) n&#8217;arrive pas à se connecter, ce qui est très gênant pour moi, je suis donc <strong>repassé sous Firefox 4.0.1</strong>.</p>
<p>Après quelques recherches sur internet voici le lien pour télécharger l&#8217;installeur qui permet de ré-installer Firefox 4.0.1 en Français : <strong><a href="http://download.mozilla.org/?product=firefox-4.0.1&amp;os=win&amp;lang=fr">Firefox 4.0.1 &#8211; Win &#8211; 32bits</a></strong></p>
<p>&nbsp;</p>
<p><span style="text-decoration: underline;"><em><strong>Source </strong></em></span>: <a href="http://www.n1fo.fr/telechargements/navigateurs-internet/mozilla-firefox/">Mozilla Firefox 5.0</a> : en fin d&#8217;article les liens pour les 3 dernières versions de Firefox 2.0.0.20, 3.6.18 et 4.0.1 pour Windows, Linux et OSX</p>
]]></content:encoded>
			<wfw:commentRss>http://voidandany.free.fr/index.php/revenir-a-firefox-4-0-1-windows/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sécurisation NGINX : mise en oeuvre de connexions https</title>
		<link>http://voidandany.free.fr/index.php/securisation-nginx-mise-en-oeuvre-de-connexions-https/</link>
		<comments>http://voidandany.free.fr/index.php/securisation-nginx-mise-en-oeuvre-de-connexions-https/#comments</comments>
		<pubDate>Wed, 22 Jun 2011 14:53:38 +0000</pubDate>
		<dc:creator>voidAndAny</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[SSL]]></category>

		<guid isPermaLink="false">http://voidandany.free.fr/?p=3678</guid>
		<description><![CDATA[Mon serveur web NGINX ne sert que du contenu privé protégé par mot de passe, mais si l&#8217;accès à ce contenu est protégé, les données qui transitent sur le réseau elles ne le sont pas. Pour cela il faut mettre &#8230; <a href="http://voidandany.free.fr/index.php/securisation-nginx-mise-en-oeuvre-de-connexions-https/">Continuer la lecture <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Mon serveur web NGINX ne sert que du <a title="Restreindre l’accès d’un site, d’un répertoire avec Nginx" href="../index.php/restreindre-lacces-dun-site-dun-repertoire-avec-nginx/">contenu privé protégé par mot de passe</a>, mais si l&#8217;accès à ce contenu est protégé, les données qui transitent sur le réseau elles ne le sont pas.</p>
<p>Pour cela il faut mettre en œuvre un chiffrage via <a href="http://fr.wikipedia.org/wiki/Hypertext_Transfer_Protocol#HTTPS">https</a>.</p>
<p>Https se base sur un <a href="http://fr.wikipedia.org/wiki/Transport_Layer_Security" target="_blank">système de clé de cryptage publique/certificat</a>, il existe plusieurs moyen pour obtenir ces fichiers :</p>
<ul>
<li>Acheter le certificat auprès d&#8217;un organisme reconnu, peut être très cher, exemple : <a href="http://www.thawte.fr/products/index.html">600€ pour 2 ans</a> ou moins cher : <a href="http://www.godaddy.com/ssl/ssl-certificates.aspx?ci=8979">Go Daddy</a>)</li>
<li>Avoir le certificat gratuit avec votre nom de domaine (<a href="http://www.gandi.net/ssl">chez Gandi par exemple pour 1 an</a>)</li>
<li>Avoir un certificat gratuit avec un organisme <a href="http://wiki.cacert.org/InclusionStatus" target="_blank">presque reconnu</a> comme <a href="http://www.cacert.org/" target="_blank">CAcert </a></li>
<li>Générer un certificat (certificat auto-signé)</li>
</ul>
<p>J&#8217;ai personnellement choisi cette dernière solution.</p>
<p>Dans mon article <a title="Lien permanent vers OpenSSL puissance et complexité" rel="bookmark" href="../index.php/openssl-puissance-et-complexite/">OpenSSL puissance et complexité</a>, j&#8217;ai listé/référencé les étapes et commandes openssl disponible pour créer un certificat.</p>
<p>&nbsp;</p>
<p>Voici les sujets abordé par cet article :</p>
<ul>
<li><a href="#para1">Gestion des certificats manuellement</a></li>
<li><a href="#para2">Gestion des certificats avec easyCA</a></li>
<li><a href="#para3">Configuration NGINX</a></li>
<li><a href="#para3">Configuration Firefox</a></li>
</ul>
<p>&nbsp;</p>
<h2><a name="para1"></a>Gestion des certificats manuellement</h2>
<h3>Préparation de l&#8217;environnement</h3>
<p>Je vais créer un répertoire myCa dans le /home de mon utilisateur et y placer tout ce qui sera nécessaire à gérer les certificats</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #660033;">-p</span> myCA<span style="color: #000000; font-weight: bold;">/</span>certs <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #c20cb9; font-weight: bold;">mkdir</span> myCA<span style="color: #000000; font-weight: bold;">/</span>private <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #c20cb9; font-weight: bold;">mkdir</span> myCA<span style="color: #000000; font-weight: bold;">/</span>csr <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #c20cb9; font-weight: bold;">mkdir</span> myCA<span style="color: #000000; font-weight: bold;">/</span>newcerts <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #c20cb9; font-weight: bold;">mkdir</span> myCA<span style="color: #000000; font-weight: bold;">/</span>crl <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #c20cb9; font-weight: bold;">mkdir</span> myCA<span style="color: #000000; font-weight: bold;">/</span>tmp <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #7a0874; font-weight: bold;">cd</span> myCA
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">'01'</span> <span style="color: #000000; font-weight: bold;">&gt;</span> serial  <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #c20cb9; font-weight: bold;">touch</span> index.txt
<span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>ssl<span style="color: #000000; font-weight: bold;">/</span>openssl.cnf .</pre></div></div>

<h3>Configuration d&#8217;openSSL</h3>
<p>On édite ensuite le fichier openssl.cnf copié dans notre répertoire myCA, pour modifier les éléments suivants :</p>
<p>Section [ CA_default ] on paramètre les dossiers, seul la première valeur est à modifier :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">dir</span>        = <span style="color: #000000; font-weight: bold;">&lt;</span>strong<span style="color: #000000; font-weight: bold;">&gt;/</span>home<span style="color: #000000; font-weight: bold;">/</span><span style="color: #7a0874; font-weight: bold;">&#91;</span>utilisateur<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #000000; font-weight: bold;">/</span>myCA<span style="color: #000000; font-weight: bold;">&lt;/</span>strong<span style="color: #000000; font-weight: bold;">&gt;</span>            <span style="color: #666666; font-style: italic;"># Where everything is kept</span>
certs        = <span style="color: #007800;">$dir</span><span style="color: #000000; font-weight: bold;">/</span>certs        <span style="color: #666666; font-style: italic;"># Where the issued certs are kept</span>
crl_dir        = <span style="color: #007800;">$dir</span><span style="color: #000000; font-weight: bold;">/</span>crl        <span style="color: #666666; font-style: italic;"># Where the issued crl are kept</span>
database    = <span style="color: #007800;">$dir</span><span style="color: #000000; font-weight: bold;">/</span>index.txt    <span style="color: #666666; font-style: italic;"># database index file.</span>
new_certs_dir    = <span style="color: #007800;">$dir</span><span style="color: #000000; font-weight: bold;">/</span>newcerts        <span style="color: #666666; font-style: italic;"># default place for new certs.</span>
certificate    = <span style="color: #007800;">$certs</span><span style="color: #000000; font-weight: bold;">/</span>cacert.pem    <span style="color: #666666; font-style: italic;"># The CA certificate</span>
serial        = <span style="color: #007800;">$dir</span><span style="color: #000000; font-weight: bold;">/</span>serial         <span style="color: #666666; font-style: italic;"># The current serial number</span>
crl        = <span style="color: #007800;">$dir</span><span style="color: #000000; font-weight: bold;">/</span>crl.pem         <span style="color: #666666; font-style: italic;"># The current CRL</span>
private_key    = <span style="color: #007800;">$dir</span><span style="color: #000000; font-weight: bold;">/</span>private<span style="color: #000000; font-weight: bold;">/</span>cakey.pem <span style="color: #666666; font-style: italic;"># The private key</span>
RANDFILE    = <span style="color: #007800;">$dir</span><span style="color: #000000; font-weight: bold;">/</span>private<span style="color: #000000; font-weight: bold;">/</span>.rand    <span style="color: #666666; font-style: italic;"># private random number file</span></pre></div></div>

<p>Un peu plus loin dans cette même section, on paramètre la duré de validité par défaut des certificats et le cryptage utilisé :</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">default_days    = 1825            # how long to certify for
default_crl_days= 30            # how long before next CRL
default_md    = sha1            # which md to use.</pre></div></div>

<p>Dans la section [ req_distinguished_name ] j&#8217;ai francisé les libellé et adpater les valeurs par défaut :</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">[ req_distinguished_name ]
 countryName                     = Pays (2 lettres)
 countryName_default             = FR
 countryName_min                 = 2
 countryName_max                 = 2
 stateOrProvinceName             = Region
 stateOrProvinceName_default     = PAYS DE LOIRE
 localityName                    = Ville
 localityName_default            = Nantes
 0.organizationName              = Societe
 0.organizationName_default      = VoidAndAny
 #organizationalUnitName         = Organizational Unit Name (eg, section)
 #organizationalUnitName_default =
 commonName                      = Site
 commonName_max                  = 64
 emailAddress                    = Email
 emailAddress_max                = 64
 emailAddress_default            = mon_email@free.fr</pre></div></div>

<p>Dès lors les questions sont les suivantes et il suffit de les valider par entrée pour avoir les valeurs par défaut (optionnel) :</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">Pays (2 lettres) [FR]:
Region [PAYS DE LOIRE]:
Ville [Nantes]:
Societe [VoidAndAny]:
Site []: mon_domaine.fr
Email [mon_email@free.fr]:</pre></div></div>

<p>Dans la section [ usr_cert ] j&#8217;ai modifié les commentaire qui seront embarqués dans les certificats :</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">nsComment            = &quot;Void And Any Generated Certificate&quot;</pre></div></div>

<h3>Création de l&#8217;autorité de certification</h3>
<p>On va tout d&#8217;abord créer notre autorité de certification qui permettra de signer les certificats serveurs suivant.</p>
<p>Cela se fait avec la commande (se placer dans le répertoire myCA) :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">openssl req <span style="color: #660033;">-new</span> <span style="color: #660033;">-x509</span> <span style="color: #660033;">-config</span> .<span style="color: #000000; font-weight: bold;">/</span>openssl.cnf <span style="color: #660033;">-keyout</span> .<span style="color: #000000; font-weight: bold;">/</span>private<span style="color: #000000; font-weight: bold;">/</span>cakey.pem <span style="color: #660033;">-out</span> .<span style="color: #000000; font-weight: bold;">/</span>certs<span style="color: #000000; font-weight: bold;">/</span>cacert.pem <span style="color: #660033;">-days</span> <span style="color: #000000;">1825</span></pre></div></div>

<p>Lors de la génération du certificat un mot de passe vous est demandé, en choisir un robuste et ne pas l&#8217;oublier sous peine de ne plus pouvoir vous servir de votre autorisé de certification.</p>
<h3>Création du/des certificats</h3>
<p>En 2 temps, création de la clé et de la demande de certificat :</p>

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

<p>L’option -nodes permet d’indiquer que la clé qui doit être générée ne doit pas être protégée par un mot de passe (passphrase)</p>
<p>&nbsp;</p>
<p>La commande vous poseras quelques questions :</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">Generating a 2048 bit RSA private key
 .............+++
 ............................+++
 writing new private key to '/etc/nginx/certificates/test.key'
 -----
 You are about to be asked to enter information that will be incorporated
 into your certificate request.
 What you are about to enter is what is called a Distinguished Name or a DN.
 There are quite a few fields but you can leave some blank
 For some fields there will be a default value,
 If you enter '.', the field will be left blank.
 -----
 Country Name (2 letter code) [AU]:FR
 State or Province Name (full name) [Some-State]:PAYS DE LOIRE
 Locality Name (eg, city) []:Nantes
 Organization Name (eg, company) [Internet Widgits Pty Ltd]:VoidAndAny
 Organizational Unit Name (eg, section) []:
 Common Name (eg, YOUR name) []:mon_domaine.fr
 Email Address []:mon_email@free.fr</pre></div></div>

<p>La zone la plus importante est &laquo;&nbsp;Common name&nbsp;&raquo; qui doit correspondre au nom du domaine/sous-domaine que vous voulez protéger.</p>
<p>&nbsp;</p>
<p>Création du certificat à partir de la demande de certificat et signature de ce dernier avec notre autorité de certification :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">openssl ca <span style="color: #660033;">-infiles</span> .<span style="color: #000000; font-weight: bold;">/</span>csr<span style="color: #000000; font-weight: bold;">/</span>mondomaine.csr <span style="color: #660033;">-out</span> .<span style="color: #000000; font-weight: bold;">/</span>certs<span style="color: #000000; font-weight: bold;">/</span>mondomaine.crt <span style="color: #660033;">-config</span> .<span style="color: #000000; font-weight: bold;">/</span>openssl.cnf</pre></div></div>

<p>Les certificat et sa clé sont alors respectivement dans les sous-répertoires certs et private.</p>
<p>&nbsp;</p>
<p>Voila pour la création manuelle voici comment automatiser tout cela et ne pas avoir de ligne de commande à taper.</p>
<p>&nbsp;</p>
<h2><a name="para2"></a>Gestion des certificats avec easyCA</h2>
<p>EasyCA est un script qui n&#8217;est plus maintenu depuis 2005 et que l&#8217;on peut retrouver <a title="esayca" href="http://sourceforge.net/projects/easyca" target="_blank">ICI</a>, personnellement j&#8217;ai utilisé la <a href="http://blog.guiguiabloc.fr/index.php/2008/12/02/pki-pki-oh-pki-pki-ah/">version modifiée de GuiguiAbloc</a> que l&#8217;on trouve <a href="http://guiguiabloc.appspot.com/wp-content/2008/12/easyca.tgz">ICI</a></p>
<p>Je vais comme précédemment faire du répertoire myCA de mon home le lieu de travail. (si vous avez fait des essais manuellement il peut être conseillé de tout supprimer le contenu du dit répertoire ou d&#8217;en utiliser un autre)</p>
<p>Télécharger l&#8217;archive, la décompresser et rendre le script exécutable :</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: #660033;">-p</span> ~<span style="color: #000000; font-weight: bold;">/</span>myCA <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #7a0874; font-weight: bold;">cd</span> ~<span style="color: #000000; font-weight: bold;">/</span>myCA
<span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>guiguiabloc.appspot.com<span style="color: #000000; font-weight: bold;">/</span>wp-content<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">2008</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">12</span><span style="color: #000000; font-weight: bold;">/</span>easyca.tgz
<span style="color: #c20cb9; font-weight: bold;">tar</span> <span style="color: #660033;">-xvf</span> easyca.tgz
<span style="color: #c20cb9; font-weight: bold;">mv</span> easyca<span style="color: #000000; font-weight: bold;">/*</span> .
<span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #000000;">755</span> easyCA.sh</pre></div></div>

<p>Éditer le fichier openssl.cnf fournis, modifier les lignes préalablement décrites et supprimer la ligne :</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># !!!!! remove this line after configuration as it is NOT_CONFIGURED yet !!!</pre></div></div>

<p><strong>Rque </strong>: j&#8217;ai en plus changé les différents paramètres nsComment en fin de fichier.</p>
<p>Lancer le script easyCA.sh, le menu suivant apparaît :</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">=====================================================================
 Certificate Management System
 easyCA version 0.9(6) by Ferry Kemps and Guiguiabloc
 GPL Licensed
 =====================================================================
&nbsp;
 1) Sign a Certificate Signing Request (PKCS#10)
 2) Create a Server Certificate (PEM SelfSigned)
 3) Create a Client Certificate (PKCS#12)
 4) Create a Certificate Signing Request
 5) Generate Certificate Revocation List (CRL)
 6) List, Display and Revoke Certificates
&nbsp;
 I) Initialize Root Certificate Authority (CA)
 O) Initialize OCSP Server Certificate
 B) Backup &amp; Restore the Certificate environment
 R) Reinstall easyCA (erase)
&nbsp;
==&gt; Make your choice [none]:</pre></div></div>

<p>(dans les &laquo;&nbsp;copie d&#8217;écran&nbsp;&raquo; suivante je n&#8217;ai pas personnalisé mon openssl.cnf, d&#8217;où les localité, adresse mail par défaut)</p>
<h3>Création de l&#8217;autorité de certification</h3>
<p>Pour créer l&#8217;autorité de certification il suffit de choisir l&#8217;option I :</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">-----------------------------------------------------------------------
 ----------------- Initialize root Certificate Authority ---------------
 -----------------------------------------------------------------------
&nbsp;
Are you sure you want to (re)initialize the Root CA? [y|n]: y
 &gt;&gt;&gt; Initializing Root CA &lt;&lt;&lt;
 Generating a 1024 bit RSA private key
 ...................++++++
 .............................................++++++
 writing new private key to './private/cakey.pem'
 Enter PEM pass phrase:
 Verifying - Enter PEM pass phrase:
 -----
 You are about to be asked to enter information that will be incorporated
 into your certificate request.
 What you are about to enter is what is called a Distinguished Name or a DN.
 There are quite a few fields but you can leave some blank
 For some fields there will be a default value,
 If you enter '.', the field will be left blank.
 -----
 Country Name (2 letter code) [NL]:
 State or Province Name (full name) [Gelderland]:
 Locality Name (eg, city) [Arnhem]:
 Organization Name (eg, company) [Your Company Name]:
 Organizational Unit Name (eg, section) [HQ]:
 Common Name (eg, your name or your server's hostname) []:
 Email Address [postmaster@domain.ext]:
&nbsp;
Press [enter] to continue</pre></div></div>

<p>Comme dans le paragraphe précédent il faut choisir une passphrase sécurisé et ne pas l&#8217;oublier. Le Common Name n&#8217;a que peut d&#8217;importance ici.</p>
<h3>Création du/des certificats</h3>
<p>Pour générer un certificat serveur, il faut procéder en 2 temps, la demande de certificat, option 4 du menu :</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">-----------------------------------------------------------------------
 --------------- Generate Certificate Signing Request ------------------
 -----------------------------------------------------------------------
&nbsp;
Enter Certificate CN (Common name|FQDN) like www.example.com [none]: mondomaine
 Generating a 1024 bit RSA private key
 ..................++++++
 .......++++++
 writing new private key to './private/mondomaine-key.pem'
 -----
 You are about to be asked to enter information that will be incorporated
 into your certificate request.
 What you are about to enter is what is called a Distinguished Name or a DN.
 There are quite a few fields but you can leave some blank
 For some fields there will be a default value,
 If you enter '.', the field will be left blank.
 -----
 Country Name (2 letter code) [NL]:
 State or Province Name (full name) [Gelderland]:
 Locality Name (eg, city) [Arnhem]:
 Organization Name (eg, company) [Your Company Name]:
 Organizational Unit Name (eg, section) [HQ]:
 Common Name (eg, your name or your server's hostname) []:mondomaine.fr
 Email Address [postmaster@domain.ext]:
&nbsp;
Please enter the following 'extra' attributes
 to be sent with your certificate request
 A challenge password []:
 An optional company name []:
&nbsp;
Certificate Signing Request (CSR) stored as: ./csr/mondomaine.csr
 Certificate private-key stored as: ./private/mondomaine-key.pem
 Press [enter] to continue</pre></div></div>

<p>La première question (Enter Certificate CN (Common name|FQDN) like www.example.com [none]:) ne sert pas à alimenter le common name du certificat mais a déterminer le nom des fichier certificat et clé.</p>
<p>A la question common name, il faut ici indiquer le domaine sur lequel s&#8217;appliquera la certificat sous peine d&#8217;avoir des avertissement de sécurité dans les navigateurs.</p>
<p>&nbsp;</p>
<p>2ème étape obtenir le certificat et le signer , option 1 du menu :</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">-----------------------------------------------------------------------
 --------------- Certifiace Signing Request handling -------------------
 -----------------------------------------------------------------------
&nbsp;
(CSR request files should be copied into directory: ./csr)
&nbsp;
1: mondomaine.csr
&nbsp;
==&gt; Select the CSR to sign [none]: 1
&nbsp;
==&gt; Add OCSP Extension to Certificate ? [y/N]: N
&nbsp;
==&gt; Select the Usage Key [server|client|none]: server
 Using configuration from ./openssl.cnf
 Enter pass phrase for ./private/cakey.pem:
 Check that the request matches the signature
 Signature ok
 Certificate Details:
 Serial Number: 1 (0x1)
&nbsp;
...
&nbsp;
 Certificate is to be certified until Jun 19 18:36:00 2016 GMT (1825 days)
 Sign the certificate? [y/n]:y
&nbsp;
1 out of 1 certificate requests certified, commit? [y/n]y
 Write out database with 1 new entries
 Data Base Updated
&nbsp;
Signed certificate stored as: ./certs/mondomaine.crt
 Return this certificate to the requesting party.
&nbsp;
Display Certificate? y/n [n] n</pre></div></div>

<p>On sélectionne les demande de certificat en cours (il peut y en avoir plusieurs), on indique le rôle du certificat à générer (server), on saisi le mot de passe de l&#8217;autorité de certification et voila&#8230;</p>
<p>L’utilisation de easyCA est quand même beaucoup plus simple que de se taper les lignes de commande&#8230;.</p>
<p>&nbsp;</p>
<p>Pour info voici les commandes par easyCA  qui sont lancées pour les 3 étapes décrites ci-dessus :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">openssl req <span style="color: #660033;">-new</span> <span style="color: #660033;">-x509</span> <span style="color: #660033;">-config</span> .<span style="color: #000000; font-weight: bold;">/</span>openssl.cnf <span style="color: #660033;">-keyout</span> .<span style="color: #000000; font-weight: bold;">/</span>private<span style="color: #000000; font-weight: bold;">/</span>cakey.pem <span style="color: #660033;">-out</span> .<span style="color: #000000; font-weight: bold;">/</span>certs<span style="color: #000000; font-weight: bold;">/</span>cacert.pem <span style="color: #660033;">-days</span> <span style="color: #000000;">1825</span>
&nbsp;
openssl req <span style="color: #660033;">-new</span> <span style="color: #660033;">-nodes</span> <span style="color: #660033;">-config</span> .<span style="color: #000000; font-weight: bold;">/</span>openssl.cnf <span style="color: #660033;">-days</span> <span style="color: #000000;">1825</span> <span style="color: #660033;">-keyout</span> .<span style="color: #000000; font-weight: bold;">/</span>private<span style="color: #000000; font-weight: bold;">/</span>mondomaine-key.pem <span style="color: #660033;">-out</span> .<span style="color: #000000; font-weight: bold;">/</span>csr<span style="color: #000000; font-weight: bold;">/</span>mondomaine.csr
&nbsp;
openssl ca <span style="color: #660033;">-config</span> .<span style="color: #000000; font-weight: bold;">/</span>openssl.cnf <span style="color: #660033;">-cert</span> .<span style="color: #000000; font-weight: bold;">/</span>certs<span style="color: #000000; font-weight: bold;">/</span>cacert.pem <span style="color: #660033;">-extensions</span>  SERVEUR <span style="color: #660033;">-in</span> .<span style="color: #000000; font-weight: bold;">/</span>csr<span style="color: #000000; font-weight: bold;">/</span>mondomaine.csr <span style="color: #660033;">-out</span> .<span style="color: #000000; font-weight: bold;">/</span>certs<span style="color: #000000; font-weight: bold;">/</span>mondomaine.crt</pre></div></div>

<p>Elle très très semblables à celles que j&#8217;ai décrite dans le premier paragraphe&#8230;</p>
<p><strong><br />
 </strong></p>
<h2><a name="para3"></a>Configuration NGINX</h2>
<p>Une fois un certificat généré pour votre site que ce soit manuellement ou via easyCA, il faut tout d&#8217;abord copier le clé et le dit certificat vers un répertoire qui sera accessible par NGINX.</p>
<p>Dans mon cas j&#8217;ai créé un répertoire certificates dans /etc/nginx.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> ~
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">cp</span> myCA<span style="color: #000000; font-weight: bold;">/</span>certs<span style="color: #000000; font-weight: bold;">/</span>mondomaine.crt <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>nginx<span style="color: #000000; font-weight: bold;">/</span>certificates
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">cp</span> myCA<span style="color: #000000; font-weight: bold;">/</span>private<span style="color: #000000; font-weight: bold;">/</span>mondomaine-key.pem <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>nginx<span style="color: #000000; font-weight: bold;">/</span>certificates
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">chown</span> root.root <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>nginx<span style="color: #000000; font-weight: bold;">/</span>certificates<span style="color: #000000; font-weight: bold;">/</span>mondomaine-key.pem
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #000000;">400</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>nginx<span style="color: #000000; font-weight: bold;">/</span>certificates<span style="color: #000000; font-weight: bold;">/</span>mondomaine-key.pem</pre></div></div>

<p>Il suffit ensuite d&#8217;indiquer à NGINX pour le site voulu l&#8217;écouter sur le port 443 (au lieu du 80) et l&#8217;utilisation du certificat et de la clé privée</p>
<pre>server {
    listen               443;
    server_name          mondomaine.fr;

    ssl                  on;
    ssl_certificate      /etc/nginx/certificates/mondomaine.crt;
    ssl_certificate_key  /etc/nginx/certificates/mondomaine-key.fr;

....
  }</pre>
<p>Et rediriger le port 443 vers votre serveur&#8230;</p>
<p>&nbsp;</p>
<h2><a name="para4"></a>Configuration Firefox</h2>
<p>Lorsque vous irez sur votre site pour la première fois vous aurez un message d&#8217;avertissement car votre autorité de certification (c&#8217;est à dire votre serveur) n&#8217;est pas reconnue par le navigateur :</p>
<p><a href="http://voidandany.free.fr/wp-content/uploads/2011-06-22_161311.png"><img class="aligncenter size-full wp-image-4184" title="2011-06-22_161311" src="http://voidandany.free.fr/wp-content/uploads/2011-06-22_161311.png" alt="" width="641" height="324" /></a></p>
<p>Si on regarde les détail technique on a ceci :</p>
<p><a href="http://voidandany.free.fr/wp-content/uploads/2011-06-22_161320.png"><img class="aligncenter size-full wp-image-4185" title="2011-06-22_161320" src="http://voidandany.free.fr/wp-content/uploads/2011-06-22_161320.png" alt="" width="433" height="104" /></a>Ou ceci <a href="http://voidandany.free.fr/wp-content/uploads/Sélection_00512m.png"><img class="aligncenter size-full wp-image-4190" title="Sélection_00512m" src="http://voidandany.free.fr/wp-content/uploads/Sélection_00512m.png" alt="" width="408" height="152" /></a>Dans le premeir cas je ne comprend pas très bien l&#8217;erreur, peut être est ce d^au fait que j&#8217;utilise un certificat joker mais ceci est une autre histoire, dans le 2ème cas on a 2 erreurs, le fait que le certificat est auto-signée et le fait que le common name donnée lors de la création du certification ne correspond pas au domaine sur lequel il a été appliqué.</p>
<p>Dans tous les cas pour passer outre il suffit d&#8217;importer le certificat racine publique de notre autorité de certification.</p>
<p>Il faut donc diffuser, copier le fichier cacert.pem contenu dans le répertoire certs sur votre serveur sur les machine clientes. ATTENTION il ne faut surtout pas diffuser la clé privé cakey.pem</p>
<p>&nbsp;</p>
<p>Ensuite sur les machines clientes dans Firefox aller dans le menu &laquo;&nbsp;Avancé&nbsp;&raquo; sur l&#8217;onglet &laquo;&nbsp;Chiffrement&nbsp;&raquo; et cliquer sur &laquo;&nbsp;Afficher les certificats&nbsp;&raquo; :</p>
<p><a href="http://voidandany.free.fr/wp-content/uploads/2011-06-22_161336.png"><img class="aligncenter size-full wp-image-4186" title="2011-06-22_161336" src="http://voidandany.free.fr/wp-content/uploads/2011-06-22_161336.png" alt="" width="548" height="500" /></a>Dans l&#8217;onglet &laquo;&nbsp;Autorités&nbsp;&raquo; cliquer sur &laquo;&nbsp;Importer&#8230;&nbsp;&raquo; et sélectionner votre fichier (cacert.pem)</p>
<p>Sélectionner l&#8217;usage que vous souhaitez faire du certificat &laquo;&nbsp;identifier des sites web&nbsp;&raquo; :</p>
<p><a href="http://voidandany.free.fr/wp-content/uploads/2011-06-22_161410.png"><img class="aligncenter size-full wp-image-4188" title="2011-06-22_161410" src="http://voidandany.free.fr/wp-content/uploads/2011-06-22_161410.png" alt="" width="515" height="291" /></a></p>
<p>Votre autorité de certification est désormais reconnue :</p>
<p><a href="http://voidandany.free.fr/wp-content/uploads/2011-06-22_161503.png"><img class="aligncenter size-full wp-image-4183" title="2011-06-22_161503" src="http://voidandany.free.fr/wp-content/uploads/2011-06-22_161503.png" alt="" width="586" height="165" /></a></p>
<p>Et la page devrait s&#8217;afficher sans problème.</p>
<p>&nbsp;</p>
<p>Dans IE il faut aller dans Option Internet &gt; Onglet Contenu &gt; Bouton Certificats, puis onglet Autorités principales de confiance &gt; Bouton Importer</p>
<p>&nbsp;</p>
<p><span style="text-decoration: underline;"><em><strong>Sources : </strong></em></span></p>
<p>Gestion des certificats : <span style="text-decoration: underline;"><em><strong><br />
 </strong></em></span></p>
<ul>
<li><a title="Be your own Certificate Authority (CA)" rel="bookmark" href="http://www.g-loaded.eu/2005/11/10/be-your-own-ca/">Be your own Certificate Authority (CA)</a></li>
<li><a href="http://artisan.karma-lab.net/creer-sa-propre-mini-pki">Créer sa propre (mini) PKI</a> : un article très très clair (comme tous les articles de ce site) sur les certificats, il devrait être obligatoire de le lire (malheureusement pour moi je ne l&#8217;ai trouvé que tard)</li>
<li><a href="http://blog.guiguiabloc.fr/index.php/2008/12/02/pki-pki-oh-pki-pki-ah/">PKI, PKI, oh ! PKI, PKI, ah !</a></li>
</ul>
<p>Configuration NGINX :</p>
<ul>
<li><a rel="next" href="http://blog.shk-desktop.com/565-nginx-serveur-web-complet-bluffant">nginx: serveur web complet bluffant</a></li>
<li><a title="Nginx , SSL et plus encore .." href="http://lindev.fr/index.php?post/2010/04/06/Ngins-%2C-SSL-et-plus-encore-..">Nginx , SSL et plus encore ..</a></li>
</ul>
<p>Autre :</p>
<ul>
<li><a href="http://www.tux-planet.fr/verifier-automatiquement-lexpiration-de-certificats-ssl/">Vérifier automatiquement l&#8217;expiration de certificats SSL &#8211; Tux-planet</a></li>
<li><a href="http://www.informathic.com/post/2010/12/24/installer-ssl-gandi-nginx">Installer un certificat Gandi SSL Standard sur Nginx</a></li>
</ul>
<ul>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://voidandany.free.fr/index.php/securisation-nginx-mise-en-oeuvre-de-connexions-https/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Déplacer/enlever les téléchargements terminés de Transmission (démon)</title>
		<link>http://voidandany.free.fr/index.php/deplacerenlever-les-telechargements-termines-de-transmission-demon/</link>
		<comments>http://voidandany.free.fr/index.php/deplacerenlever-les-telechargements-termines-de-transmission-demon/#comments</comments>
		<pubDate>Tue, 07 Jun 2011 19:15:02 +0000</pubDate>
		<dc:creator>voidAndAny</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[download]]></category>
		<category><![CDATA[torrent]]></category>
		<category><![CDATA[Transmission]]></category>

		<guid isPermaLink="false">http://voidandany.free.fr/?p=4054</guid>
		<description><![CDATA[Par défaut une fois les téléchargements terminés Transmission partage indéfiniment le fichier. Pour changer ce comportement il faut utiliser les paramètres ratio-limit (= valeur numérique) et ratio-limit-enabled (= true). Dés lors Transmission partagera jusqu’à ce que le ratio téléchargement / &#8230; <a href="http://voidandany.free.fr/index.php/deplacerenlever-les-telechargements-termines-de-transmission-demon/">Continuer la lecture <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Par défaut une fois les téléchargements terminés Transmission partage indéfiniment le fichier.</p>
<p>Pour changer ce comportement il faut utiliser les paramètres ratio-limit (= valeur numérique) et ratio-limit-enabled (= true). Dés lors Transmission partagera jusqu’à ce que le ratio téléchargement / partage défini dans ratio-limit soit atteint. Ensuite le fichier sera mis en état arrêté mais restera dans Transmission.</p>
<p>Le script ci-dessous (remove_completed_torrents.sh qui n&#8217;est pas de moi voir les sources) à exécuter à intervalle régulier via une tache Cron vérifie l&#8217;état des fichiers/torrents et pour ceux qui sont stoppés (dont le ratio de partage est atteint) les déplace dans un autre répertoire (complete dans mon cas, <a href="http://voidandany.free.fr/index.php/installer-et-configurer-transmission-en-tant-que-demon/">voir mon arborescence de fichier</a>) et les supprime de Transmission</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/sh</span>
<span style="color: #666666; font-style: italic;"># script to check for complete torrents in transmission folder, then stop and move them</span>
&nbsp;
<span style="color: #007800;">AUTH</span>=<span style="color: #ff0000;">&quot;--netrc=<span style="color: #007800;">$HOME</span>/.netrc&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># either hard-code the MOVEDIR variable here</span>
<span style="color: #007800;">MOVEDIR</span>=<span style="color: #000000; font-weight: bold;">/</span>data<span style="color: #000000; font-weight: bold;">/</span>downloads<span style="color: #000000; font-weight: bold;">/</span>torrents<span style="color: #000000; font-weight: bold;">/</span><span style="color: #7a0874; font-weight: bold;">complete</span> <span style="color: #666666; font-style: italic;"># the folder to move completed downloads to</span>
<span style="color: #666666; font-style: italic;"># or set MOVEDIR using the first command-line argument</span>
<span style="color: #666666; font-style: italic;"># MOVEDIR=%1</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># use transmission-remote to get torrent list from transmission-remote list</span>
<span style="color: #666666; font-style: italic;"># use sed to delete first / last line of output, and remove leading spaces</span>
<span style="color: #666666; font-style: italic;"># use cut to get first field from each line</span>
<span style="color: #007800;">TORRENTLIST</span>=<span style="color: #000000; font-weight: bold;">`</span>transmission-remote <span style="color: #660033;">--list</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'1d;$d;s/^ *//'</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">cut</span> <span style="color: #660033;">--only-delimited</span> <span style="color: #660033;">--delimiter</span>=<span style="color: #ff0000;">&quot; &quot;</span> <span style="color: #660033;">--fields</span>=<span style="color: #000000;">1</span><span style="color: #000000; font-weight: bold;">`</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># for each torrent in the list</span>
<span style="color: #000000; font-weight: bold;">for</span> TORRENTID <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #007800;">$TORRENTLIST</span>
    <span style="color: #000000; font-weight: bold;">do</span>
    <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;* * * * * Operations on torrent ID <span style="color: #007800;">$TORRENTID</span> starting. * * * * *&quot;</span>
&nbsp;
    <span style="color: #666666; font-style: italic;"># check if torrent download is completed</span>
    <span style="color: #007800;">DL_COMPLETED</span>=<span style="color: #000000; font-weight: bold;">`</span>transmission-remote <span style="color: #007800;">$AUTH</span> <span style="color: #660033;">--torrent</span> <span style="color: #007800;">$TORRENTID</span> <span style="color: #660033;">--info</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #ff0000;">&quot;Percent Done: 100%&quot;</span><span style="color: #000000; font-weight: bold;">`</span>
&nbsp;
    <span style="color: #666666; font-style: italic;"># check torrent’s current state is Stopped, Finished, or Idle</span>
    <span style="color: #007800;">STATE_STOPPED</span>=<span style="color: #000000; font-weight: bold;">`</span>transmission-remote <span style="color: #660033;">--torrent</span> <span style="color: #007800;">$TORRENTID</span> <span style="color: #660033;">--info</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #ff0000;">&quot;State: Finished&quot;</span><span style="color: #000000; font-weight: bold;">`</span>
&nbsp;
    <span style="color: #666666; font-style: italic;"># if the torrent is Stopped, Finished, or Idle after downloading 100%</span>
    <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$DL_COMPLETED</span>&quot;</span> <span style="color: #000000; font-weight: bold;">!</span>= <span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$STATE_STOPPED</span>&quot;</span> <span style="color: #000000; font-weight: bold;">!</span>= <span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
        <span style="color: #666666; font-style: italic;"># move the files and remove the torrent from Transmission</span>
        <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Torrent #<span style="color: #007800;">$TORRENTID</span> is completed.&quot;</span>
        <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Moving downloaded file(s) to <span style="color: #007800;">$MOVEDIR</span>.&quot;</span>
        transmission-remote <span style="color: #660033;">--torrent</span> <span style="color: #007800;">$TORRENTID</span> <span style="color: #660033;">--move</span> <span style="color: #007800;">$MOVEDIR</span>
        <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Removing torrent from list.&quot;</span>
        transmission-remote <span style="color: #660033;">--torrent</span> <span style="color: #007800;">$TORRENTID</span> <span style="color: #660033;">--remove</span>
    <span style="color: #000000; font-weight: bold;">else</span>
        <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Torrent #<span style="color: #007800;">$TORRENTID</span> is not completed. Ignoring.&quot;</span>
    <span style="color: #000000; font-weight: bold;">fi</span>
    <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;* * * * * Operations on torrent ID <span style="color: #007800;">$TORRENTID</span> completed. * * * * *&quot;</span>
<span style="color: #000000; font-weight: bold;">done</span></pre></div></div>

<p>Ce script utilise la commande transmission-remote du paquet transmission-cli à installer si ce n&#8217;est déjà fait.</p>
<p>Pour certaines opérations transmission-remote à besoin d&#8217;informations de connexion (login / mot de passe), plutôt que d&#8217;utiliser l&#8217;option &#8211;auth j&#8217;ai préféré utiliser l&#8217;option &#8211;netrc, il faut donc créer un fichier .netrc dans le home de votre utilisateur (ou si vous souhaitez le mettre ailleurs il faudra modifier la variable AUTH) et y mettre les informations suivantes :</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">machine localhost login [votre login] password [votre mot de passe]</pre></div></div>

<p>Du Fait des information sensible de ce fichier on le protégera en faisant un :</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> ~<span style="color: #000000; font-weight: bold;">/</span>.netrc</pre></div></div>

<p>&nbsp;</p>
<p>Lorsque l&#8217;on exécute le script on aura ce genre de sortie :</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">./bin/remove_complet_torrent.sh
 * * * * * Operations on torrent ID 1 starting. * * * * *
 Torrent #1 is completed.
 Moving downloaded file(s) to /data/downloads/torrents/complete.
 localhost:9091 responded: &quot;success&quot;
 Removing torrent from list.
 localhost:9091 responded: &quot;success&quot;
 * * * * * Operations on torrent ID 1 completed. * * * * *</pre></div></div>

<p>&nbsp;</p>
<p><strong>Rque :</strong> dans le script d&#8217;origine les fichiers étaient déplacés dès lors que leur statut était stopped ou idle ou finished. J&#8217;ai supprimé les 2 premiers statuts sinon les fichiers étaient enlevés alors que le ratio de partage n&#8217;était pas atteint&#8230;</p>
<p>&nbsp;</p>
<p><em><span style="text-decoration: underline;"><strong>Sources :</strong></span><br />
 </em></p>
<ul>
<li><a href="http://www.transmissionbt.com/">Transmission</a> : Site officiel </li>
<li><a href="http://1000umbrellas.com/2010/10/05/updated-how-to-automatically-move-and-remove-transmission-daemon-downloads">Updated: How to Automatically Move and Remove Transmission-Daemon Downloads &#8211; 1000umbrellas.com</a>: Source du script de suppression des torrent terminés</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://voidandany.free.fr/index.php/deplacerenlever-les-telechargements-termines-de-transmission-demon/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OpenSSL puissance et complexité</title>
		<link>http://voidandany.free.fr/index.php/openssl-puissance-et-complexite/</link>
		<comments>http://voidandany.free.fr/index.php/openssl-puissance-et-complexite/#comments</comments>
		<pubDate>Wed, 01 Jun 2011 11:33:52 +0000</pubDate>
		<dc:creator>voidAndAny</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[SSL]]></category>

		<guid isPermaLink="false">http://voidandany.free.fr/?p=3947</guid>
		<description><![CDATA[Dans le but de mettre une connexion https sur certains de mes sites NGINX je me suis intéressé à la génération du certificat et de la clé nécessaire pour cette opération. Au fil de mes lectures j&#8217;ai pu constater la &#8230; <a href="http://voidandany.free.fr/index.php/openssl-puissance-et-complexite/">Continuer la lecture <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.flickr.com/photos/epitti/2585357353/"><img class="size-full wp-image-3981 alignleft" title="Enigma" src="http://voidandany.free.fr/wp-content/uploads/2585357353_9974cf0559_m.jpg" alt="" width="240" height="180" /></a>Dans le but de mettre une <strong>connexion https</strong> sur certains de mes sites NGINX je me suis intéressé à la génération du certificat et de la clé nécessaire pour cette opération.</p>
<p>Au fil de mes lectures j&#8217;ai pu constater la puissance de la <strong>commande openssl </strong>permettant de générer ces fichiers mais aussi la difficulté à en appréhender le fonctionnement.</p>
<p>En effet pour réaliser une même tache il est possible de lancer x commandes différentes avec y options différentes.</p>
<p>De même pour passer un site en https, certains décrivent la création d&#8217;une clé et d&#8217;un certificat auto-signé directement utilisé par le serveur web et d&#8217;autres créent d&#8217;abord une autorité de certification (sous la forme d&#8217;une clé et d&#8217;un certificat auto-signé) qu&#8217;ils utilisent ensuite pour signer un autre certificat qui lui sera paramétré dans le serveur Web.</p>
<p>Ci-dessous les 3 types d&#8217;opérations trouvés :</p>
<ul>
<li>Génération d&#8217;un certificat serveur auto-signé (et de sa clé) pour utilisation directe par le serveur web.</li>
<li>Création d&#8217;une autorité de certification </li>
<li>Génération d&#8217;un certificat serveur et signature de ce dernier pour une autorité de certification </li>
</ul>
<p>Pour chacune des ces opérations j&#8217;ai listés (non exhaustif) les différentes syntaxes trouvées (j&#8217;ai arrangé l&#8217;ordre des paramètres pour faciliter la comparaison)</p>
<p>L&#8217;objectif de cet article n&#8217;est pas de donner un mode opération pour créer un certificat et sa clé (je le ferais dans un autre article) mais il s&#8217;agit de mettre en avant la richesse et la difficulté à comprendre ce qui est fait avec la commande openssl&#8230;</p>
<p>(il s&#8217;agit d&#8217;un travail de débroussaillage pour choisir mon mode opératoire)</p>
<p>&nbsp;</p>
<p>Premier point un peu en dehors du sujet, les extensions des fichiers, on trouve de tout :</p>
<ul>
<li>clé :  key,  pem</li>
<li>demande de certificat : csr, pem</li>
<li>certificat : crt, pem</li>
</ul>
<p>Cela montre sans même rentrer dans le détail des commandes la difficulté à s&#8217;y retrouver&#8230;.</p>
<p>&nbsp;</p>
<h2>Création d&#8217;un certificat serveur auto-signé</h2>
<h3>Solution 1 : Génération de la clé et du certificat auto-signé en 1 seule fois</h3>
<p><a rel="next" href="http://blog.shk-desktop.com/565-nginx-serveur-web-complet-bluffant">nginx: serveur web complet bluffant</a></p>
<pre>openssl req -x509 -nodes -days 365 -newkey rsa:1024 -out /etc/nginx/conf.d/default.pem -keyout /etc/nginx/conf.d/default.key
chmod 440 /etc/nginx/conf.d/default.pem /etc/nginx/conf.d/default.key</pre>
<p><a title="Nginx , SSL et plus encore .." href="http://lindev.fr/index.php?post/2010/04/06/Ngins-%2C-SSL-et-plus-encore-..">Nginx , SSL et plus encore ..</a></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>etc<span style="color: #000000; font-weight: bold;">/</span>nginx<span style="color: #000000; font-weight: bold;">/</span>certificats
<span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>nginx<span style="color: #000000; font-weight: bold;">/</span>certificats
openssl req <span style="color: #660033;">-new</span> <span style="color: #660033;">-x509</span> <span style="color: #660033;">-nodes</span> <span style="color: #660033;">-out</span> mon-site.fr.crt <span style="color: #660033;">-keyout</span> mon-site.fr.key</pre></div></div>

<p>&nbsp;</p>
<h3>Solution 2 : en plusieurs commandes</h3>
<p><a href="#src8">(8)</a></p>
<p>Génération de la clé, génération de la demande de certificat, suppression de la passphrase et auto-signature du certificat</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># cd /usr/local/nginx/conf</span>
<span style="color: #666666; font-style: italic;"># openssl genrsa -des3 -out server.key 1024</span>
<span style="color: #666666; font-style: italic;"># openssl req -new -key server.key -out server.csr</span>
<span style="color: #666666; font-style: italic;"># cp server.key server.key.org</span>
<span style="color: #666666; font-style: italic;"># openssl rsa -in server.key.org -out server.key</span>
<span style="color: #666666; font-style: italic;"># openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt</span></pre></div></div>

<p>&nbsp;</p>
<h2>Création d&#8217;une autorité de certification</h2>
<p>La création de l&#8217;autorité de certification peut se faire en plus ou moins d&#8217;étapes, avec divers options voici celles trouvées de ci de là.</p>
<h3>Solution 1 : Génération de la clé et du certificat en 1 seule fois</h3>
<p><a href="#src3">(3)</a></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">openssl req <span style="color: #660033;">-x509</span> <span style="color: #660033;">-newkey</span> rsa:<span style="color: #000000;">2048</span> <span style="color: #660033;">-days</span> <span style="color: #000000;">1825</span> <span style="color: #660033;">-keyout</span> private<span style="color: #000000; font-weight: bold;">/</span>cacertkey.pem <span style="color: #660033;">-out</span> cacert.pem</pre></div></div>

<p><a href="#src4">(4)</a></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">openssl req <span style="color: #660033;">-x509</span> <span style="color: #660033;">-newkey</span> rsa:<span style="color: #000000;">2048</span> <span style="color: #660033;">-new</span> <span style="color: #660033;">-days</span> <span style="color: #000000;">3650</span> <span style="color: #660033;">-keyout</span> private<span style="color: #000000; font-weight: bold;">/</span>cacert.key <span style="color: #660033;">-out</span> cacert.pem</pre></div></div>

<p><a href="#src6">(6)</a></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">openssl req <span style="color: #660033;">-x509</span> <span style="color: #660033;">-new</span> <span style="color: #660033;">-days</span> <span style="color: #000000;">1825</span> <span style="color: #660033;">-config</span> openssl.my.cnf <span style="color: #660033;">-extensions</span> v3_ca <span style="color: #660033;">-keyout</span> private<span style="color: #000000; font-weight: bold;">/</span>myca.key <span style="color: #660033;">-out</span> certs<span style="color: #000000; font-weight: bold;">/</span>myca.crt</pre></div></div>

<p>Quelques remarque sur ces syntaxes :</p>
<p>-new est optionnel lorsque -newkey rsa:xxx est spécifié (syntaxe 4) , en en effet ce dernier crée une clé et une demande de certificat tandis que -new ne crée que la demande de certificat.</p>
<p>Dans la syntaxe 6 la clé est générée malgré la seul présence de l&#8217;option -new qui n&#8217;est sensée ne générer que le certificat. Mais en l&#8217;absence du mot-clé -key spécifiant une clé à utiliser pour créer le certificat, une nouvelle clé est générée en utilisant les données du fichier de configuration openssl.conf (ici l&#8217;auteur précise un autre fichier de configuration à utiliser plutôt que celui standard avec l&#8217;option -config)</p>
<p>Enfin il ne s&#8217;agit pas d&#8217;une demande de certificat qui est généré comme indiqué ci-dessus mais directement un certificat grâce à l’adjonction de l&#8217;option -x509</p>
<p>&nbsp;</p>
<h3>Solution 2 : Création de la clé privé puis création du certificat auto-signé</h3>
<p><a href="#src1">(1)</a></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">openssl genrsa <span style="color: #660033;">-des3</span> <span style="color: #000000;">2048</span> <span style="color: #660033;">-out</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>ssl<span style="color: #000000; font-weight: bold;">/</span>CA<span style="color: #000000; font-weight: bold;">/</span>private<span style="color: #000000; font-weight: bold;">/</span>my-ca.key
openssl <span style="color: #660033;">-req</span> x509 <span style="color: #660033;">-key</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>ssl<span style="color: #000000; font-weight: bold;">/</span>CA<span style="color: #000000; font-weight: bold;">/</span>private<span style="color: #000000; font-weight: bold;">/</span>my-ca.key <span style="color: #660033;">-days</span> <span style="color: #000000;">3650</span> <span style="color: #000000; font-weight: bold;">&gt;</span> my-ca.crt</pre></div></div>

<p><a href="#src7">(7)</a></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">openssl genrsa <span style="color: #660033;">-des3</span> <span style="color: #000000;">2048</span> <span style="color: #660033;">-out</span> elao-ca.key
openssl req <span style="color: #660033;">-x509</span> <span style="color: #660033;">-new</span> <span style="color: #660033;">-key</span> elao-ca.key <span style="color: #660033;">-days</span> <span style="color: #000000;">3650</span> <span style="color: #660033;">-out</span> elao-ca.crt</pre></div></div>

<p>La différence entre ces 2 sources réside dans l&#8217;utilisation de 2 commandes différentes.</p>
<ul>
<li>req qui permet de générer un nouveau (-new) certificat auto-signé (-x509)</li>
<li>x509 utilitaire de gestion des certificats (affichage, conversion) utilisé ici pour créer un nouveau certificat (-req)</li>
</ul>
<p>Et de la méthode sortie (option out contre redirection)</p>
<h3>Solution 3 : Création de la clé privé, demande de certificat et signature du certificat</h3>
<p><a href="#src2">(2)</a></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">openssl genrsa <span style="color: #660033;">-des3</span> <span style="color: #660033;">-out</span> ca.key <span style="color: #000000;">2048</span>
openssl req <span style="color: #660033;">-new</span> <span style="color: #660033;">-key</span> ca.key <span style="color: #660033;">-out</span> ca.csr
openssl x509 <span style="color: #660033;">-req</span> <span style="color: #660033;">-days</span> <span style="color: #000000;">3650</span> <span style="color: #660033;">-in</span> ca.csr <span style="color: #660033;">-signkey</span> ca.key <span style="color: #660033;">-out</span> ca.crt</pre></div></div>

<p>&nbsp;</p>
<h2>Création d&#8217;un certificat serveur et signature par l&#8217;autorité de certification</h2>
<h3>Solution 1 : Création de la clé, suppression du mot de passe, demande de certificat, signature du certificat avec notre autorité</h3>
<p><a href="#src2">(2)</a></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">openssl genrsa <span style="color: #660033;">-des3</span> <span style="color: #660033;">-out</span> server.key <span style="color: #000000;">1024</span>
openssl rsa <span style="color: #660033;">-in</span> server.key <span style="color: #660033;">-out</span> server.key
openssl req <span style="color: #660033;">-new</span> <span style="color: #660033;">-key</span> server.key <span style="color: #660033;">-out</span> server.csr
openssl x509 <span style="color: #660033;">-req</span> <span style="color: #660033;">-in</span> server.csr <span style="color: #660033;">-out</span> server.crt <span style="color: #660033;">-CA</span> ca.crt <span style="color: #660033;">-CAkey</span> ca.key <span style="color: #660033;">-CAcreateserial</span></pre></div></div>

<p><a href="#src7">(7)</a></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">openssl genrsa <span style="color: #660033;">-des3</span> <span style="color: #660033;">-out</span> elao-server.key <span style="color: #000000;">1024</span>
openssl rsa <span style="color: #660033;">-in</span> elao-server.key <span style="color: #660033;">-out</span> elao-server.key.insecure
openssl req <span style="color: #660033;">-new</span> <span style="color: #660033;">-key</span> elao-server.key <span style="color: #660033;">-out</span> elao-server.csr
openssl x509 <span style="color: #660033;">-req</span> <span style="color: #660033;">-in</span> elao-server.csr <span style="color: #660033;">-out</span> elao-server.crt <span style="color: #660033;">-sha1</span> <span style="color: #660033;">-CA</span> elao-ca.crt <span style="color: #660033;">-CAkey</span> elao-ca.key <span style="color: #660033;">-CAcreateserial</span> <span style="color: #660033;">-days</span> <span style="color: #000000;">3650</span></pre></div></div>

<p>L&#8217;option -CAcreateserial n&#8217;est nécessaire que lors de la signature du premier certificat par notre autorité de certification, elle peut même ne pas être nécessaire du tout si on a créé préalablement le fichier paramétré sous le nome database dans le fichier openssl.conf.</p>
<p>&nbsp;</p>
<h3>Solution 2 : Création de la clé sans mot de passe,  demande de certificat, signature du certificat avec notre autorité</h3>
<p><a href="#src1">(1)</a></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">openssl genrsa <span style="color: #000000;">1024</span> <span style="color: #660033;">-out</span> www.test.net.key
openssl req <span style="color: #660033;">-new</span> <span style="color: #660033;">-key</span> www.test.net.key <span style="color: #660033;">-out</span> www.test.net.csr
openssl ca <span style="color: #660033;">-in</span> www.test.net.csr <span style="color: #660033;">-out</span> www.test.net.crt</pre></div></div>

<p>Le fait de ne pas mettre l&#8217;option -des3 génère une clé directement sans mot de passe</p>
<p>La signature se fait avec la commande ca au lieu de x509, mais je ne comprends pas pas où l&#8217;on spécifie que l&#8217;on doit utiliser notre autorité de certification, son certificat et sa clé (my-ca.crt et my-ca.key, voir ci-dessus solution 2)</p>
<p>Pour moi avec cette méthode le certificat généré est auto-signé ce qui n&#8217;est pas le but recherché.</p>
<p>&nbsp;</p>
<h3>Solution 3 : Création de la clé et de la demande de certificat, signature du certificat avec notre autorité</h3>
<p><a href="#src3">(3)</a></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">openssl req <span style="color: #660033;">-newkey</span> rsa:<span style="color: #000000;">2048</span> <span style="color: #660033;">-keyout</span> private<span style="color: #000000; font-weight: bold;">/</span>server.key <span style="color: #660033;">-out</span> server-req.pem
openssl ca <span style="color: #660033;">-in</span> serveur-req.pem <span style="color: #660033;">-out</span> signedcerts<span style="color: #000000; font-weight: bold;">/</span>serveur-cert.pem <span style="color: #660033;">-cert</span> cacert.pem <span style="color: #660033;">-keyfile</span> private<span style="color: #000000; font-weight: bold;">/</span>cacertkey.pem <span style="color: #660033;">-days</span> <span style="color: #000000;">365</span></pre></div></div>

<p><a href="#src6">(6)</a></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">openssl req <span style="color: #660033;">-new</span> <span style="color: #660033;">-keyout</span> private<span style="color: #000000; font-weight: bold;">/</span>server.key <span style="color: #660033;">-out</span> server.csr <span style="color: #660033;">-config</span> openssl.my.cnf <span style="color: #660033;">-nodes</span> <span style="color: #660033;">-days</span> <span style="color: #000000;">365</span>
openssl ca <span style="color: #660033;">-infiles</span> server.csr <span style="color: #660033;">-out</span> certs<span style="color: #000000; font-weight: bold;">/</span>server.crtc <span style="color: #660033;">-config</span> openssl.my.cnf <span style="color: #660033;">-policy</span> policy_anything</pre></div></div>

<p>Concernant les commande de génération de al clé et de la demande de certificat :</p>
<ul>
<li>-new ne  crée que la clé sauf si on n&#8217;utilise pas l&#8217;option -key auquel cas la clé est aussi générée</li>
<li>-newkey rsa:xxx crée une clé et un certificat</li>
<li>Ce sont des demandes de certificat qui sont générés (contrairement aux commandes que l&#8217;on a utilisé pour la création de l&#8217;autorité de certification solution 1) car nous n&#8217;avons pas l&#8217;option -x509</li>
<li>L&#8217;option -nodes permet d&#8217;indiquer que la clé qui doit être générée ne doit pas être protégée par un mot de passe (passphrase)</li>
</ul>
<p>Enfin les commande de signature des certificats doivent pouvoir être simplifiées comme dans la solution 2 (juste -in et -out)</p>
<p>&nbsp;</p>
<p><span style="text-decoration: underline;"><em><strong>Sources :</strong></em></span></p>
<ol>
<li><a name="src1"></a><a rel="prev" href="http://www.404blog.net/?p=122">Openssl – création d’une autorité de certification</a> et <a href="http://www.404blog.net/?p=165">Openssl – générer et signer une demande de signature(CSR) | 404Blog</a></li>
<li><a name="src2"></a><a title="Permalink to Autorité de certification openssl" href="http://linux-attitude.fr/post/autorite-de-certification-openssl">Autorité de certification openssl</a> et <a title="Permalink to Autorité de certification, le retour" href="http://linux-attitude.fr/post/autorite-de-certification-le-retour">Autorité de certification, le retour</a></li>
<li><a name="src3"></a><a href="http://www.k-tux.com/openssl-creation-et-mise-en-place-dune-pki/2">OpenSSL : création et mise en place d’une PKI &#8211; K-Tux</a></li>
<li><a name="src4"></a><a href="http://www.systemx.fr/linux/openssl/openssl-p.html">Openssl pratique</a></li>
<li><a name="src5"></a><a title="Nginx , SSL et plus encore .." href="http://lindev.fr/index.php?post/2010/04/06/Ngins-%2C-SSL-et-plus-encore-..">Nginx , SSL et plus encore ..</a></li>
<li><a name="src6"></a><a title="Be your own Certificate Authority (CA)" rel="bookmark" href="http://www.g-loaded.eu/2005/11/10/be-your-own-ca/">Be your own Certificate Authority (CA)</a></li>
<li><a name="src7"></a><a title="Permanent Link to Créer une autorité de certification et des certificats SSL auto-signés" rel="bookmark" href="http://www.elao.org/linux/creer-une-autorite-de-certification-et-des-certificats-ssl-auto-signes.html">Créer une autorité de certification et des certificats SSL auto-signés</a></li>
<li><a name="src8"></a><a href="http://www.cyberciti.biz/tips/linux-unix-bsd-nginx-webserver-security.html">Top 20 Nginx WebServer Best Security Practices</a></li>
</ol>
<p>A voir pour les extensions de  fichier :</p>
<ul>
<li><a href="http://en.wikipedia.org/wiki/X.509">http://en.wikipedia.org/wiki/X.509</a></li>
<li><a href="http://marc.info/?l=openssl-users&amp;m=128008468329998&amp;w=2">http://marc.info/?l=openssl-users&amp;m=128008468329998&amp;w=2</a></li>
<li><a title="Be your own Certificate Authority (CA)" rel="bookmark" href="http://www.g-loaded.eu/2005/11/10/be-your-own-ca/">Be your own Certificate Authority (CA)</a></li>
</ul>
<p>Source d&#8217;info sur les commandes les pages MAN (par contre il faut s&#8217;y retrouver avec toutes les options !!)</p>
<ul>
<li><a href="http://www.openssl.org/docs/apps/req.html#">req</a></li>
<li><a href="http://www.openssl.org/docs/apps/x509.html#">x509</a></li>
<li><a href="http://www.openssl.org/docs/apps/openssl.html">openssl</a></li>
<li><a href="http://www.openssl.org/docs/apps/ca.html#">ca</a></li>
<li><a href="http://www.openssl.org/docs/apps/genrsa.html#">genrsa</a></li>
</ul>
<p>Image par <a href="http://www.flickr.com/photos/epitti/">Erik Pitti</a> (photo de la machine Enigma utilisé par les Allemands lors de la 2de guerre mondial pour crypter leur communication)</p>
]]></content:encoded>
			<wfw:commentRss>http://voidandany.free.fr/index.php/openssl-puissance-et-complexite/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Limiter l&#8217;usage de la bande passante par Transmission automatiquement</title>
		<link>http://voidandany.free.fr/index.php/limiter-lusage-de-la-bande-passante-par-transmission-automatiquement/</link>
		<comments>http://voidandany.free.fr/index.php/limiter-lusage-de-la-bande-passante-par-transmission-automatiquement/#comments</comments>
		<pubDate>Tue, 31 May 2011 14:12:40 +0000</pubDate>
		<dc:creator>voidAndAny</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[download]]></category>
		<category><![CDATA[torrent]]></category>
		<category><![CDATA[Transmission]]></category>

		<guid isPermaLink="false">http://voidandany.free.fr/?p=4055</guid>
		<description><![CDATA[Avec Transmission il est possible de gérer 2 modes de vitesse (normal et alternatif : alt)  en téléchargement et en upload et de planifier selon les heures et jour la bascule entre ces 2 modes (voir le paragraphe Vitesse de &#8230; <a href="http://voidandany.free.fr/index.php/limiter-lusage-de-la-bande-passante-par-transmission-automatiquement/">Continuer la lecture <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.flickr.com/photos/15535329@N08/4539064129"><img class="alignleft size-medium wp-image-4079" title="4539064129_50a2c4c888" src="http://voidandany.free.fr/wp-content/uploads/4539064129_50a2c4c888-300x214.jpg" alt="" width="300" height="214" /></a>Avec <strong>Transmission </strong>il est possible de gérer <strong>2 modes de vitesse</strong> (normal  et alternatif : alt)  en téléchargement et en upload et de planifier selon les heures et jour la bascule entre ces 2 modes (voir le paragraphe Vitesse de mon article <a title="Lien permanent vers Installer et configurer Transmission en tant que démon" rel="bookmark" href="../index.php/installer-et-configurer-transmission-en-tant-que-demon/">Installer et configurer Transmission en tant que démon</a>) La bascule entre ces 2 modes est aussi paramétrable selon les jours et les heures.</p>
<p>Bien que très pratique ce mécanisme n&#8217;est pas optimal en effet Transmission passe d&#8217;un mode à un autre pour une plage horaire et certains jours données or mon besoin est que Transmission passe du mode normal (sans limitation) au mode alternatif (vitesses limités, mode turtle/tortue) <strong>uniquement si un des mes PC est allumé,</strong> préservant ainsi ma bande passante pour pouvoir avoir un usage normal d&#8217;Internet.</p>
<p>Et dès que tous les PCs sont éteint on re-bascule en mode normal.</p>
<p>Voici le script que j&#8217;ai fait :</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>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">cd</span> $<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">dirname</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${0}</span>&quot;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">while</span> <span style="color: #c20cb9; font-weight: bold;">read</span> HOST_IP;
<span style="color: #000000; font-weight: bold;">do</span>
    <span style="color: #c20cb9; font-weight: bold;">ping</span> <span style="color: #660033;">-c</span> <span style="color: #000000;">5</span> <span style="color: #660033;">-w</span> <span style="color: #000000;">15</span> <span style="color: #007800;">$HOST_IP</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>null
    <span style="color: #007800;">RESULT</span>=<span style="color: #007800;">$?</span>
&nbsp;
        <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$RESULT</span> <span style="color: #660033;">-eq</span> <span style="color: #000000;">0</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
            <span style="color: #7a0874; font-weight: bold;">break</span>
        <span style="color: #000000; font-weight: bold;">fi</span>
 <span style="color: #000000; font-weight: bold;">done</span> <span style="color: #000000; font-weight: bold;">&lt;</span> alt_speed_IP
&nbsp;
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$RESULT</span> <span style="color: #660033;">-eq</span> <span style="color: #000000;">0</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
    <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;At least 1 computer on, set alt speed&quot;</span>
    transmission-remote <span style="color: #660033;">-as</span>
<span style="color: #000000; font-weight: bold;">else</span>  
    <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;no computer on, max speed&quot;</span>
    transmission-remote <span style="color: #660033;">-AS</span>
<span style="color: #000000; font-weight: bold;">fi</span></pre></div></div>

<p>Ce script attend un fichier alt_speed_IP contenant un liste d&#8217;adresse IP à surveiller (1 par ligne)</p>
<p>Pour chacun des adresses IP il essai de les pinguer, si au moins une adresse répond c&#8217;est qu&#8217;au moins un ordinateur de &laquo;&nbsp;bureau&nbsp;&raquo; est allumé et qu&#8217;il faut mettre Transmission en mode tortue pour préserver la bande passante.</p>
<p>Si au terme du ping de toutes les adresse du fichier alt_speed_IP aucun ordinateur n&#8217;a répondu Transmission peut repasser en mode normal.</p>
<p>Le changement de mode se fait avec la commande tranmission-remote du paquet transmission-cli&#8230;</p>
<p>&nbsp;</p>
<p><span style="text-decoration: underline;"><em><strong>Source : </strong></em></span></p>
<p>Image par <a href="http://www.flickr.com/photos/photo-impressionism/">Stephen D&#8217;Agostino &#8211; its time to organize a show</a> sous CC BY-NC-ND</p>
]]></content:encoded>
			<wfw:commentRss>http://voidandany.free.fr/index.php/limiter-lusage-de-la-bande-passante-par-transmission-automatiquement/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Logs NGINX et Logrotate</title>
		<link>http://voidandany.free.fr/index.php/logs-nginx-et-logrotate/</link>
		<comments>http://voidandany.free.fr/index.php/logs-nginx-et-logrotate/#comments</comments>
		<pubDate>Tue, 31 May 2011 13:38:56 +0000</pubDate>
		<dc:creator>voidAndAny</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[logrotate]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[script]]></category>

		<guid isPermaLink="false">http://voidandany.free.fr/?p=4009</guid>
		<description><![CDATA[J&#8217;ai déjà parlé de NGINX, ce formidable serveur web rapide et surtout léger installé sur mon Dockstar. J&#8217;ai aussi installé logrotate sur mon serveur, outil qui permet de faire tourner et d&#8217;archiver les fichiers de logs Pour que les 2 &#8230; <a href="http://voidandany.free.fr/index.php/logs-nginx-et-logrotate/">Continuer la lecture <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>J&#8217;ai déjà parlé de <a href="http://voidandany.free.fr/index.php/tag/nginx/">NGINX</a>, ce formidable serveur web rapide et surtout léger installé sur mon <a title="Marques-pages : Un mini serveur le Seagate Dockstar" href="http://voidandany.free.fr/index.php/marques-pages-un-mini-serveur-le-seagate-dockstar/">Dockstar</a>.</p>
<p>J&#8217;ai aussi<a href="http://voidandany.free.fr/index.php/configuration-de-base-du-dockstar/"> installé logrotate sur mon serveur</a>, outil qui permet de faire tourner et d&#8217;archiver les fichiers de logs</p>
<p>Pour que les 2 fonctionnent ensemble il  faut ajouter une configuration dans logrotate pour qu&#8217;il prennent en compte NGINX, ce dernier n&#8217;étant pas reconnu  par logrotate lors de son installation.</p>
<p>Il faut donc créer un fichier nginx sous /etc/logrotate.d/ et y coller ceci (à adapter) :</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">/var/log/nginx/*.log {
	#rotate the logfile(s) daily
	daily
	# adds extension like YYYYMMDD instead of simply adding a number
	dateext
	# If log file is missing, go on to next one without issuing an error msg
	missingok
	# Save logfiles for the last 10 days
	rotate 10
	# Old versions of log files are compressed with gzip
	compress
	# Postpone compression of the previous log file to the next rotation cycle
	delaycompress
	# Do not rotate the log if it is empty
	notifempty
	#after logfile is rotated and nginx.pid exists, send the USR1 signal
	postrotate
		[ ! -f /var/run/nginx.pid  ] || kill -USR1 `cat /var/run/nginx.pid`
	endscript
}</pre></div></div>

<p>C&#8217;est la directive postrotate qui est spécifique à NGINX et qui est  importante : une fois les log tournées / archivées on lance un signal  d&#8217;arrêt à NGINX pour qu&#8217;il recrée les fichiers de logs.</p>
<p>On testera la configuration avec la commande :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> logrotate <span style="color: #660033;">-d</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>logrotate.d<span style="color: #000000; font-weight: bold;">/</span>nginx</pre></div></div>

<p>Voila pour le paramétrage de base.</p>
<p>&nbsp;</p>
<p>J&#8217;y ai personnellement ajouté l&#8217;appel à un script de mon crû avant que logrotate ne fasse tourner les logs.</p>
<p>Ce script analyse les logs d&#8217;accès de NGINX et effectue une petite analyse des IPs et des utilisateurs qui se connectent :</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: #7a0874; font-weight: bold;">cd</span> $<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">dirname</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${0}</span>&quot;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #007800;">log</span>=<span style="color: #7a0874; font-weight: bold;">&#91;</span>nom et chemin <span style="color: #c20cb9; font-weight: bold;">du</span> fichier log<span style="color: #7a0874; font-weight: bold;">&#93;</span>
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">date</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #007800;">$log</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>  <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #007800;">$log</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">for</span> <span style="color: #c20cb9; font-weight: bold;">file</span> <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>log<span style="color: #000000; font-weight: bold;">/</span>nginx<span style="color: #000000; font-weight: bold;">/*</span>access.log
<span style="color: #000000; font-weight: bold;">do</span>
     <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #800000;">${file}</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #007800;">$log</span>
&nbsp;
     <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>Nb accès par IP&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #007800;">$log</span>
     <span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #800000;">${file}</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{print $1}'</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sort</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">uniq</span> -c  <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #007800;">$log</span>
     <span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #660033;">-i</span> <span style="color: #ff0000;">'s/\(81..125.231.15$\)/\1 : Travail/'</span> <span style="color: #007800;">$log</span>
     <span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #660033;">-i</span> <span style="color: #ff0000;">'s/\(89.5.45.52$\)/\1 : Maison/'</span>  <span style="color: #007800;">$log</span>
&nbsp;
     <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>Nb accès par utilisateur&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #007800;">$log</span>
     <span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #800000;">${file}</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{print $3}'</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sort</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">uniq</span> <span style="color: #660033;">-c</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #007800;">$log</span>
&nbsp;
     <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>-------------------------<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #007800;">$log</span>
<span style="color: #000000; font-weight: bold;">done</span></pre></div></div>

<p>&nbsp;</p>
<p>qui produit ce genre de rapport :</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">jeudi 14 avril 2011, 13:35:21 (UTC+0200)
&nbsp;
/var/log/nginx/access.log
&nbsp;
Nb accès par IP
1 121.162.199.215
6 192.168.1.100 : Maison
1 208.80.194.29
1 222.187.222.26
&nbsp;
Nb accès par utilisateur
4 -
5 mon_utilisateur
&nbsp;
-------------------------
/var/log/nginx/xxxx.access.log
&nbsp;
Nb accès par IP
250 125.54.42.12
&nbsp;
Nb accès par utilisateur
250 utilisateur2
-------------------------
/var/log/nginx/yyyy.access.log
Nb accès par IP
Nb accès par utilisateur
-------------------------</pre></div></div>

<p>Pour prendre en compte ce script et le faire exécuter j&#8217;ai ajouté les directives suivantes au fichier nginx de logrotate  :</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># scripts are runned only once
sharedscripts
&nbsp;
# before rotation log are analyzed
prerotate
    /chemin/statistiques_nginx.sh
endscript</pre></div></div>

<p>Ainsi avant de faire tourner les logs NGINX logrotate exécute une seule fois le script que j&#8217;ai nommé statistiques_nginx.sh. Ce dernier produit un rapport que je m’envoie par email (via un autre script)</p>
<p>&nbsp;</p>
<p>A noter qu&#8217;il existe des solutions clé en main et beaucoup plus  évoluées, complètes d&#8217;analyse et de statistiques pour les logs des  serveurs Web (voir dans les sources), mais cela me semble un peu trop  pour mon usage.</p>
<p>&nbsp;</p>
<p><em><strong>Sources : </strong></em></p>
<p>Logrotate :</p>
<ul>
<li><a href="http://serverfault.com/questions/248096/nginx-logrotate-config">nginx logrotate config</a></li>
<li><a href="https://wincent.com/wiki/nginx_log_rotation">nginx log rotation</a></li>
<li><a href="http://ahabdo.wordpress.com/2010/10/16/how-to-configure-logrotate-nginx-log-in-freebsd-and-linux-machine/">How To Configure Logrotate Nginx Log in FreeBSD and Linux Machine.</a></li>
</ul>
<p>Autres solutions de rotation des logs :</p>
<ul>
<li><a href="http://serverfault.com/questions/65118/proper-way-to-rotate-nginx-logs">Proper way to rotate Nginx logs</a></li>
<li><a href="http://pjkh.com/articles/2007/03/15/nginx-and-cronolog/">Nginx and Cronolog</a></li>
</ul>
<p>Script analyse des logs :</p>
<ul>
<li><a href="http://fak3r.com/geek/howto-sort-web-server-logs-to-find-top-users/">HOWTO sort web-server logs to find top users</a></li>
<li><a href="http://bash.cyberciti.biz/web-server/find-top-ipaddress-hitting-webserver/">Shell Script List All Top IP Address Accessing Apache / Lighttpd</a></li>
</ul>
<p>Analyse des logs plus évoluées :</p>
<ul>
<li><a title="Permanent Link to Analysis access logs of Nginx by awstats" rel="bookmark" href="http://www.goitworld.com/analysis-access-logs-of-nginx-by-awstats/">Analysis access logs of Nginx by awstats</a></li>
<li><a title="Permanent Link to nginx log rotation and analysis with webalizer" rel="bookmark" href="http://www.edoxy.net/weblog/2009/08/nginx-log-rotation-and-analysis-with-webalizer/">nginx log rotation and analysis with webalizer</a></li>
<li><a href="http://www.w3perl.com/">w3perl</a></li>
<li><a href="http://awstats.sourceforge.net/">awstats</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://voidandany.free.fr/index.php/logs-nginx-et-logrotate/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Utiliser des listes de blocage personnalisées (blocklist) avec le démon Transmission</title>
		<link>http://voidandany.free.fr/index.php/utiliser-des-listes-de-blocage-personnalisees-blocklist-avec-le-demon-transmission/</link>
		<comments>http://voidandany.free.fr/index.php/utiliser-des-listes-de-blocage-personnalisees-blocklist-avec-le-demon-transmission/#comments</comments>
		<pubDate>Thu, 26 May 2011 13:04:02 +0000</pubDate>
		<dc:creator>voidAndAny</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[torrent]]></category>
		<category><![CDATA[Transmission]]></category>

		<guid isPermaLink="false">http://voidandany.free.fr/?p=4038</guid>
		<description><![CDATA[Une blocklist est une liste d&#8217;adresse IP dans un format pré-défini pouvant être utilisée par divers logiciels (notamment les clients torrents) pour bloquer l&#8217;accès du dit logiciel aux utilisateurs des ces IPs (= liste noire d&#8217;adresses IP). Transmission supporte évidemment &#8230; <a href="http://voidandany.free.fr/index.php/utiliser-des-listes-de-blocage-personnalisees-blocklist-avec-le-demon-transmission/">Continuer la lecture <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.flickr.com/photos/louect/4796593945/"><img class="alignleft size-full wp-image-4039" title="4796593945_03585924eb" src="http://voidandany.free.fr/wp-content/uploads/4796593945_03585924eb.jpg" alt="" width="263" height="350" /></a>Une <strong>blocklist </strong>est une liste d&#8217;adresse IP dans un format pré-défini pouvant être utilisée par divers logiciels (notamment les clients torrents) pour bloquer l&#8217;accès du dit logiciel aux utilisateurs des ces IPs (<strong>= liste noire d&#8217;adresses IP</strong>).</p>
<p>Transmission supporte évidemment les blocklists, mais la liste utilisée n&#8217;est pas paramétrable, Transmission télécharge une liste de niveau 1 sur son <a href="http://update.transmissionbt.com/level1.gz">URL mirroir</a></p>
<p>De plus la mise à jour de la liste n&#8217;est pas automatique. Sur le client lourd (transmission GTK) il existe un bouton permettant de mettre à jour la liste, mais évidemment sur le démon il n&#8217;ya pas de bouton.</p>
<p>Nous allons donc voir comment dans un premier temps <strong>mettre à jour la liste lorsque l&#8217;on utilise le démon</strong> puis ensuite comment<strong> utiliser des listes personnalisées </strong>et les mettre à jour automatiquement&#8230;</p>
<p>Dans les 2 cas il faut que le paramètre blocklist-enabled soit positionné à true dans votre fichier settings.json</p>
<p>&nbsp;</p>
<p>Pour mettre à jour la liste de blocage Transmission lorsqu&#8217;on utilise le démon il faut passer par le commande transmission-remote du paquet transmission-cli :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#! /bin/sh</span>
<span style="color: #007800;">username</span>=<span style="color: #ff0000;">'username'</span>
<span style="color: #007800;">password</span>=<span style="color: #ff0000;">'password'</span>
transmission-remote <span style="color: #660033;">--auth</span> <span style="color: #007800;">$username</span>:<span style="color: #007800;">$password</span> <span style="color: #660033;">--blocklist-update</span>
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <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>transmission-daemon restart</pre></div></div>

<p>A la fin on re-démarre le démon pour qu&#8217;il prenne ne compte la nouvelle liste, si comme moi vous utilisez sudo et que vous exécutez ce script avec votre utilisateur il faudra autoriser la commande de re-démarrage dans votre sudoer (voir en fin de éème solution)</p>
<p>Il suffira alors de mettre ce script dans une tache cron et le tour est joué&#8230;</p>
<p><strong>Rque :</strong> comme ce script contient les login et mot de passe en clair de transmission RPC il conviendra de restreindre ses droits d&#8217;accès (chmod 700 script.sh)</p>
<p>&nbsp;</p>
<p>Je n&#8217;ai pas testé ce script puisque j&#8217;utilise la deuxième solution qui consiste à gérer la <strong>mise à jour et l&#8217;origine de la liste</strong> de blocage :</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;"># Télécharge des blockslist à partir de http://iblocklist.com/lists.php</span>
<span style="color: #666666; font-style: italic;"># et les intégre dans le répertoire de Transmission</span>
<span style="color: #666666; font-style: italic;"># répertoire de travail</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># répertoire de travail / temporaire</span>
<span style="color: #007800;">travail</span>=<span style="color: #007800;">$HOME</span><span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>blocklists
<span style="color: #666666; font-style: italic;"># réperoire où Transmission stock les fichiers blocklist</span>
<span style="color: #007800;">transmissionBlocklist</span>=<span style="color: #007800;">$HOME</span><span style="color: #000000; font-weight: bold;">/</span>.config<span style="color: #000000; font-weight: bold;">/</span>transmission-daemon<span style="color: #000000; font-weight: bold;">/</span>blocklists
&nbsp;
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;******** Compilation d'une Bloclist pour Transmissionbt ***********&quot;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-e</span> <span style="color: #007800;">$travail</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
    <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;Répertoire de travail <span style="color: #007800;">$travail</span> &quot;</span>
<span style="color: #000000; font-weight: bold;">else</span>
    <span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #007800;">$travail</span>
<span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #007800;">$travail</span><span style="color: #000000; font-weight: bold;">/*</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#récupération des fichiers http://iblocklist.com/lists.php</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>********* Téléchargements des listes de blocage *******************&quot;</span>
<span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>list.iblocklist.com<span style="color: #000000; font-weight: bold;">/</span>?<span style="color: #007800;">list</span>=bt_level1 <span style="color: #660033;">-O</span> <span style="color: #007800;">$travail</span><span style="color: #000000; font-weight: bold;">/</span>bt_level1.gz
<span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>list.iblocklist.com<span style="color: #000000; font-weight: bold;">/</span>?<span style="color: #007800;">list</span>=bt_level2 <span style="color: #660033;">-O</span> <span style="color: #007800;">$travail</span><span style="color: #000000; font-weight: bold;">/</span>bt_level2.gz
&nbsp;
<span style="color: #666666; font-style: italic;">#décompression</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>********* Décompression des listes téléchargées *******************&quot;</span>
<span style="color: #c20cb9; font-weight: bold;">gunzip</span> <span style="color: #660033;">-v</span> <span style="color: #007800;">$travail</span><span style="color: #000000; font-weight: bold;">/*</span>.gz
&nbsp;
<span style="color: #666666; font-style: italic;">#concaténer les fichiers</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>********* Création d'une seule liste sans redondance des données **&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;traitement en cours ...Patientez SVP...&quot;</span>
<span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #007800;">$travail</span>
<span style="color: #007800;">list1</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">ls</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #c20cb9; font-weight: bold;">sort</span> <span style="color: #660033;">-u</span> <span style="color: #007800;">$list1</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> blocklist <span style="color: #000000; font-weight: bold;">&amp;&amp;</span>
<span style="color: #7a0874; font-weight: bold;">cd</span> -
&nbsp;
<span style="color: #666666; font-style: italic;">#Déplacement du fichier blocklist dans le répertoire de Transmission</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>********* Déplacement de la Blocklist *****************************&quot;</span>
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-d</span> <span style="color: #007800;">$transmissionBlocklist</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span> ;<span style="color: #000000; font-weight: bold;">then</span>
    <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;Copie de sauvegarde de l'ancien fichier&quot;</span>
    <span style="color: #c20cb9; font-weight: bold;">mv</span> <span style="color: #660033;">-f</span> <span style="color: #007800;">$transmissionBlocklist</span><span style="color: #000000; font-weight: bold;">/</span>blocklist <span style="color: #007800;">$travail</span><span style="color: #000000; font-weight: bold;">/</span>blocklist.bak
    <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;Déplacement du nouveau fichier dans le répertoire de Transmission&quot;</span>
    <span style="color: #c20cb9; font-weight: bold;">mv</span> <span style="color: #660033;">-f</span> <span style="color: #007800;">$travail</span><span style="color: #000000; font-weight: bold;">/</span>blocklist <span style="color: #007800;">$transmissionBlocklist</span>
<span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Rechargement de Transmission</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;Rechargement de la configuration de Transmission&quot;</span>
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <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>transmission-deamon reload
<span style="color: #c20cb9; font-weight: bold;">ls</span> <span style="color: #007800;">$transmissionBlocklist</span><span style="color: #000000; font-weight: bold;">/</span>blocklist <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>null <span style="color: #000000;">2</span><span style="color: #000000; font-weight: bold;">&gt;&amp;</span><span style="color: #000000;">1</span>
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$?</span> <span style="color: #660033;">-eq</span> <span style="color: #000000;">0</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
    <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>*********** Opération terminée ************************************&quot;</span>
<span style="color: #000000; font-weight: bold;">else</span>
    <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span> *** KO **** !! Le fichier bloklist est vide !! *** KO *** &quot;</span>
<span style="color: #000000; font-weight: bold;">fi</span></pre></div></div>

<p>Le script télécharge les listes voulues (ici les niveaux 1 et 2), les dézippe et les concatène en excluant les doublons, la liste résultante est ensuite copié dans le répertoire utilisé par Transmission et le démon est rechargé.</p>
<p>Comme indiqué précédemment pour que la commande de rechargement du démon puisse être exécuté via sudo sans demande de mot de passe il faut modifier le sudoer ce qui se fait en lançant la commande</p>
<p>&nbsp;</p>

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

<p>&nbsp;</p>
<p>Et en ajoutant une ligne du type :</p>
<p>&nbsp;</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">mon_utilisateur ALL= NOPASSWD: /etc/init.d/transmission-daemon</pre></div></div>

<p>&nbsp;</p>
<p>De même que pour la première solution on mettra ce script dans une tache cron (à la semaine par exemple)</p>
<p>&nbsp;</p>
<p>Pour finir quelques mots sur les listes de blocage.</p>
<p>Transmission supporte les formats P2P Plaintext (Nom:IP_Début:IP_Fin) et DAT (format binaire non éditable)</p>
<p>On pourra trouver des listes de blocage P2P sur les sites suivants :</p>
<ul>
<li><a href="http://tbg.iblocklist.com/">http://tbg.iblocklist.com/</a></li>
<li> <a href="http://iblocklist.com/lists.php">http://iblocklist.com/</a></li>
</ul>
<p>On recommande la liste de iblocklist de <a href="http://www.iblocklist.com/list.php?list=bt_level1">niveau 1</a> (IP impliqués dans la lutte contre le piratage)  en général et la liste de <a href="http://www.iblocklist.com/list.php?list=bt_level2">niveau 2 </a>(IP des sociétés en général, des laboratoires et proxy) éventuellement.</p>
<p>&nbsp;</p>
<p><em>Edit : </em>31/05/2011 : correction la variable d&#8217;environnement $USER n&#8217;est pas connu dans CRON, utilisation de $HOME à la place (mieux en plus)</p>
<p><span style="text-decoration: underline;"><em><strong>Sources : </strong></em></span></p>
<ul>
<li><a href="http://papillon-butineur.blogspot.com/2010/08/blocklists-avec-transmissionrecopie.html">Papillon-butineur: Blocklists avec Transmission</a> : source du script initial que j&#8217;ai modifié</li>
<li><a href="https://trac.transmissionbt.com/wiki/Blocklists">Blocklists – Transmission</a> : documentation officielle sur les blocklist</li>
<li><a href="https://trac.transmissionbt.com/wiki/Scripts/BlockListUpdater">Scripts/BlockListUpdater – Transmission</a> : script de mise à jour des blocklist (beaucoup moins évolué que celui de papillon-butineur)</li>
<li><a href="http://blog.shvetsov.com/2010/09/automatically-update-transmission-block.html">Random Stuff: Automatically update Transmission&#8217;s block list </a>: Script moins complet</li>
<li><a href="https://forum.transmissionbt.com/viewtopic.php?f=2&amp;t=9790&amp;sid=669acbc24cad9feef9355797fbf358fc">transmission-remote and blocklist-update</a> : script pour mettre à jour la blocklist</li>
</ul>
<p>Image par <a href="http://www.flickr.com/photos/louect/">Lou Ect</a> sous CC BY-NC-ND<strong><br />
 </strong></p>
]]></content:encoded>
			<wfw:commentRss>http://voidandany.free.fr/index.php/utiliser-des-listes-de-blocage-personnalisees-blocklist-avec-le-demon-transmission/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Installer et configurer Transmission en tant que démon</title>
		<link>http://voidandany.free.fr/index.php/installer-et-configurer-transmission-en-tant-que-demon/</link>
		<comments>http://voidandany.free.fr/index.php/installer-et-configurer-transmission-en-tant-que-demon/#comments</comments>
		<pubDate>Wed, 25 May 2011 15:13:05 +0000</pubDate>
		<dc:creator>voidAndAny</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[download]]></category>
		<category><![CDATA[torrent]]></category>
		<category><![CDATA[Transmission]]></category>

		<guid isPermaLink="false">http://voidandany.free.fr/?p=4022</guid>
		<description><![CDATA[Je fais les choses à l&#8217;envers, présentant une configuration précise de Transmission (Exécuter Transmission avec l’utilisateur de son choix et déplacer son fichier de configuration vers $HOME) avant son installation et sa configuration générique, mais bon&#8230; Le but est ici &#8230; <a href="http://voidandany.free.fr/index.php/installer-et-configurer-transmission-en-tant-que-demon/">Continuer la lecture <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://voidandany.free.fr/wp-content/uploads/5709517594_6fceb20d15.jpg"><img class="alignleft size-medium wp-image-4013" title="Transmission" src="http://voidandany.free.fr/wp-content/uploads/5709517594_6fceb20d15-199x300.jpg" alt="" width="199" height="300" /></a>Je fais les choses à l&#8217;envers, présentant une configuration précise de Transmission (<a title="Lien permanent vers Exécuter Transmission avec l’utilisateur de son choix et déplacer son fichier de configuration vers $HOME" rel="bookmark" href="../index.php/executer-transmission-avec-lutilisateur-de-son-choix-et-deplacer-son-fichier-de-configuration-vers-home/">Exécuter Transmission avec l’utilisateur de son choix et déplacer son fichier de configuration vers $HOME</a>) avant son installation et sa configuration générique, mais bon&#8230;</p>
<p>Le but est ici d&#8217;installer le client torrent Transmission et de le paramétrer sur une machine headless (pas d&#8217;interface graphique, pas d&#8217;écran, accessible par SSH) comme le <a title="Marques-pages : Un mini serveur le Seagate Dockstar" href="http://voidandany.free.fr/index.php/marques-pages-un-mini-serveur-le-seagate-dockstar/">Dockstar</a></p>
<p>&nbsp;</p>
<h2>Installation</h2>
<p>Pour installer Transmission, simple comme d&#8217;habitude :</p>

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

<p>Le paquet transmission-daemon installe le démon (service) comme son nom l&#8217;indique et met à disposition l&#8217;interface Web, transmission-cli n&#8217;est à proprement parler pas nécessaire pour le fonctionnement de transmission, il met à disposition l&#8217;utilitaire transmission-remote très pratique pour interagir avec Transmission par script (pratique pour automatiser certaines taches que je décrirais dans une autre article)</p>
<p>&nbsp;</p>
<h2>Paramétrage</h2>
<p>Tout d&#8217;abord avant d&#8217;attaquer la configuration proprement dite de Transmission, on va créer les répertoires destinés à accueillir et classer les fichiers.</p>
<p>Chez tout est rangé dans un répertoire /data/downloads/torrents, ce dernier contient 4 sous-répertoires :</p>
<ul>
<li>watch : répertoire surveillé par Transmission, tout fichier .torrent placé ici sera automatiquement ajouté à Transmission et le téléchargement débutera</li>
<li>downloading : répertoire contenant les fichiers en cours de téléchargement (fichiers renommés avec l&#8217;extension .part car incomplets)</li>
<li>seeding : les fichiers une fois finis de téléchargés seront déplacés ici et y resteront tout le temps qu&#8217;il seront en partage (jusqu&#8217;a ce que le ratio soit atteint)</li>
<li>complete : les fichiers téléchargés ayant atteint le ratio de partage seront déplacés ici (pas réalisé par Transmission mais par script, objet d&#8217;un autre article)</li>
</ul>
<p>&nbsp;</p>
<p>Le paramétrage du démon Transmission se fait dans un fichier settings.json.</p>
<p>Par défaut sous Debian, Transmission est lancé avec un utilisateur debian-transmission mais il est peut être intéressant de changer cet utilisateur par son propre utilisateur et de déplacer le fichier de configuration de /etc/transmission-daemon vers le répertoire $HOME de cet utilisateur, pour cela se reporter à <a title="Lien permanent vers Exécuter Transmission avec l’utilisateur de son choix et déplacer son fichier de configuration vers $HOME" rel="bookmark" href="../index.php/executer-transmission-avec-lutilisateur-de-son-choix-et-deplacer-son-fichier-de-configuration-vers-home/">Exécuter Transmission avec l’utilisateur de son choix et déplacer son fichier de configuration vers $HOME</a></p>
<p><strong>Avant d&#8217;éditer le fichier de configuration il est important d&#8217;arrêter le démon</strong>, ce dernier écrivant sa configuration à son arrêt vous risqueriez de perdre votre paramétrage.</p>
<p>Éditez votre fichier de configuration /etc/transmission-daemon/settings.json ou $HOME/.config/transmission-daemon/settings.json ce dernier au format <a href="http://fr.wikipedia.org/wiki/JavaScript_Object_Notation">JSON</a> contient un ensemble de pair clé/valeur :</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">{
 &quot;alt-speed-down&quot;: 50,
 &quot;alt-speed-enabled&quot;: false,
 &quot;alt-speed-time-begin&quot;: 540,
 ...
 &quot;upload-limit-enabled&quot;: 0,
 &quot;upload-slots-per-torrent&quot;: 4
}</pre></div></div>

<p>La description des ces paramètres est disponible sur le Wiki de Transmission (<a href="https://trac.transmissionbt.com/wiki/EditConfigFiles">EditConfigFiles – Transmission</a>), mais voici ma traduction de ceux que j&#8217;utilise classés par catégories :</p>
<h3>Répertoires :</h3>
<p>Conformément à la structure de répertoire décrite ci-dessus on réalise le paramétrage suivant.</p>
<ul>
<li>incomplete-dir : &laquo;&nbsp;/data/downloads/torrents/downloading&nbsp;&raquo;</li>
<li>incomplete-dir-enabled : true</li>
<li>download-dir : &laquo;&nbsp;/data/downloads/torrents/seeding&nbsp;&raquo;</li>
<li>watch-dir : &laquo;&nbsp;/data/downloads/torrents/watch&nbsp;&raquo;</li>
<li>watch-dir-enabled : true</li>
</ul>
<p>incomplete-dir indique le répertoire où sont stockés les fichiers en cours de téléchargement et incomplete-dir-enabled active cette fonctionnalité (sinon ces fichiers sont stockés dans le répertoire download-dir)</p>
<p>download-dir contient le répertoire où sont stockés les fichiers en cours de partage et terminés (nous verrons dans un autre article comment déplacer les fichier terminés vers un autre répertoire)</p>
<p>watch-dir contient le répertoire scruté pour ajout automatique de téléchargement par dépôt de fichier .torrent (fonctionnalité activé par watch-dir-enabled)</p>
<p>Quelques paramétrages associés :</p>
<ul>
<li>start-added-torrents : true</li>
<li>trash-original-torrent-files : true</li>
<li>rename-partial-files : true</li>
</ul>
<p>start-added-torrents, indique qu&#8217;il faut directement démarrer le téléchargement de torrents ajoutés.</p>
<p>trash-original-torrent-files supprime les fichiers .torrent du répertoire watch-dir après qu&#8217;ils aient été pris en compte</p>
<p>rename-partial-files indique que les fichiers encours de téléchargement doivent avoir une extension .part. Pas utile dans mon cas puisque ces derniers sont déjà dans une répertoire à part, mais cela ne fait pas de mal.</p>
<h3>Réseau :</h3>
<ul>
<li>peer-port : xxx</li>
<li>peer-port-random-high : 65535</li>
<li>peer-port-random-low : 49152</li>
<li>peer-port-random-on-start : false</li>
</ul>
<p>peer-port contient le port d&#8217;écoute de Transmission, il faut que ce port soit ouvert sur votre routeur, peer-port-random-on-start indique que Transmission ne choisi aps son port de façon aléatoire et écoute donc toujours sur le port peer-port. Dès lors les paramètres peer-port-random-high et peer-port-random-low sont inutiles</p>
<h3>Partage :</h3>
<ul>
<li>ratio-limit : 1.0000</li>
<li>ratio-limit-enabled : true</li>
</ul>
<p>Transmission partage le fichiers jusqu’à ce que le ratio (quantité téléchargée / quantité partagée) paramétré dans ratio-limit soit atteint (ratio-limit-enabled : activation de la fonctionnalité)</p>
<p>Si on laisse ratio-limit-enabled: false, Transmission ignorera le paramètre ratio-limit et partagera le fichier infiniment (enfin jusqu’à ce que vous l&#8217;enleviez)</p>
<p>Un ratio de 1 est un minimum, car il indique que vous partagez autant que vous téléchargez</p>
<h3>Accès distant :</h3>
<ul>
<li>rpc-authentication-required : true</li>
<li>rpc-bind-address : &laquo;&nbsp;0.0.0.0&#8243;</li>
<li>rpc-enabled : true</li>
<li>rpc-password : &laquo;&nbsp;xxxx&nbsp;&raquo;</li>
<li>rpc-port : 9091</li>
<li>rpc-username : &laquo;&nbsp;xxxx&nbsp;&raquo;</li>
<li>rpc-whitelist : &laquo;&nbsp;127.0.0.1&#8243;</li>
<li>rpc-whitelist-enabled : false</li>
</ul>
<p><a href="http://fr.wikipedia.org/wiki/Remote_procedure_call">RPC veut dire Remote Procedure Call</a> autrement dit cela permet l&#8217;accès à distance à un service. Dans le cas de Transmission cela paramétre l&#8217;accès au démon par l&#8217;interface Web (fournis par défaut avec le démon) mais aussi à tous les autres services distants (par exemple client lourd distant <a href="http://code.google.com/p/transmisson-remote-gui/">transmission-remote-gui</a>)</p>
<p>On active le service avec rpc-enabled et on active la connexion par login / mot de passe (rpc-authentication-required / rpc-username / rpc-password)</p>
<p>Concernant rpc-password on met le mot de passe en clair et lors de la prise en compte du fichier de configuration par Transmission ce dernier crypte le mot de passe</p>
<p>rpc-port défini le port d&#8217;écoute, ainsi si on saisie dans la barre d&#8217;adresse de son navigateur l&#8217;adresse IP du serveur hébergeant Transmission sur la port 9091 on arrive sur l&#8217;interface Web.</p>
<p>Enfin il est possible de paramétrer une liste d&#8217;adresse IP autorisé à se connecter en RPC avec les options rpc-whitelist-enabled et rpc-whitelist. Je n&#8217;utilise pour l&#8217;instant pas cette option.</p>
<h3>Vitesses :</h3>
<p>Sur Transmission il est possible de gérer 2 modes de vitesse (normal et alternatif : alt)  et ce pour le téléchargement et l&#8217;upload.</p>
<p>La bascule entre ces 2 modes est aussi paramétrable selon les jours et les heures.</p>
<p>Concrètement on peut déterminer d&#8217;avoir ou pas de limite de vitesse en mode normal et d&#8217;autres limites de vitesse (ou pas) dans le mode alternatif.</p>
<p>Dans l&#8217;exemple suivant en mode normal il n&#8217;y aucune limite de vitesse ni en téléchargement speed-limit-down-enabled  (dès lors speed-limit-down est inutile) ni en upload speed-limit-up (speed-limit-up-enabled inutile).</p>
<p>Par contre on active le mode alternatif (alt-speed-enabled) et sa planification (alt-speed-time-enabled).</p>
<p>Entre 9h du matin (alt-speed-time-begin, 540 nombre minute depuis minuit = 9*60) et 23h (alt-speed-time-end, 1380 = 23*60 minutes) tous les jours de la semaine (cf. <a href="https://trac.transmissionbt.com/wiki/EditConfigFiles#Scheduling">Scheduling</a>) on limite le téléchargement (alt-speed-down) et l&#8217;upload (alt-speed-up)</p>
<p>Dès lors la bande passante est préservée durant les heures &laquo;&nbsp;d&#8217;éveil&nbsp;&raquo; rendant possible/agréable la navigation sur Internet tandis que durant la nuit Transmission télécharge à fond&#8230;.</p>
<ul>
<li>speed-limit-down : 100</li>
<li>speed-limit-down-enabled : false</li>
<li>speed-limit-up : 40</li>
<li>speed-limit-up-enabled : false</li>
<li>alt-speed-down : 50</li>
<li>alt-speed-enabled : true</li>
<li>alt-speed-time-begin : 540</li>
<li>alt-speed-time-day : 127</li>
<li>alt-speed-time-enabled : true</li>
<li>alt-speed-time-end : 1380</li>
<li>alt-speed-up : 50</li>
</ul>
<p>On verra dans un prochain article comment rendre ce système de mode normal / alternatif encore plus performant en ne le planifiant pas mais en basculant entres les 2 modes selon le besoin&#8230;</p>
<h3>Sécurité :</h3>
<ul>
<li>blocklist-enabled : true</li>
</ul>
<p>Active le blocage des adresse IP, Transmission télécharge à intervalle régulier la liste des adresses IP de niveau 1 appartenant à des sociétés et des associations et les bloquent.</p>
<p>Inutile quand on a rien a se reprocher&#8230;</p>
<p>&nbsp;</p>
<h3>Autres paramétrages non utilisés :</h3>
<ul>
<li>bind-address-ipv4 : &laquo;&nbsp;0.0.0.0&#8243;</li>
<li>bind-address-ipv6 :  &laquo;&nbsp;::&nbsp;&raquo;</li>
<li>dht-enabled : true</li>
<li>encryption : 1</li>
<li>lazy-bitfield-enabled : true</li>
<li>lpd-enabled : false</li>
<li>message-level : 2</li>
<li>open-file-limit : 32</li>
<li>peer-limit-global : 240</li>
<li>peer-limit-per-torrent : 60</li>
<li>peer-socket-tos : 0</li>
<li>pex-enabled : true</li>
<li>port-forwarding-enabled : false</li>
<li>preallocation : 1</li>
<li>proxy : &laquo;&nbsp;&nbsp;&raquo;</li>
<li>proxy-auth-enabled : false</li>
<li>proxy-auth-password : &laquo;&nbsp;&nbsp;&raquo;</li>
<li>proxy-auth-username : &laquo;&nbsp;&nbsp;&raquo;</li>
<li>proxy-enabled : false</li>
<li>proxy-port : 80</li>
<li>proxy-type : 0</li>
<li>script-torrent-done-enabled : false</li>
<li>script-torrent-done-filename : &laquo;&nbsp;&nbsp;&raquo;</li>
<li>upload-slots-per-torrent : 4</li>
<li>umask : 18  (en décimal = 22 en octal)</li>
</ul>
<p>Il y a même des paramètres qui sont obsolètes car remplacés par d&#8217;autres</p>
<ul>
<li>download-limit : 100</li>
<li>download-limit-enabled : 0</li>
<li>upload-limit : 100</li>
<li>upload-limit-enabled : 0</li>
<li>max-peers-global : 200</li>
</ul>
<p>&nbsp;</p>
<p><em><span style="text-decoration: underline;">Sources :</span><br />
 </em></p>
<ul>
<li><a href="http://www.transmissionbt.com/">Transmission</a> : Site officiel </li>
<li><a href="http://www.transmissionbt.com/resources/">Transmission</a> : Liste de plugins sur le site officiel</li>
<li><a href="https://trac.transmissionbt.com/wiki/EditConfigFiles">EditConfigFiles – Transmission</a> : Description des option du fichier settings.json sur le site officiel</li>
<li><a href="http://1000umbrellas.com/2010/10/04/updated-transmission-installationconfiguration-on-ubuntu-server">Updated: Transmission Installation/Configuration on Ubuntu Server &#8211; 1000umbrellas.com</a> : Exemple de configuration et manipulations à effectuer sur les  répertoires accueillant les torrents si vous laissez Transmission  tourner avec l&#8217;utilisateur debian-transmission</li>
<li><a href="http://www.d3vinside.fr/blog/installer-et-configurer-le-package-transmission-daemon-sous-debian-11">devINSIDE :: Blog :: Installer et configurer le package transmission-daemon sous debian</a> : configuration de base + interaction avec un Vhost apache (intérêt ?)</li>
<li><a href="http://www.realpeace.fr/blog/2010/07/09/installation-transmission-remote-sur-ubuntu-server/">Installation Transmission daemon sur Ubuntu Server « Realpeace&#8217;s Blog</a> : installation et configuration + quelques clients Transmission</li>
<li><a href="http://www.hahadopi.eu/tuto/transmission-daemon-sur-sa-seedbox/">HaHadopi » Transmission-daemon sur sa seedbox</a> : installation et configuration</li>
<li><a href="http://blog.shk-desktop.com/1002-configurer-transmission-pour-laccess-distance-cli">Configurer Transmission pour l’access a distance (CLI) | Shtark.fr</a> : installation et configuration</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://voidandany.free.fr/index.php/installer-et-configurer-transmission-en-tant-que-demon/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Surveiller sa bande passante en ligne de commande</title>
		<link>http://voidandany.free.fr/index.php/surveiller-sa-bande-passante-en-ligne-de-commande/</link>
		<comments>http://voidandany.free.fr/index.php/surveiller-sa-bande-passante-en-ligne-de-commande/#comments</comments>
		<pubDate>Tue, 24 May 2011 20:42:50 +0000</pubDate>
		<dc:creator>voidAndAny</dc:creator>
				<category><![CDATA[Brèves]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[CLI]]></category>

		<guid isPermaLink="false">http://voidandany.free.fr/?p=4029</guid>
		<description><![CDATA[Article court pour présenter ma dernière trouvaille, un outil pour surveiller sa bande passante, pour connaitre son trafic réseau : Bandwith Monitor NG Pour l&#8217;installer il suffit d&#8217;ajouter le paquet bwm-ng et pour le lancer on lance la commande du &#8230; <a href="http://voidandany.free.fr/index.php/surveiller-sa-bande-passante-en-ligne-de-commande/">Continuer la lecture <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Article court pour présenter ma dernière trouvaille, un outil pour surveiller sa bande passante, pour connaitre son trafic réseau :<a href="http://www.gropp.org/?id=projects&amp;sub=bwm-ng"> Bandwith Monitor NG</a></p>
<p>Pour l&#8217;installer il suffit d&#8217;ajouter le paquet <strong>bwm-ng</strong> et pour le lancer on lance la commande du même nom (bwm-ng)</p>
<p><a href="http://voidandany.free.fr/wp-content/uploads/Sélection_00515.png"><img class="alignleft size-full wp-image-4030" title="Bandwidth Monitor NG" src="http://voidandany.free.fr/wp-content/uploads/Sélection_00515.png" alt="" width="634" height="142" /></a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>Très pratique dans mon cas pour connaitre la vitesse de transfert réseau entre mon <a title="Marques-pages : Un mini serveur le Seagate Dockstar" href="http://voidandany.free.fr/index.php/marques-pages-un-mini-serveur-le-seagate-dockstar/">Dockstar</a> et ma Freebox lors d&#8217;une grosse copie que je trouvais particulièrement lente (et pour cause 2.5 Mo/s)</p>
]]></content:encoded>
			<wfw:commentRss>http://voidandany.free.fr/index.php/surveiller-sa-bande-passante-en-ligne-de-commande/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Exécuter Transmission avec l&#8217;utilisateur de son choix et déplacer son fichier de configuration vers $HOME</title>
		<link>http://voidandany.free.fr/index.php/executer-transmission-avec-lutilisateur-de-son-choix-et-deplacer-son-fichier-de-configuration-vers-home/</link>
		<comments>http://voidandany.free.fr/index.php/executer-transmission-avec-lutilisateur-de-son-choix-et-deplacer-son-fichier-de-configuration-vers-home/#comments</comments>
		<pubDate>Mon, 23 May 2011 13:25:49 +0000</pubDate>
		<dc:creator>voidAndAny</dc:creator>
				<category><![CDATA[software]]></category>
		<category><![CDATA[Transmission]]></category>

		<guid isPermaLink="false">http://voidandany.free.fr/?p=4012</guid>
		<description><![CDATA[Fidèle à Deluge depuis mon arrivé sur Linux, je commence à lui faire des infidélités avec Transmission pour des raisons de dépendances (transmission-daemon : 8110 kB / deluge-common deluged : 48.9 MB). Sur mon Dockstar j&#8217;ai donc installé Transmission (je &#8230; <a href="http://voidandany.free.fr/index.php/executer-transmission-avec-lutilisateur-de-son-choix-et-deplacer-son-fichier-de-configuration-vers-home/">Continuer la lecture <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.flickr.com/photos/glimeend/5709517594/"><img class="alignleft size-medium wp-image-4013" title="5709517594_6fceb20d15" src="http://voidandany.free.fr/wp-content/uploads/5709517594_6fceb20d15-199x300.jpg" alt="" width="199" height="300" /></a>Fidèle à <a href="http://voidandany.free.fr/index.php/tag/deluge/">Deluge</a> depuis mon arrivé sur Linux, je commence à lui faire des infidélités avec <a href="http://transmissionbt.com/"><em>Transmission</em></a> pour des raisons de dépendances (transmission-daemon : 8110 kB / deluge-common deluged : 48.9 MB).</p>
<p>Sur mon <a title="Marques-pages : Un mini serveur le Seagate Dockstar" href="http://voidandany.free.fr/index.php/marques-pages-un-mini-serveur-le-seagate-dockstar/">Dockstar</a> j&#8217;ai donc installé Transmission (je réaliserais un article complet bientôt).</p>
<p>Par défaut sous <a title="Installer Debian sur le Seagate Dockstar" href="http://voidandany.free.fr/index.php/installer-debian-sur-le-seagate-dockstar/">Debian</a>, <strong>Transmission tourne avec le compte debian-transmission</strong> donc tous les fichiers téléchargés auront comme propriétaire ce compte ce qui peut poser des problème d&#8217;accès.</p>
<p>On peut <a href="http://1000umbrellas.com/2010/10/04/updated-transmission-installationconfiguration-on-ubuntu-server">palier à ce problème en jouant avec les groupes et les droits sur les fichiers / répertoires</a> mais je préfère <strong>faire tourner Transmission avec mon utilisateur</strong> directement.</p>
<p>Ci-dessous le cheminement et les explications qui m&#8217;ont permis de trouver la configuration à appliquer, si vous voulez directement aller aux paramétrages, <a href="#parametrage">c&#8217;est ici que cela se passe.</a></p>
<p>&nbsp;</p>
<p>Transmission est lancé (toujours sous Debian) via un <strong>script d&#8217;init qui contient le nom de l&#8217;utilisateur devant lancer le service</strong> :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">cat</span> <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>transmission-daemon <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #ff0000;">'USER'</span>
debian-transmission</pre></div></div>

<p>En première approche on se dit donc qu&#8217;il suffit de changer cette variable avec son utilisateur, mais en réalité ce n&#8217;est pas si simple car notre utilisateur n&#8217;a pas les droits d&#8217;accès sur le fichier de configuration de Transmission :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">ls</span> <span style="color: #660033;">-l</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>transmission-daemon<span style="color: #000000; font-weight: bold;">/</span>
 total <span style="color: #000000;">8</span>,0K
 <span style="color: #660033;">-rw-r--r--</span> <span style="color: #000000;">1</span> root                root                 <span style="color: #000000;">302</span> <span style="color: #000000;">18</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">10</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">2010</span> 00:<span style="color: #000000;">16</span> README.json
 <span style="color: #660033;">-rw-------</span> <span style="color: #000000;">1</span> debian-transmission debian-transmission <span style="color: #000000;">2</span>,1K <span style="color: #000000;">15</span><span style="color: #000000; font-weight: bold;">/</span>05<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">2011</span> <span style="color: #000000;">22</span>:<span style="color: #000000;">36</span> settings.json</pre></div></div>

<p>On peut en 2ème pensée se dire que l&#8217;on change les droits sur ce fichier pour que son propriétaire soit notre utilisateur. Cela marcherait mais c&#8217;est crade&#8230;</p>
<p>Le plus élégant consiste à faire en sorte que <strong>Transmission utilise un autre fichier de configuration qui serait placé dans le HOME</strong> de notre utilisateur, d&#8217;autant que sur le <a href="https://trac.transmissionbt.com/wiki/ConfigFiles">Wiki de Transmission</a> il est indiqué que le démon va lire sa configuration dans $HOME/.config/transmission-daemon</p>
<p>Tout d&#8217;abord<strong> pourquoi </strong>Transmission va lire sa configuration dans /etc/transmission-daemon/ ?</p>
<p>Si on lance htop, on constate que Transmission est lancé avec une option &#8211;config-dir :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>transmission-daemon <span style="color: #660033;">--config-dir</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>transmission-daemon<span style="color: #000000; font-weight: bold;">/</span>info<span style="color: #000000; font-weight: bold;">/</span></pre></div></div>

<p>Si on va voir dans le répertoire sus-mentionné on constate alors que le fichier setting.json est un lien symbolique vers celui présent dans /etc/transmission-daemon/ :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">ls</span> <span style="color: #660033;">-la</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>transmission-daemon<span style="color: #000000; font-weight: bold;">/</span>info<span style="color: #000000; font-weight: bold;">/</span>
lrwxrwxrwx <span style="color: #000000;">1</span> root                root                  <span style="color: #000000;">38</span> <span style="color: #000000;">15</span><span style="color: #000000; font-weight: bold;">/</span>05<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">2011</span>  <span style="color: #000000;">22</span>:<span style="color: #000000;">19</span> settings.json -<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>transmission-daemon<span style="color: #000000; font-weight: bold;">/</span>settings.json</pre></div></div>

<p>Voila pour le pourquoi, maintenant <strong>comment modifier</strong> ce comportement ?</p>
<p>Le script d&#8217;init étant bien fait il utilise un fichier default qui est inclus et qui défini une variable OPTIONS qui contient l&#8217;argument &#8211;config-dir.</p>
<p>Si on édite le fichier default de Transmission et que l&#8217;on supprime la variable OPTIONS, Transmission retrouvera son comportement par défaut et cherchera sa configuration d&#8217;abord dans le HOME de l’utilisateur puis ensuite dans /etc/transmission-daemon.</p>
<p>&nbsp;</p>
<p><a name="parametrage"></a>Donc <strong>pour changer l&#8217;utilisateur par défaut et &laquo;&nbsp;déplacer&nbsp;&raquo; son fichier de configuration</strong> voici les étapes du paramétrage.</p>
<p>Stopper Transmission :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <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>transmission-daemon stop</pre></div></div>

<p>Éditer le fichier default du script d&#8217;init :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">vim</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>default<span style="color: #000000; font-weight: bold;">/</span>transmission-daemon</pre></div></div>

<p>Mettre la ligne OPTIONS en commentaire :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#OPTIONS=&quot;--config-dir $CONFIG_DIR&quot;</span></pre></div></div>

<p>Éditer le script d&#8217;init</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">vim</span> <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>transmission-daemon</pre></div></div>

<p>Changer l&#8217;utilisateur démarrant le service en modifiant la ligne USER :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #007800;">USER</span>=mon_utilisateur <span style="color: #666666; font-style: italic;">#debian-transmission</span></pre></div></div>

<p>Copier le fichier de configuration vers le HOME de notre utilisateur (et mettre à jour les droits) :</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: #660033;">-p</span> <span style="color: #007800;">$HOME</span><span style="color: #000000; font-weight: bold;">/</span>.config<span style="color: #000000; font-weight: bold;">/</span>transmission-daemon
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>transmission-daemon<span style="color: #000000; font-weight: bold;">/</span>settings.json <span style="color: #007800;">$HOME</span><span style="color: #000000; font-weight: bold;">/</span>.config<span style="color: #000000; font-weight: bold;">/</span>transmission-daemon<span style="color: #000000; font-weight: bold;">/</span>
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">chown</span> mon_utilisateur:mon_utilisateur <span style="color: #007800;">$HOME</span><span style="color: #000000; font-weight: bold;">/</span>.config<span style="color: #000000; font-weight: bold;">/</span>transmission-daemon<span style="color: #000000; font-weight: bold;">/</span> <span style="color: #660033;">-R</span></pre></div></div>

<p>Modifier éventuellement la configuration</p>
<p>Re-démarrer Transmission</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <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>transmission-daemon start</pre></div></div>

<p>&nbsp;</p>
<p><span style="text-decoration: underline;"><em><strong>Source : </strong></em></span></p>
<ul>
<li><a href="http://www.transmissionbt.com/">Transmission</a> : Site officiel </li>
<li><a href="http://1000umbrellas.com/2010/10/04/updated-transmission-installationconfiguration-on-ubuntu-server">Updated: Transmission Installation/Configuration on Ubuntu Server &#8211; 1000umbrellas.com</a> : Exemple de configuration et manipulations à effectuer sur les  répertoires accueillant les torrents si vous laissez Transmission  tourner avec l&#8217;utilisateur debian-transmission</li>
<li><a href="http://www.d3vinside.fr/blog/installer-et-configurer-le-package-transmission-daemon-sous-debian-11">devINSIDE :: Blog :: Installer et configurer le package transmission-daemon sous debian</a> : configuration de base + interaction avec un Vhost apache (intérêt ?)</li>
<li><a href="http://www.realpeace.fr/blog/2010/07/09/installation-transmission-remote-sur-ubuntu-server/">Installation Transmission daemon sur Ubuntu Server « Realpeace&#8217;s Blog</a> : installation et configuration + quelques clients Transmission</li>
<li><a href="http://www.hahadopi.eu/tuto/transmission-daemon-sur-sa-seedbox/">HaHadopi » Transmission-daemon sur sa seedbox</a> : installation et configuration</li>
<li><a href="http://blog.shk-desktop.com/1002-configurer-transmission-pour-laccess-distance-cli">Configurer Transmission pour l’access a distance (CLI) | Shtark.fr</a> : installation et configuration</li>
</ul>
<p>Photo par <strong id="yui_3_3_0_3_13061580003051438"> </strong><strong id="yui_3_3_0_3_13061580003051438"><a href="http://www.flickr.com/photos/glimeend/">Jesper2cv</a> </strong>sous CC BY-ND</p>
]]></content:encoded>
			<wfw:commentRss>http://voidandany.free.fr/index.php/executer-transmission-avec-lutilisateur-de-son-choix-et-deplacer-son-fichier-de-configuration-vers-home/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Paramétrages NGINX</title>
		<link>http://voidandany.free.fr/index.php/parametrages-nginx/</link>
		<comments>http://voidandany.free.fr/index.php/parametrages-nginx/#comments</comments>
		<pubDate>Mon, 23 May 2011 09:59:19 +0000</pubDate>
		<dc:creator>voidAndAny</dc:creator>
				<category><![CDATA[software]]></category>
		<category><![CDATA[dockstar]]></category>
		<category><![CDATA[nginx]]></category>

		<guid isPermaLink="false">http://voidandany.free.fr/?p=3730</guid>
		<description><![CDATA[Après avoir installé NGINX il convient de le configurer, paramétrer, sécuriser, optimiser. Pour l&#8217;instant j&#8217;utilise NGINX uniquement pour servir du contenu privé protégé par mot de passe, je n&#8217;ai donc que peu accentué mon paramétrage sur la sécurité. &#160; Paramétrage &#8230; <a href="http://voidandany.free.fr/index.php/parametrages-nginx/">Continuer la lecture <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Après avoir <a title="Installer un serveur web (nginx) sur le Seagate Dockstar" href="http://voidandany.free.fr/index.php/installer-un-serveur-web-nginx-sur-le-seagate-dockstar/">installé NGINX</a> il convient de le configurer, paramétrer, sécuriser, optimiser.</p>
<p>Pour l&#8217;instant j&#8217;utilise NGINX uniquement pour servir du <a title="Restreindre l’accès d’un site, d’un répertoire avec Nginx" href="http://voidandany.free.fr/index.php/restreindre-lacces-dun-site-dun-repertoire-avec-nginx/">contenu privé protégé par mot de passe</a>, je n&#8217;ai donc que peu accentué mon paramétrage sur la sécurité.</p>
<p>&nbsp;</p>
<h2>Paramétrage du nombre de process</h2>
<p>Dans son article <a href="http://www.it-wars.com/?article193/seagate-dockstar-1er-mois-d-exploitation">Seagate DockStar : 1er mois d&#8217;exploitation</a> Vincent Rabah indique qu&#8217;il a paramétré son Dockstar qui héberge son blog avec 3 workers process nginx et 5 cgi children process.</p>
<p>Par contre dans l&#8217;article <a href="http://blog.shk-desktop.com/617-nginx-configuration-complete">nginx: configuration complète | Shtark.fr</a> il est conseillé de ne pas dépasser 2 pour les worker process.</p>
<p>J&#8217;ai pour ma part choisi peu de process car de toute façon mon serveur NGINX sera peu sollicité car utilisé que par un nombre restreint d&#8217;utilisateurs :</p>
<ul>
<li>2 workers process nginx (paramétré dans /etc/nginx/nginx.conf)</li>
<li>2 cgi children process (paramétré dans /etc/init.d/php5-fcgi)</li>
</ul>
<ul>
</ul>
<p>&nbsp;</p>
<h2>Compression gzip</h2>
<p>Sous apache il s&#8217;agit du <a href="http://httpd.apache.org/docs/2.3/fr/mod/mod_deflate.html">module deflate</a> sous NGINX il s&#8217;appelle <strong> </strong><a rel="nofollow" href="http://wiki.nginx.org/HttpGzipModule">HTTP gzip.</a></p>
<p>La configuration se fait dans /etc/nginx/nginx.conf :</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">gzip            on;
# désactivation de la compression pour les navigateur ne la prenant pas en charge (IE &lt; 6)
gzip_disable    &quot;MSIE [1-6].(?!.*SV1)&quot;;
gzip_vary       on;
gzip_comp_level 3;
gzip_proxied    any;
gzip_buffers    16 8k;
gzip_types text/plain text/html text/css application/json  application/x-javascript text/xml application/xml application/xml+rss  text/javascript;</pre></div></div>

<p>&nbsp;</p>
<p>Pour le détail des différentes directive se reporter au manuel NGINX pour <a href="http://wiki.nginx.org/HttpGzipModule">HttpGzipModule</a></p>
<p>&nbsp;</p>
<p>La dernière directive (<a href="http://wiki.nginx.org/HttpGzipModule#gzip_types">gzip_types</a>) indique les types de fichiers servis par NGINX qui peuvent prétendre à la compression GZIP, c&#8217;est à dire tous les ficheirs de type texte pour lesquels la compression sera effective (il est inutile de compression une image jpeg qui est déjà compressée)</p>
<p>Cette directive est importante parce que par défaut <a href="http://blog.slucas.fr/blog/nginx-gzip-css-js">seul le type mime text/html est paramétré</a> (pas les css ni les js).</p>
<p>&nbsp;</p>
<p>Le réglage peut se faire sur la directive <a href="http://wiki.nginx.org/HttpGzipModule#gzip_comp_level">gzip_comp_level</a> qui permet de régler le taux de compression (entre 1 et 9), trop faible la compression ne sera pas très importante et trop élevé elle consommera des ressource lors de l&#8217;envoi des données</p>
<p>On peut connaitre le taux de compression via le site http://www.whatsmyip.org/http_compression/qui outre le fait d&#8217;indiquer si votre navigateur réclame du contenu compressé :</p>
<p style="text-align: center;"><strong><a href="http://voidandany.free.fr/wp-content/uploads/Sélection_00314.png"><img class="aligncenter" title="Sélection_003" src="http://voidandany.free.fr/wp-content/uploads/Sélection_00314.png" alt="" width="361" height="39" /></a></strong></p>
<p>Indique le taux de compression pour une page donnée :</p>
<p style="text-align: center;"><strong><a href="../wp-content/uploads/S%C3%A9lection_00415.png"><img class="aligncenter" title="Sélection_004" src="../wp-content/uploads/S%C3%A9lection_00415.png" alt="" width="491" height="133" /></a></strong></p>
<p>&nbsp;</p>
<h2>Mise en cache client des ressources statiques</h2>
<p>Il s&#8217;agit d&#8217;une directive indiquant au navigateur du client de mettre en cache les ressources statique que l&#8217;on défini (fichiers images, js, etc.).</p>
<p>Ainsi si l&#8217;utilisateur retourne une nouvelle fois sur la page/site le navigateur affichera la ressources statique qu&#8217;il a en cache au lei de la redemander au serveur Web.</p>
<p>Mon installation à partir du script de <a title="Installer un serveur web (nginx) sur le Seagate Dockstar" href="../index.php/installer-un-serveur-web-nginx-sur-le-seagate-dockstar/">Nicolargo</a>, positionne la directive <a href="http://wiki.nginx.org/HttpHeadersModule#expires">expires</a> dans le default-site pour les ressources statiques :</p>
<pre>location ~* ^.+\.(jpg|jpeg|gif|css|png|js|xml)$ {
	expires 	30d;
	access_log	off;
}</pre>
<p>Le gain est très important et peu être visible avec le site http://www.webpagetest.org/ qui permet d&#8217;analyser le temps de chargement d&#8217;une page.</p>
<p>Le site réalise 2 chargements successifs de la même page et le gain est flagrant (test fait sur une page contenant beaucoup d&#8217;images) :</p>
<table id="tableResults" border="1" cellspacing="0" cellpadding="10" align="center">
<tbody>
<tr>
<th align="center" valign="middle">
</th>
<th colspan="3" align="center" valign="middle">
</th>
<th colspan="3" align="center" valign="middle">Document Complete</th>
<th colspan="3" align="center" valign="middle">Fully Loaded</th>
</tr>
<tr>
<th align="center" valign="middle">
</th>
<th align="center" valign="middle">Load Time</th>
<th align="center" valign="middle">First Byte</th>
<th align="center" valign="middle">Start Render</th>
<th align="center" valign="middle">Time</th>
<th align="center" valign="middle">Requests</th>
<th align="center" valign="middle">Bytes In</th>
<th align="center" valign="middle">Time</th>
<th align="center" valign="middle">Requests</th>
<th align="center" valign="middle">Bytes In</th>
</tr>
<tr>
<td align="left" valign="middle">First View</td>
<td id="fvLoadTime" valign="middle">25.426s</td>
<td id="fvTTFB" valign="middle">5.912s</td>
<td id="fvStartRender" valign="middle">6.745s</td>
<td id="fvDocComplete" valign="middle">25.426s</td>
<td id="fvRequestsDoc" valign="middle">167</td>
<td id="fvBytesDoc" valign="middle">1,066 KB</td>
<td id="fvFullyLoaded" valign="middle">25.426s</td>
<td id="fvRequests" valign="middle">167</td>
<td id="fvBytes" valign="middle">1,066 KB</td>
</tr>
<tr>
<td align="left" valign="middle">Repeat View</td>
<td id="rvLoadTime" valign="middle">7.241s</td>
<td id="rvTTFB" valign="middle">5.963s</td>
<td id="rvStartRender" valign="middle">6.081s</td>
<td id="rvDocComplete" valign="middle">7.241s</td>
<td id="rvRequestsDoc" valign="middle">1</td>
<td id="rvBytesDoc" valign="middle">7 KB</td>
<td id="rvFullyLoaded" valign="middle">7.241s</td>
<td id="rvRequests" valign="middle">1</td>
<td id="rvBytes" valign="middle">7 KB</td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
<h2>Modification de la signature du serveur</h2>
<p>Dans les en-têtes HTTP et les pages d&#8217;erreur NGINX indique son nom et la version utilisée:</p>
<p style="text-align: center;"><a href="http://voidandany.free.fr/wp-content/uploads/Sélection_00216.png"><img class="aligncenter" title="Sélection_002" src="http://voidandany.free.fr/wp-content/uploads/Sélection_00216.png" alt="" width="290" height="106" /></a></p>
<p>Cela facilite le travail des pirates qui peuvent cibler les serveurs/versions présentant une faille de sécurité.</p>
<p>La signature du serveur sera donc réduite à “nginx” avec la directive <a href="http://wiki.nginx.org/HttpCoreModule#server_tokens">server_tokens</a> à off :</p>
<p style="text-align: center;"><a href="http://voidandany.free.fr/wp-content/uploads/Sélection_00118.png"><img class="aligncenter" title="Sélection_001" src="http://voidandany.free.fr/wp-content/uploads/Sélection_00118.png" alt="" width="284" height="97" /></a></p>
<h2>Fichiers de log</h2>
<p>Afin de surveiller plus précisément les accès aux différents service privés que mon Dockstar héberge j&#8217;ai choisi de faire un fichier de log d&#8217;accès par service/répertoire/location.</p>
<p>J&#8217;ai donc une ligne <a href="http://wiki.nginx.org/HttpLogModule#access_log">access_log</a> dans chacun de mes blocs location :</p>
<pre>location images/ {
	...
	access_log	/var/log/nginx/images.access.log;
	...
}</pre>
<p>Je n&#8217;ai pas personnalisé le format des logs par défaut (nommé combined) avec la directive <a href="http://wiki.nginx.org/HttpLogModule#log_format"> log_format</a>.</p>
<p>Ce format le voici :</p>
<div dir="ltr">
<div>
<pre>log_format combined '$remote_addr - $remote_user [$time_local]  '
                    '"$request" $status $body_bytes_sent '
                    '"$http_referer" "$http_user_agent"';</pre>
</div>
</div>
<p>Ce qui donne par exemple :</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">192.168.1.254 - user [11/Apr/2011:21:56:29 +0200] &quot;GET /test/phpinfo.php HTTP/1.1&quot; 200 9766 &quot;http://www.monDomaine.fr/test/&quot; &quot;Mozilla/5.0 (X11; Linux i686; rv:2.0) Gecko/20100101 Firefox/4.0&quot;</pre></div></div>

<p>&nbsp;</p>
<p>Pour finir avec les logs à noter qu&#8217;il est possible de spécifier sur les logs d&#8217;erreur le niveau de détail avec la directive <a href="http://wiki.nginx.org/NginxCoreModule#error_log">error_log</a> :</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">error_log  /logs/nginx_error.log  warn;</pre></div></div>

<p>&nbsp;</p>
<p>Le niveaux sont debug | info | notice | warn | error | crit | alert | emerg | off</p>
<p>Par défaut le niveau est warn.</p>
<p>&nbsp;</p>
<h2>Divers</h2>
<h3>Favicon et 404</h3>
<p>Lorsque l&#8217;on a pas de <a href="http://fr.wikipedia.org/wiki/Favicon"><em>Favicon</em></a><em> </em>sur son site NGINX log régulièrement des <a href="http://fr.wikipedia.org/wiki/Erreur_HTTP_404"><em>Erreurs</em> HTTP <em>404</em></a></p>
<p>Pour y remédier il suffit d&#8217;ajouter ceci dans sa configuration :</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">location = /favicon.ico {
 access_log       off;
 return   204;
 }</pre></div></div>

<p>A voir :<a title="Permanent link to Boost your nginx web server performance by rewriting favicon.ico requests correctly" rel="bookmark" href="http://www.megaburst.com/boost-your-nginx-web-server-performance-byrewriting-favicon-ico-requests-correctly/"> Boost your nginx web server performance by rewriting favicon.ico requests correctly</a></p>
<p>&nbsp;</p>
<h3>Configurations communes</h3>
<p>Pour mutualiser divers éléments de configuration sur les différents site hébergé par mon serveur NGINX, j&#8217;ai créé un fichier /etc/nginx/common.conf contenant ces configurations.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># Sécurité : les fichiers en .ht sont interdits d'accès
 location ~ /\.ht {
 deny  all;
 }
&nbsp;
# Erreur 404 sur Favicon
 location = /favicon.ico {
 access_log       off;
 return   204;
 }
&nbsp;
# Mise ne cache des ressources statiques
location ~* ^.+\.(jpg|jpeg|gif|css|png|js|xml)$ {
 expires         30d;
 access_log      off;
 }</pre></div></div>

<p>&nbsp;</p>
<p>Il me suffit ensuite d’inclure ce fichier dans la configuration de chacun de mes sites :</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">include /etc/nginx/common.conf;</pre></div></div>

<p>&nbsp;</p>
<p><strong>Redirection sous domaine </strong></p>
<p>Pour faire une redirection d&#8217;un sous-répertoire du domaine parent vers son propre sous-domaine voici la configuration utilisée.</p>
<p>Par exemple pour rediriger http://www.mondomaine.fr/application vers http://application.mondomaine.fr :</p>
<p>
<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">location /application {
 rewrite ^/application/?(.*) $scheme://application.mondomaine.fr/$1 permanent;
 }</pre></div></div>

</p>
<p>&nbsp;</p>
<h2>Autres paramétrages pas encore effectués</h2>
<p>(et peut être jamais effectués sur le Dockstar)</p>
<ul>
<li>Personnalisation des pages d&#8217;erreurs (4xx, 5xx) : <a href="http://blog.shk-desktop.com/617-nginx-configuration-complete">nginx: configuration complète | Shtark.fr</a></li>
<li>Utilisation d&#8217;un socket Unix pour la communication NGINX &#8211; php fastcgi : je n&#8217;ai pas très bien compris l&#8217;utilité et l&#8217;intérêt de la chose : <a title="blog:nginx-php-unix-socket" href="http://blog.slucas.fr/blog/nginx-php-unix-socket">Nginx PHP Fastcgi avec socket Unix</a></li>
<li>Mise en place d&#8217;un page de maintenance et configuration dans NGINX : <a href="http://blog.shk-desktop.com/617-nginx-configuration-complete">nginx: configuration complète | Shtark.fr</a>.</li>
<li>Mise en cache du php compilé : <a href="http://www.it-wars.com/?article225/nginx-fastcgi-optimisation">Nginx fastcgi optimisation</a>, <a href="http://blog.slucas.fr/blog/php-xcache#php_xcache">PHP XCache</a></li>
<li>Interdire l&#8217;accès au bots : <a href="http://blog.shk-desktop.com/617-nginx-configuration-complete">nginx: configuration complète | Shtark.fr</a>, <a title="Permanent Link: Start django with nginx" rel="bookmark" href="http://www.alrond.com/en/2007/mar/01/start-django-with-nginx/">Start django with nginx</a>, <a href="http://www.cyberciti.biz/tips/linux-unix-bsd-nginx-webserver-security.html">Top 20 Nginx WebServer Best Security Practices</a> (point #12)</li>
<li>Sécurisation de NGINX : <a href="https://calomel.org/nginx.html">Nginx &laquo;&nbsp;how to&nbsp;&raquo; &#8211; Fast and Secure Web Server (nginx.conf) @ Calomel.org &#8211; Open Source Research and Reference</a> et <a href="http://www.cyberciti.biz/tips/linux-unix-bsd-nginx-webserver-security.html">Top 20 Nginx WebServer Best Security Practices</a></li>
</ul>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://voidandany.free.fr/index.php/parametrages-nginx/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Choix de la langue de correction orthographique pas sauvegardé sous Firefox</title>
		<link>http://voidandany.free.fr/index.php/choix-de-la-langue-de-correction-orthographique-pas-sauvegardee-sous-firefox/</link>
		<comments>http://voidandany.free.fr/index.php/choix-de-la-langue-de-correction-orthographique-pas-sauvegardee-sous-firefox/#comments</comments>
		<pubDate>Thu, 12 May 2011 08:47:47 +0000</pubDate>
		<dc:creator>voidAndAny</dc:creator>
				<category><![CDATA[software]]></category>
		<category><![CDATA[firefox]]></category>

		<guid isPermaLink="false">http://voidandany.free.fr/?p=3958</guid>
		<description><![CDATA[Sur mon Firefox 4 la correction orthographique des zones de texte se faisait toujours en anglais et ce malgré la localisation Française de mon Firefox et l&#8217;installation des dictionnaires Français : Je devais alors choisir la langue de correction orthographique &#8230; <a href="http://voidandany.free.fr/index.php/choix-de-la-langue-de-correction-orthographique-pas-sauvegardee-sous-firefox/">Continuer la lecture <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Sur mon Firefox 4 la <strong>correction orthographique</strong> des zones de texte se faisait <strong>toujours en anglais </strong>et ce malgré la <a title="Mettre Firefox 4 en français (+ dictionnaires)" href="http://voidandany.free.fr/index.php/mettre-firefox-4-en-francais-dictionnaires/">localisation Française de mon Firefox et l&#8217;installation des dictionnaires Français</a> :</p>
<p style="text-align: center;"><a href="http://voidandany.free.fr/wp-content/uploads/Sélection_00120.png"><img class="aligncenter size-full wp-image-3959" style="border: 1px solid black;" title="Sélection_001" src="http://voidandany.free.fr/wp-content/uploads/Sélection_00120.png" alt="" width="624" height="72" /></a></p>
<p>Je devais alors choisir la langue de correction orthographique (clic droits dans la zone, Langues &gt; Fançais /France)</p>
<p><a href="http://voidandany.free.fr/wp-content/uploads/Sélection_00315.png"><img class="aligncenter size-medium wp-image-3961" title="Sélection_003" src="http://voidandany.free.fr/wp-content/uploads/Sélection_00315-300x256.png" alt="" width="300" height="256" /> </a></p>
<p>Le problème c&#8217;est que cette manipulation n&#8217;était pas sauvegardée, j&#8217;étais obligé de la refaire à chaque démarrage de Firefox.</p>
<p>Pour corriger ce problème je me suis rendu sur la page de <strong>configuration de Firefox</strong>, pour cela saisir <strong>about:config</strong> dans la barre d&#8217;adresse et accepter l&#8217;avertissement de sécurité.</p>
<p>Filtrer les paramètres avec le mot-clé &laquo;&nbsp;spell&nbsp;&raquo;, dans mon cas voici les paramètres correspondants au filtre :</p>
<p><a href="http://voidandany.free.fr/wp-content/uploads/Sélection_00218.png"><img class="aligncenter size-large wp-image-3960" title="Sélection_002" src="http://voidandany.free.fr/wp-content/uploads/Sélection_00218-650x152.png" alt="" width="640" height="149" /></a>Les lignes en gras indiquent les paramètres modifiées par rapport aux valeur par défaut.</p>
<p>J&#8217;ai <strong>ré-initialisé</strong> le paramètre <strong>spellchecking.dictionnary</strong> (ne me demandez pas pourquoi celle-ci) à sa valeur par défaut, pour cela clic droit sur la ligne, réinitialiser.</p>
<p>Le paramètre à alors pris la <strong>valeur&nbsp;&raquo;fr&nbsp;&raquo;</strong></p>
<p>J&#8217;ai ensuite <strong>choisi la langue de correction orthographique &laquo;&nbsp;Fançais /France&nbsp;&raquo;</strong>, clic droits dans une zone de texte, Langues &gt; Fançais /France (cf. copie écran ci-dessus)</p>
<p>Les paramètres contenant &laquo;&nbsp;spell&nbsp;&raquo; avaient alors ces valeurs :</p>
<p><a href="http://voidandany.free.fr/wp-content/uploads/Sélection_00514.png"><img class="aligncenter size-large wp-image-3963" title="Sélection_005" src="http://voidandany.free.fr/wp-content/uploads/Sélection_00514-650x151.png" alt="" width="640" height="148" /></a>Et miracle au démarrage suivant de Firefox la langue de correction orthographique était encore le Français.</p>
<p>&nbsp;</p>
<p><span style="text-decoration: underline;"><em><strong>Rque :</strong></em></span> il doit être possible de corriger ce problème en éditant le fichier prefs.js présent dans son profil. En effet avant mes manipulations décrites ci-dessus il contenait les 2 lignes suivantes :</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">user_pref(&quot;spellchecker.dictionary&quot;, &quot;en_US&quot;);
user_pref(&quot;spellchecking.dictionary&quot;, &quot;fr_FR&quot;);</pre></div></div>

<p>Et plus qu&#8217;une avec une valeur différente après les modifications :</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">user_pref(&quot;spellchecker.dictionary&quot;, &quot;fr_FR&quot;);</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://voidandany.free.fr/index.php/choix-de-la-langue-de-correction-orthographique-pas-sauvegardee-sous-firefox/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
