<?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>Renoir Boulanger &#187; Tutoriels</title>
	<atom:link href="http://renoirboulanger.com/blog/tag/tutoriels/feed/" rel="self" type="application/rss+xml" />
	<link>http://renoirboulanger.com</link>
	<description>Un geek social et Linuxien de nature</description>
	<lastBuildDate>Thu, 08 Sep 2011 18:02:22 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Comment remplacer les caract√®res bizzares dans WordPress lorsqu&#8217;on a mal fait la conversion</title>
		<link>http://renoirboulanger.com/blog/2010/06/comment-remplacer-les-caracteres-bizzares-dans-wordpress-lorsqu-on-a-mal-fait-la-conversion/</link>
		<comments>http://renoirboulanger.com/blog/2010/06/comment-remplacer-les-caracteres-bizzares-dans-wordpress-lorsqu-on-a-mal-fait-la-conversion/#comments</comments>
		<pubDate>Fri, 11 Jun 2010 01:07:40 +0000</pubDate>
		<dc:creator>Renoir Boulanger</dc:creator>
				<category><![CDATA[Techniques]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[p52]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[sc]]></category>
		<category><![CDATA[Tutoriels]]></category>

		<guid isPermaLink="false">http://renoirboulanger.com/?p=2232</guid>
		<description><![CDATA[Comment remplacer les caract√®res bizzares dans WordPress lorsqu&#8217;on a mal fait la conversionAccrocheur mon titre n&#8217;est-ce pas? Je trouve ça tellement pas drôle lorsque ça m&#8217;arrive ce genre de situation avec les caractères accentués. Le problème n&#8217;arrive pas tout le temps qu&#8217;avec WordPress. 
Voici, enfin, une suite a mon billet Pourquoi tout ces caractères bizzares. [...]]]></description>
			<content:encoded><![CDATA[<a href='http://renoirboulanger.com/blog/2010/06/comment-remplacer-les-caracteres-bizzares-dans-wordpress-lorsqu-on-a-mal-fait-la-conversion/' class='retweet '  style='display:block;margin:10px 0px;' >Comment remplacer les caract√®res bizzares dans WordPress lorsqu&#8217;on a mal fait la conversion</a><p>Accrocheur mon titre n&#8217;est-ce pas? Je trouve ça tellement pas drôle lorsque ça m&#8217;arrive ce genre de situation avec les caractères accentués. Le problème n&#8217;arrive pas tout le temps qu&#8217;avec WordPress. </p>
<p>Voici, enfin, une suite a mon billet <a href="http://renoirboulanger.com/blog/2009/09/pourquoi-tout-ces-caracteres-bizzares/">Pourquoi tout ces caractères bizzares</a>.  Je devais travailler sur un problème de conversion de caractères pour un client dus a une conversion non réussie et/ou terminée entre <tt>latin1</tt> et <tt>utf-8</tt> puis je me suis remis a penser a ce problème. Pourquoi ne pas le régler, et documenter! </p>
<p>Voilà pourquoi ce billet <img src='http://renoirboulanger.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<h3>La situation</h3>
<p>Mon cas était bien simple. J&#8217;avait mal fait ma sauvegarde lors d&#8217;un transfert et j&#8217;avait tout mes commentaires, billets, et autres données qui avait des accents &#8220;<tt>transform√©s comme √áa</tt>&#8221; (transformés comme ça).</p>
<p>Ce genre de problème arrive pour toutes sortes de raisons. Mais le symptôme est le même. Si vous avez des<br />
Je partage avec vous mon bout de code a «copier-coller» dans <tt>phpmyadmin</tt> pour votre blogue WordPress si vous avez ces problèmes (oubliez-pas de faire des sauvegardes là(!)).</p>
<p>Plusieurs tutoriels existent pour régler la situation mais mon cas était assez unique. J&#8217;ai conservé le problème puis j&#8217;ai publié plusieurs billets (qui sortent bien) et laissé ceux &#8220;<tt>ab√Æm√©s</tt>&#8221; là. <strong>Il n&#8217;était plus question d&#8217;extraire, convertir et ré-importer</strong>.</p>
<h3>Pourquoi?!</h3>
<p>C&#8217;est une réponse assez complexe. L&#8217;article <a href="http://tikiwiki.org/UTF-8"><strong>UTF-8</strong> sur TikiWiki.org</a> l&#8217;explique en détail.</p>
<blockquote><p>In short, UTF-8 is a character encoding that uses 1 to 3 bytes for each character.<br />
It is one of the existing character encodings of the UCS (Universal Character Set), that contains nearly a hundred thousand abstract characters (including ASCII characters).</p>
<p>UTF-8 greatly simplifies the task of internationalization by replacing multiple alternative encodings (such as ISO8859-15 Latin-9, which encodes those English, French, German, Spanish and Portuguese characters not available in ASCII).</p></blockquote>
<p>En simple, le UTF-8 est un format d&#8217;encodage qui utilise 1 a 3 bytes pour chaque caractère. C&#8217;est un format d&#8217;encodage qui comprend près de plusieurs centaines de milliers de caractères (Incluant ceux du ASCII).</p>
<p>UTF-8 est fait pour contenir tout les caractères existants pour simplifier l&#8217;internationalisation. </p>
<p>C&#8217;est un standard qui est pas nécessairement jeune mais qui n&#8217;était pas non plus supporté partout.</p>
<p>MySQL a commencé a le supporter qu&#8217;a partir de la version 4.1.</p>
<p>Ce qui arrive c&#8217;est qu&#8217;avec le temps, les gens prennent de plus en plus soin de rendre accessible pour toutes les langues leur applications. Ainsi un russe pourrait écrire en cyrillic et un Japonais en Kanji dans la même base de donnée. Le coup est difficile! Surtout que les versions de MySQL et PHP et Java offrent maintenant le choix par défaut en UTF-8&#8230; lorsqu&#8217;on fait pas attention: on se fait coincer!</p>
<p><span id="more-2232"></span></p>
<h3>Comment j&#8217;ai opéré</h3>
<p>Comme il n&#8217;y a pas que WordPress qui peut avoir ce type de problème j&#8217;ai fait un petit script qui génère pour chaque table et colone affectée. J&#8217;ai passé dans chaque table et colone où je voyait des choses bizzares et j&#8217;ai représenté dans un array a deux dimensions. Avec cette méthode on peut faire la même chose avec n&#8217;importequel schéma de base de donnée.</p>
<h4>Exemple: Représenter les tables et les colones</h4>
<p>Avec ce format, en exemple, j&#8217;ai représenté les tables (<tt>wp_posts</tt>, etc&#8230;) et chaque array représente une colone où des caractères accentués sont mal convertis.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$tables</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
        <span style="color: #0000ff;">'wp_posts'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'post_content'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'post_title'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'post_excerpt'</span><span style="color: #009900;">&#41;</span>
        <span style="color: #339933;">,</span><span style="color: #0000ff;">'wp_usermeta'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'meta_value'</span><span style="color: #009900;">&#41;</span>
        <span style="color: #339933;">,</span><span style="color: #0000ff;">'wp_term_taxonomy'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'description'</span><span style="color: #009900;">&#41;</span>
        <span style="color: #339933;">,</span><span style="color: #0000ff;">'wp_comments'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'comment_content'</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<h3>Utiliser le script</h3>
<p>Le script a été utilisé pratiquement tel quel sur ma base de donnée WordPress de ce site. </p>
<p>Seuls ajustements a faire. </p>
<ul>
<li>Remplacer les &#8220;&lt;&nbsp;pre&nbsp;&gt;&#8221; par &#8220;&lt;pre&gt;&#8221;. Vous comprenez le principe <img src='http://renoirboulanger.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </li>
<li>Afficher le contenu généré via un serveur Web avec PHP installé</li>
<li>Aller dans <tt>phpmyadmin</tt>, <strong>faire une copie de la base de donnée à affecter</strong> (Voir dans onglet &#8220;<tt>Opérations</tt>&#8221; et &#8220;<tt>Copier la base de données vers:  </tt>&#8220;)</li>
<li>Aller dans cette base de donnée là dans phpmyadmin (!!)</li>
<li>Exécuter le code généré (copier-coller) dans la fenêtre <tt>SQL</tt> de la base de donnée de tests</li>
<li>Faire pareil avec la vraie si vous êtes satisfaits du résultat</li>
</ul>
<h4>Le code</h4>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #990000;">header</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Content-type:text/html;charset=utf8'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$tables</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
        <span style="color: #0000ff;">'wp_posts'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'post_content'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'post_title'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'post_excerpt'</span><span style="color: #009900;">&#41;</span>
        <span style="color: #339933;">,</span><span style="color: #0000ff;">'wp_usermeta'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'meta_value'</span><span style="color: #009900;">&#41;</span>
        <span style="color: #339933;">,</span><span style="color: #0000ff;">'wp_term_taxonomy'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'description'</span><span style="color: #009900;">&#41;</span>
        <span style="color: #339933;">,</span><span style="color: #0000ff;">'wp_comments'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'comment_content'</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$chars</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
 <span style="color: #990000;">bin2hex</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'√Ä'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'|À'</span><span style="color: #339933;">,</span>
 <span style="color: #990000;">bin2hex</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'√¥'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'|ô'</span><span style="color: #339933;">,</span>
 <span style="color: #990000;">bin2hex</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'√Ç'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'|â'</span><span style="color: #339933;">,</span>
 <span style="color: #990000;">bin2hex</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'√á'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'|ç'</span><span style="color: #339933;">,</span>
 <span style="color: #990000;">bin2hex</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'√©'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'|é'</span><span style="color: #339933;">,</span>
 <span style="color: #990000;">bin2hex</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'√â'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'|É'</span><span style="color: #339933;">,</span>
 <span style="color: #990000;">bin2hex</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'√†'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'|à'</span><span style="color: #339933;">,</span>
 <span style="color: #990000;">bin2hex</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'√®'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'|è'</span><span style="color: #339933;">,</span>
 <span style="color: #990000;">bin2hex</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'√™'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'|ê'</span><span style="color: #339933;">,</span>
 <span style="color: #990000;">bin2hex</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'√¢'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'|â'</span><span style="color: #339933;">,</span>
 <span style="color: #990000;">bin2hex</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'‚Äô'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'|‘'</span><span style="color: #339933;">,</span>
 <span style="color: #990000;">bin2hex</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'¬´'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'|«'</span><span style="color: #339933;">,</span>
 <span style="color: #990000;">bin2hex</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'¬ª'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'|»'</span><span style="color: #339933;">,</span>
 <span style="color: #990000;">bin2hex</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'√ß'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'|ç'</span><span style="color: #339933;">,</span>
 <span style="color: #990000;">bin2hex</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'√π'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'|ù'</span><span style="color: #339933;">,</span>
 <span style="color: #990000;">bin2hex</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'√ª'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'|û'</span><span style="color: #339933;">,</span>
 <span style="color: #990000;">bin2hex</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'√Æ'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'|î'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$tables</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$table</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$elements</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
  <span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$elements</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$col</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$chars</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$char</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$elc</span> <span style="color: #339933;">=</span> <span style="color: #990000;">explode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'|'</span><span style="color: #339933;">,</span><span style="color: #000088;">$char</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$update_line</span><span style="color: #339933;">.=</span> <span style="color: #0000ff;">'update '</span><span style="color: #339933;">.</span><span style="color: #000088;">$table</span><span style="color: #339933;">.</span><span style="color: #0000ff;">' set '</span><span style="color: #339933;">.</span><span style="color: #000088;">$col</span><span style="color: #339933;">.</span><span style="color: #0000ff;">' = REPLACE('</span><span style="color: #339933;">.</span><span style="color: #000088;">$col</span><span style="color: #339933;">.</span><span style="color: #0000ff;">', UNHEX(\''</span><span style="color: #339933;">.</span><span style="color: #000088;">$elc</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'\'), \''</span><span style="color: #339933;">.</span><span style="color: #000088;">$elc</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;">'\') ;'</span><span style="color: #339933;">.</span>PHP_EOL<span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
  <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt; pre &gt;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$update_line</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&lt; / pre &gt;'</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://renoirboulanger.com/blog/2010/06/comment-remplacer-les-caracteres-bizzares-dans-wordpress-lorsqu-on-a-mal-fait-la-conversion/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Procédure pour créer un serveur FTP sécurisé SSL forcé avec usager virtuels sous Ubuntu Linux avec vsFTPd</title>
		<link>http://renoirboulanger.com/blog/2010/04/procedure-pour-creer-un-serveur-ftp-securise-ssl-force-avec-usager-virtuels-sous-ubuntu-linux-avec-vsftpd/</link>
		<comments>http://renoirboulanger.com/blog/2010/04/procedure-pour-creer-un-serveur-ftp-securise-ssl-force-avec-usager-virtuels-sous-ubuntu-linux-avec-vsftpd/#comments</comments>
		<pubDate>Fri, 30 Apr 2010 19:12:12 +0000</pubDate>
		<dc:creator>Renoir Boulanger</dc:creator>
				<category><![CDATA[Techniques]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[p52]]></category>
		<category><![CDATA[Sécurite]]></category>
		<category><![CDATA[Tutoriels]]></category>
		<category><![CDATA[UNIX]]></category>

		<guid isPermaLink="false">http://renoirboulanger.com/?p=2162</guid>
		<description><![CDATA[Procédure pour créer un serveur FTP sécurisé SSL forcé avec usager virtuels sous Ubuntu Linux avec vsFTPdJe ne sais pas si vous êtes comme moi mais je n&#8217;aime pas laisser non crypté l&#8217;accès a un service qui me demande un mot de passe. Je devait monter un serveur cette semaine qui doit avoir les accès [...]]]></description>
			<content:encoded><![CDATA[<a href='http://renoirboulanger.com/blog/2010/04/procedure-pour-creer-un-serveur-ftp-securise-ssl-force-avec-usager-virtuels-sous-ubuntu-linux-avec-vsftpd/' class='retweet '  style='display:block;margin:10px 0px;' >Procédure pour créer un serveur FTP sécurisé SSL forcé avec usager virtuels sous Ubuntu Linux avec vsFTPd</a><p>Je ne sais pas si vous êtes comme moi mais je n&#8217;aime pas laisser non crypté l&#8217;accès a un service qui me demande un mot de passe. Je devait monter un serveur cette semaine qui doit avoir les accès FTP.</p>
<p>J&#8217;ai pris l&#8217;initiative de sécuriser la machine avec du SSL car je crois qu&#8217;aujourd&#8217;hui c&#8217;est notre devoir de faire ce genre de chose. Ce n&#8217;est pas la première fois que je configure un serveur FTP over SSL mais je n&#8217;avait jamais pris de notes vraiment à ce jour. Je l&#8217;ai fait cette fois-ci!</p>
<h3><a name="ComptesFTPvirtuel%28sansutilisateurlocal%29sousUbuntuavecvsFTPdetcryptoSSL-Cequecetteproc%C3%A9durefait..."></a>Ce que cette procédure fait&#8230;</h3>
<ol>
<li>Pouvoir créer des comptes FTP sans avoir a créer un utilisateur local (donc pas accès shell (SSH)).</li>
<li>Permet les connections FTP over SSL de façon EXPLICITE sur un port non standard  (cet exemple utilisera le port <tt>6123</tt>)</li>
<li>Ne permet pas d&#8217;utilisateur ni de connexions anonymes</li>
<li>Bannit les hôtes qui tentent de se connecter (LOGIN FAILED)	via <strong>fail2ban</strong></li>
<li>Utilise le system PAM interne pour l&#8217;authentification</li>
<li>Ne requiert pas d&#8217;usager local (pas de risque de tentative de connection SSH, usager séparés)</li>
<li>Le serveur FTP roule sur son propre usager</li>
</ol>
<p><span id="more-2162"></span></p>
<h3><a name="ComptesFTPvirtuel%28sansutilisateurlocal%29sousUbuntuavecvsFTPdetcryptoSSL-Proc%C3%A9dure"></a>Procédure</h3>
<ol>
<li>Vérifier quelle version de serveur FTP est installé

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># dpkg --list | grep ftp</span>
~
ii  <span style="color: #c20cb9; font-weight: bold;">ftp</span>                               <span style="color: #000000;">0.17</span>-<span style="color: #000000;">19</span>                      The FTP client
ii  lftp                              3.7.15-1ubuntu2              Sophisticated command-line FTP<span style="color: #000000; font-weight: bold;">/</span>HTTP client p
ii  vsftpd                            2.2.0-1ubuntu1               lightweight, efficient FTP server written fo</pre></td></tr></table></div>

<p><strong>Note</strong> vsftpd est ce qu&#8217;on veut. Dans ce cas-ci il est déjà installé (ii).</li>
<li>Assurer que les prérequis sont installés

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># aptitude install vsftpd libpam-pwdfile openssl</span></pre></td></tr></table></div>

</li>
<li>Modifier le fichier de config <strong>vsftpd.conf</strong>.<br />
<strong>Note</strong> Modifiez pour ces valeurs (ci-bas) et conservez les autres valeurs par défaut.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># vi /etc/vsftpd.conf</span>
~
<span style="color: #007800;">anonymous_enable</span>=NO
<span style="color: #007800;">local_enable</span>=YES
<span style="color: #007800;">write_enable</span>=YES
<span style="color: #007800;">local_umask</span>=022
<span style="color: #007800;">chroot_local_user</span>=YES
<span style="color: #007800;">ftpd_banner</span>=Un nom Quelconque FTP
<span style="color: #007800;">nopriv_user</span>=vsftpd
&nbsp;
<span style="color: #666666; font-style: italic;"># renoirboulanger.com 2010-04-29 we will force usage on an other port</span>
<span style="color: #666666; font-style: italic;">#connect_from_port_20=YES</span></pre></td></tr></table></div>

</li>
<li>Ajouter ou corriger (étaient pas présents lorsque j&#8217;ai crée la procédure)

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># 2010-04-28 accès usager</span>
<span style="color: #007800;">virtual_use_local_privs</span>=YES
<span style="color: #007800;">guest_enable</span>=YES
<span style="color: #007800;">user_sub_token</span>=<span style="color: #007800;">$USER</span>
<span style="color: #007800;">local_root</span>=<span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>ibottin<span style="color: #000000; font-weight: bold;">/</span>FTP<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$USER</span>
<span style="color: #007800;">hide_ids</span>=YES</pre></td></tr></table></div>

<p><strong>Note</strong> Ajuster le <tt>local_root</tt> a l&#8217;endroit	ou envoyer les fichiers.</li>
<li>Activer le SSL
<ol>
<li>Créer le certificat

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># cd /etc/ssl</span>
<span style="color: #666666; font-style: italic;"># /usr/bin/openssl req -x509 -nodes -days 365 -newkey rsa:1024 -keyout vsftpd.pem -out vsftpd.pem</span></pre></td></tr></table></div>

</li>
<li>Ajouter au <tt>/etc/vsftpd.conf</tt>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># vi /etc/vsftpd.conf</span>
~
<span style="color: #666666; font-style: italic;"># renoirboulanger.com 2010-04-30 SSL configuration</span>
<span style="color: #007800;">listen_port</span>=<span style="color: #000000;">6123</span>
<span style="color: #007800;">ftp_data_port</span>=<span style="color: #000000;">6122</span>
<span style="color: #007800;">pasv_min_port</span>=<span style="color: #000000;">6000</span>
<span style="color: #007800;">pasv_max_port</span>=<span style="color: #000000;">6100</span>
&nbsp;
<span style="color: #007800;">ssl_enable</span>=YES
<span style="color: #666666; font-style: italic;"># Allow anonymous users to use secured SSL connections</span>
<span style="color: #007800;">allow_anon_ssl</span>=YES
<span style="color: #666666; font-style: italic;"># All non-anonymous logins are forced to use a secure SSL connection in order to</span>
<span style="color: #666666; font-style: italic;"># send and receive data on data connections.</span>
<span style="color: #007800;">force_local_data_ssl</span>=NO
<span style="color: #666666; font-style: italic;"># All non-anonymous logins are forced to use a secure SSL connection in order to send the password.</span>
<span style="color: #007800;">force_local_logins_ssl</span>=YES
<span style="color: #007800;">ssl_tlsv1</span>=YES
<span style="color: #007800;">ssl_sslv2</span>=YES
<span style="color: #007800;">ssl_sslv3</span>=YES
<span style="color: #007800;">rsa_cert_file</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>vsftpd.pem</pre></td></tr></table></div>

</li>
</ol>
</li>
<li><strong>Remplacer</strong> le contenu du fichier <tt>pam.d/vsftpd</tt>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># vi /etc/pam.d/vsftpd</span>
~
auth required pam_pwdfile.so pwdfile <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>vsftpd.passwd
account required pam_permit.so</pre></td></tr></table></div>

<p><strong>Note</strong> Il est important de remplacer le reste du fichier par ce contenu ci-haut.</li>
<li>Modifier permissions sur le fichier .pem

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># chown vsftpd /etc/ssl/vsftpd.pem</span></pre></td></tr></table></div>

</li>
<li>Redémarrer vsftpd

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># /etc/init.d/vsftpd restart</span></pre></td></tr></table></div>

</li>
<li>Créer le unix user qui va rouler le démon

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># adduser --system --no-create-home --disabled-login -s /usr/sbin/nologin --home /var/ftp vsftpd</span></pre></td></tr></table></div>

</li>
<li>Modifier les permissions pour l&#8217;utilisateur qui roule vsftpd (ajuster)

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># chown -R ftp:ftp /var/ftp/</span>
<span style="color: #666666; font-style: italic;"># chmod -R 740 /var/ftp</span></pre></td></tr></table></div>

</li>
<li><strong><a href="http://renoirboulanger.com/blog/2010/04/procedure-pour-creer-un-serveur-ftp-securise-ssl-force-avec-usager-virtuels-sous-ubuntu-linux-avec-vsftpd#ComptesFTPvirtuel%28sansutilisateurlocal%29sousUbuntuavecvsFTPdetcryptoSSL-AjouterunutilisateurFTP">Ajouter un utilisateur FTP</a></strong></li>
<li>Ajuster <tt>fail2ban</tt>
<div class="code panel" style="border-width: 1px;">
<div class="codeHeader panelHeader" style="border-bottom-width: 1px;"><strong>Ajuster le bloc [vsftpd]</strong></div>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># vi /etc/fail2ban/jail.conf</span>
~
<span style="color: #7a0874; font-weight: bold;">&#91;</span>vsftpd<span style="color: #7a0874; font-weight: bold;">&#93;</span>
&nbsp;
enabled  = <span style="color: #c20cb9; font-weight: bold;">true</span></pre></td></tr></table></div>

<p><strong>Note</strong> par defaut <tt>enabled</tt> est a false&#8230;	il faut l&#8217;activer.</p>
</div>
</li>
<li>Redémarrer vsftpd

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># /etc/init.d/vsftpd restart</span>
 <span style="color: #000000; font-weight: bold;">*</span> Stopping FTP server: vsftpd
   ...done.
 <span style="color: #000000; font-weight: bold;">*</span> Starting FTP server: vsftpd
   ...done.
<span style="color: #666666; font-style: italic;"># ps aux|grep vsftpd</span>
vsftpd   <span style="color: #000000;">18771</span>  <span style="color: #000000;">0.0</span>  <span style="color: #000000;">0.0</span>  <span style="color: #000000;">28904</span>  <span style="color: #000000;">1300</span> ?        Ss   <span style="color: #000000;">17</span>:09   <span style="color: #000000;">0</span>:00 <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>vsftpd
vsftpd   <span style="color: #000000;">18772</span>  <span style="color: #000000;">0.0</span>  <span style="color: #000000;">0.0</span>  <span style="color: #000000;">29100</span>  <span style="color: #000000;">1608</span> ?        S    <span style="color: #000000;">17</span>:09   <span style="color: #000000;">0</span>:00 <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>vsftpd
<span style="color: #c20cb9; font-weight: bold;">ftp</span>      <span style="color: #000000;">18773</span>  <span style="color: #000000;">0.0</span>  <span style="color: #000000;">0.0</span>  <span style="color: #000000;">28928</span>   <span style="color: #000000;">924</span> ?        S    <span style="color: #000000;">17</span>:09   <span style="color: #000000;">0</span>:00 <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>vsftpd
root     <span style="color: #000000;">18795</span>  <span style="color: #000000;">0.0</span>  <span style="color: #000000;">0.0</span>  <span style="color: #000000;">22628</span>  <span style="color: #000000;">1712</span> ?        S    <span style="color: #000000;">17</span>:<span style="color: #000000;">14</span>   <span style="color: #000000;">0</span>:00 <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>vsftpd
...</pre></td></tr></table></div>

<p><strong>Note</strong> les deux premiers <tt>vsftpd</tt> est le résultat attendu</li>
<li>Nous allons forcer le FTP over SSL sur le port <strong>6122</strong>, pour ça il faut autoriser le Firewall

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># iptables -A INPUT -m state --state ESTABLISHED,RELATED</span>
<span style="color: #666666; font-style: italic;"># iptables -A INPUT -m tcp -p tcp --dport 6122 -j ACCEPT</span>
<span style="color: #666666; font-style: italic;"># iptables -A INPUT -m state --state NEW,ESTABLISHED</span>
<span style="color: #666666; font-style: italic;"># iptables -A INPUT -m tcp -p tcp --dport 6123 -j ACCEPT</span>
<span style="color: #666666; font-style: italic;"># iptables -A INPUT -p tcp --dport 6000:6100 -j ACCEPT</span></pre></td></tr></table></div>

<p><strong>Source</strong>: <a href="http://my.afterdawn.com/ketola/blog_entry.cfm/1262/vsftpd_ssl_and_iptables">vsftpd SSL and iptables</a></li>
<li>Sauvegarder le Firewall

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># iptables-save &amp;gt; /etc/iptables.rules</span></pre></td></tr></table></div>

</li>
<li>Tester de l&#8217;extérieur avec un client FTP (Filezilla, etc)
<p>Voir les options suivantes a la connection</p>
<ol>
<li>port: 6123</li>
<li>Forcer le SSL</li>
</ol>
</li>
</ol>
<h3><a name="ComptesFTPvirtuel%28sansutilisateurlocal%29sousUbuntuavecvsFTPdetcryptoSSL-AjouterunutilisateurFTP"></a>Ajouter un utilisateur FTP</h3>
<p>On utilise le truc simple de htpasswd pour l&#8217;authentification. Pas de gossage <img src='http://renoirboulanger.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<h3><a name="ComptesFTPvirtuel%28sansutilisateurlocal%29sousUbuntuavecvsFTPdetcryptoSSL-Cr%C3%A9erunnouveaucompte"></a>Créer un nouveau compte</h3>
<ol>
<li>Créer le <em>premier compte</em>, sinon, <strong>passer	a la directive suivante</strong>! ou Utiliser mon script <a href="http://renoirboulanger.com/blog/2010/04/procedure-pour-creer-un-serveur-ftp-securise-ssl-force-avec-usager-virtuels-sous-ubuntu-linux-avec-vsftpd#ComptesFTPvirtuel%28sansutilisateurlocal%29sousUbuntuavecvsFTPdetcryptoSSL-Scriptpourcr%C3%A9eruncompteutilisateur">Script pour créer un compte utilisateur</a>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># htpasswd -c /etc/vsftpd.passwd ftpuser</span>
New password:
Re-type new password:
Adding password <span style="color: #000000; font-weight: bold;">for</span> user ftpuser</pre></td></tr></table></div>

<p><strong>Note</strong> l&#8217;option <strong><tt>-c</tt></strong> est	pour créer le fichier la première fois.</li>
<li>Voir les directives de *<a href="http://renoirboulanger.com/blog/2010/04/procedure-pour-creer-un-serveur-ftp-securise-ssl-force-avec-usager-virtuels-sous-ubuntu-linux-avec-vsftpd#ComptesFTPvirtuel%28sansutilisateurlocal%29sousUbuntuavecvsFTPdetcryptoSSL-Scriptpourcr%C3%A9eruncompteutilisateur">Script pour créer un compte utilisateur</a></li>
</ol>
<h3><a name="ComptesFTPvirtuel%28sansutilisateurlocal%29sousUbuntuavecvsFTPdetcryptoSSL-Ajouteroumodifierunutilisateur"></a><strong>Ajouter ou modifier un utilisateur</strong></h3>
<ol>
<li>Utiliser le script <strong><tt>evo-vsftpd-user</tt></strong>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> evo-vsftpd-user foo
Création d<span style="color: #ff0000;">'un nouvel usager dans /etc/vsftpd.passwd ...
New password:
Re-type new password:
Adding password for user foo
 ... OK
 * Création du dossier /home/ibottin/FTP/foo ...  OK
 * Changement des permissions du dossier ...  OK
Terminé!</span></pre></td></tr></table></div>

<p>Voir les directives de <strong><a href="http://renoirboulanger.com/blog/2010/04/procedure-pour-creer-un-serveur-ftp-securise-ssl-force-avec-usager-virtuels-sous-ubuntu-linux-avec-vsftpd#ComptesFTPvirtuel%28sansutilisateurlocal%29sousUbuntuavecvsFTPdetcryptoSSL-Scriptpourcr%C3%A9eruncompteutilisateur">Script pour créer un compte utilisateur</a></strong></li>
</ol>
<h3><a name="ComptesFTPvirtuel%28sansutilisateurlocal%29sousUbuntuavecvsFTPdetcryptoSSL-Scriptpourcr%C3%A9eruncompteutilisateur"></a>Script pour créer un compte utilisateur</h3>
<ol>
<li>Créer le fichier

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># vi /usr/sbin/evo-vsftpd-user</span></pre></td></tr></table></div>

</li>
<li>Coller le contenu

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-z</span> $<span style="color: #000000;">1</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;Aucun argument usager fourni&quot;</span>
  <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;usage: sudo evo-vsftpd-user foo&quot;</span>
  <span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">1</span>;
<span style="color: #000000; font-weight: bold;">fi</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;">$(whoami)</span>&quot;</span> <span style="color: #000000; font-weight: bold;">!</span>= <span style="color: #ff0000;">'root'</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;Vous n'avez pas les permisions utilisateur requises.&quot;</span>
  <span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">1</span>;
<span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Création d'un nouvel usager dans /etc/vsftpd.passwd ... &quot;</span>
htpasswd <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>vsftpd.passwd $<span style="color: #000000;">1</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot; ... OK &quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-n</span> <span style="color: #ff0000;">&quot; * Création du dossier /home/ibottin/FTP/$1 ... &quot;</span>
<span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>ibottin<span style="color: #000000; font-weight: bold;">/</span>FTP<span style="color: #000000; font-weight: bold;">/</span>$<span style="color: #000000;">1</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot; OK&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-n</span> <span style="color: #ff0000;">&quot; * Changement des permissions du dossier ... &quot;</span>
<span style="color: #c20cb9; font-weight: bold;">chown</span> <span style="color: #660033;">-R</span> <span style="color: #c20cb9; font-weight: bold;">ftp</span>:<span style="color: #c20cb9; font-weight: bold;">ftp</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>ibottin<span style="color: #000000; font-weight: bold;">/</span>FTP<span style="color: #000000; font-weight: bold;">/</span>$<span style="color: #000000;">1</span>
<span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #660033;">-R</span> <span style="color: #000000;">740</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>ibottin<span style="color: #000000; font-weight: bold;">/</span>FTP<span style="color: #000000; font-weight: bold;">/</span>$<span style="color: #000000;">1</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot; OK&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Terminé!&quot;</span></pre></td></tr></table></div>

</li>
<li>Rendre exécutable

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># chmod +x /usr/sbin/evo-vsftpd-user</span></pre></td></tr></table></div>

</li>
</ol>
<h3><a name="ComptesFTPvirtuel%28sansutilisateurlocal%29sousUbuntuavecvsFTPdetcryptoSSL-Tester"></a>Tester</h3>
<ol>
<li>Installer le paquet pour tester
<div class="code panel" style="border-width: 1px;">
<div class="codeContent panelContent">

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># aptitude install ftp-ssl</span></pre></td></tr></table></div>

</div>
</div>
</li>
<li>Tester

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># ftp-ssl someserver.net 6123</span>
Connected to someserver.net.
<span style="color: #000000;">220</span> Un nom Quelconque FTP
Name <span style="color: #7a0874; font-weight: bold;">&#40;</span>someserver.net:renoirboulanger<span style="color: #7a0874; font-weight: bold;">&#41;</span>: ftpuser
<span style="color: #000000;">234</span> Proceed with negotiation.
<span style="color: #7a0874; font-weight: bold;">&#91;</span>SSL Cipher DES-XXXX-SHA<span style="color: #7a0874; font-weight: bold;">&#93;</span>
<span style="color: #000000;">331</span> Please specify the password.
Password:
<span style="color: #000000;">230</span> Login successful.
Remote system <span style="color: #7a0874; font-weight: bold;">type</span> is UNIX.
Using binary mode to transfer files.
<span style="color: #c20cb9; font-weight: bold;">ftp</span><span style="color: #000000; font-weight: bold;">&amp;</span>gt;</pre></td></tr></table></div>

<p><strong>Note</strong> [SSL Cipher DES-XXXX-SHA] est ce qu&#8217;on attend <img src='http://renoirboulanger.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </li>
</ol>
<h3><a name="ComptesFTPvirtuel%28sansutilisateurlocal%29sousUbuntuavecvsFTPdetcryptoSSL-Pourd%C3%A9boguer"></a>Pour déboguer</h3>
<p>Le feedback est assez difficile a avoir de la part de vsftpd, mais pour en voir plus:</p>
<ol>
<li>Pour le debug

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># vi /etc/vsftpd.conf</span>
~
<span style="color: #666666; font-style: italic;"># for debuging</span>
<span style="color: #007800;">log_ftp_protocol</span>=YES</pre></td></tr></table></div>

</li>
</ol>
<h3><a name="ComptesFTPvirtuel%28sansutilisateurlocal%29sousUbuntuavecvsFTPdetcryptoSSL-Ressources"></a>Ressources</h3>
<ul>
<li><a href="http://wjholden.com/vsftpd-help.html">vsftpd help</a></li>
<li><a href="http://vsftpd.beasts.org/vsftpd_conf.html">vsftpd.conf manpages</a></li>
<li><a href="http://my.afterdawn.com/ketola/blog_entry.cfm/1262/vsftpd_ssl_and_iptables">vsftpd SSL and iptables</a></li>
<li><a href="http://www.ubuntututorials.net/installing-vsftpd-using-text-file-for-virtual-users/">Installing vsftpd using text file for virtual users</a></li>
<li><a href="http://www.cyberciti.biz/tips/configure-vsfptd-secure-connections-via-ssl-tls.html">Vsftpd SSL / TLS FTP Server Configuration</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://renoirboulanger.com/blog/2010/04/procedure-pour-creer-un-serveur-ftp-securise-ssl-force-avec-usager-virtuels-sous-ubuntu-linux-avec-vsftpd/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Comment automatiser une tâche avec CRON en utilisant Vim</title>
		<link>http://renoirboulanger.com/blog/2010/04/comment-automatiser-une-tache-avec-cron-en-utilisant-vim/</link>
		<comments>http://renoirboulanger.com/blog/2010/04/comment-automatiser-une-tache-avec-cron-en-utilisant-vim/#comments</comments>
		<pubDate>Thu, 15 Apr 2010 00:45:52 +0000</pubDate>
		<dc:creator>Renoir Boulanger</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Open-Source]]></category>
		<category><![CDATA[Tutoriels]]></category>
		<category><![CDATA[UNIX]]></category>
		<category><![CDATA[Vocabulaire]]></category>
		<category><![CDATA[Vulgarisation]]></category>

		<guid isPermaLink="false">http://renoirboulanger.com/?p=2076</guid>
		<description><![CDATA[Comment automatiser une tâche avec CRON en utilisant VimDeux tâches vraiment essentielles qu&#8217;on fait en administrant une machine sous Linux sont très souvent de modifier/créer un fichier et de planifier des tâches de maintenance.
Pour utiliser «cron» il faut savoir utiliser «vi», les commandes sont très souvent les mêmes. Je dois spécifier que j&#8217;ai basé mon [...]]]></description>
			<content:encoded><![CDATA[<a href='http://renoirboulanger.com/blog/2010/04/comment-automatiser-une-tache-avec-cron-en-utilisant-vim/' class='retweet '  style='display:block;margin:10px 0px;' >Comment automatiser une tâche avec CRON en utilisant Vim</a><div id="attachment_2079" class="wp-caption alignright" style="width: 280px"><img class="size-full wp-image-2079 " title="Logo Vim" src="http://renoirboulanger.com/wp-content/uploads/2010/04/Vim_logo.png" alt="Vi - Vi.... Improved (amélioré)" width="270" height="270" /><p class="wp-caption-text">Logo Vim, qui signifie vi-improved (amélioré)</p></div>
<p>Deux tâches vraiment essentielles qu&#8217;on fait en administrant une machine sous Linux sont très souvent de modifier/créer un fichier et de planifier des tâches de maintenance.</p>
<p>Pour utiliser «<em>cron»</em> il faut savoir utiliser «<em>vi»</em>, les commandes sont très souvent les mêmes. Je dois spécifier que j&#8217;ai basé mon tutoriel sur CRON fourni par Ubuntu Linux qui est (de mémoire) le même paquet que celui fourni dans <a href="http://www.redhat.com/">Red Hat Linux</a>, <a href="http://www.debian.org/">Debian Linux</a> ou <a href="http://www.ubuntu.com/">Ubuntu Linux</a>.</p>
<p>Le but de ce billet est en fait de vous montrer sommairement comment automatiser une tâche (une commande) avec cron.</p>
<p>Je publierai plus tard un billet sur les différences entre les distributions de cron.</p>
<p><span id="more-2076"></span></p>
<h3>Utiliser vi (prérequis)</h3>
<p>Vi est un éditeur de texte en ligne de commande qui permet de faire bien des macros, il peut sembler compliquer mais l&#8217;essentiel se résume ainsi.</p>
<ul>
<li><strong>ESCAPE</strong> permet d&#8217;entrer une commande</li>
<blockquote>
<li><strong>i</strong> mode Insertion</li>
<li><strong>r</strong> mode remplacer le caractère courrant</li>
</blockquote>
<li><strong>SHIFT+a</strong> insérer a partir de la fin de la ligne courrante</li>
<li><strong>:</strong> entrer une commande spéciale</li>
<blockquote>
<li><strong>:wq</strong> sauvegarder le fichier et quitter l&#8217;éditeur</li>
<li><strong>:w</strong> sauvegarder le fichier courrant</li>
<li><strong>:10</strong> sauter a la 10e ligne du document</li>
</blockquote>
<li><strong>/text</strong> Chercher &#8216;text&#8217; dans le document courrant</li>
<blockquote>
<li><strong>n</strong> Chercher le prochain mon cherché (par rapport a ce qui a été dit ci-haut)</li>
</blockquote>
<li><strong>dd</strong> supprimer la ligne courrante</li>
<li><strong>5dd</strong> supprimer les 5 prochaines lignes</li>
</ul>
<p>source: <a href="http://matrix.samizdat.net/pratique/documentation/guide-survie-VI.html">Guide de survie VI</a></p>
<h3>Créer une tâche CRON</h3>
<p>Pour créer une tâche sur un système Linux il y a plusieurs méthodes possibles.</p>
<ol>
<li><a href="http://renoirboulanger.com/blog/2010/04/comment-automatiser-une-tache-avec-cron-en-utilisant-vim#crontab">Ajouter une ligne dans le «crontab», la table d&#8217;actions CRON</a></li>
<li><a href="http://renoirboulanger.com/blog/2010/04/comment-automatiser-une-tache-avec-cron-en-utilisant-vim#crond">Ajouter fichier avec directives dans /etc/cron.d/</a></li>
<li><a href="http://renoirboulanger.com/blog/2010/04/comment-automatiser-une-tache-avec-cron-en-utilisant-vim#etccron">Ajouter une ligne dans un des dossiers /etc/cron.daily/, /etc/cron.hourly/, /etc/cron.monthly</a></li>
</ol>
<h4><a name="crontab"></a>1. Ajouter une ligne dans le «crontab», la table d&#8217;actions CRON</h4>
<p>C&#8217;est fait soit en utilisant la commande crontab, ou en éditant le fichier /etc/crontab</p>
<p>crontab roule tout le temps en tant que root, et l&#8217;idéal serait d&#8217;utiliser un fichier dans /etc/cron.d/<br />
Savoir sur quel usager doit rouler la tâche (un user local qui peut rouler la commande, idéalement pas root!)</p>
<ul>
<li>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">someuser<span style="color: #000000; font-weight: bold;">@</span>ubuntu:~$ crontab <span style="color: #660033;">-e</span></pre></td></tr></table></div>

</li>
<li>l&#8217;éditeur vi va s&#8217;ouvrir</li>
<li>aller a l&#8217;endroit ou vous voulez éditer</li>
<li>créez une nouvelle ligne en Insert mode, en utilisant le i, ou a la fin de la ligne courrante en faisant CTRL+a</li>
<li>Entrer une ligne dans le format

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight: bold;">*</span> commande a être exé<span style="color: #c20cb9; font-weight: bold;">cut</span>ée
- - - - -
<span style="color: #000000; font-weight: bold;">|</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #000000; font-weight: bold;">|</span>
<span style="color: #000000; font-weight: bold;">|</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #000000; font-weight: bold;">|</span> +----- jour de la semaine <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">0</span> - <span style="color: #000000;">6</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #007800;">Dimanche</span>=<span style="color: #000000;">0</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #000000; font-weight: bold;">|</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #000000; font-weight: bold;">|</span> +------- mois <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">1</span> - <span style="color: #000000;">12</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #000000; font-weight: bold;">|</span> <span style="color: #000000; font-weight: bold;">|</span> +--------- jour dans le mois <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">1</span> - <span style="color: #000000;">31</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #000000; font-weight: bold;">|</span> +----------- heure <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">0</span> - <span style="color: #000000;">23</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
+------------- min <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">0</span> - <span style="color: #000000;">59</span><span style="color: #7a0874; font-weight: bold;">&#41;</span></pre></td></tr></table></div>

<p>exemple:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000;">30</span> <span style="color: #000000;">18</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>someuser<span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/*</span>  <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>someuser<span style="color: #000000; font-weight: bold;">/</span>cronlogs<span style="color: #000000; font-weight: bold;">/</span>clean_tmp_dir.log</pre></td></tr></table></div>

</li>
<li>&#8230; qui effacera le contenu de <tt>/home/someuser/tmp/</tt> a tout les 18h30 de tout les jours et qui log dans <tt>/home/someuser/cronlogs/clean_tmp_dir.log</tt></li>
<li>Pour quitter faites ESCAPE  :wq     pour write quit.</li>
</ul>
<p>source: <a href="http://adminschoice.com/crontab-quick-reference">Crontab Quick reference</a></p>
<h4><a name="crond"></a>2. Ajouter fichier avec directives dans /etc/cron.d/</h4>
<p>C&#8217;est le même principe sauf qu&#8217;il s&#8217;agit d&#8217;un fichier nommé, généralement sous le même nom que le package Linux qu&#8217;il dessert. Exemple php5 aurait son package.</p>
<p>Sauf qu&#8217;on peut spécifier qui lancera la commande.</p>
<p>Comment faire&#8230;</p>
<ul>
<li>Créer un fichier, ex:<br />
# vi /etc/cron.d/php5</li>
<li>Coller la commande qui a été testée au par avant

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">someuser<span style="color: #000000; font-weight: bold;">@</span>ubuntu:~$ <span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>someuser<span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/*</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>someuser<span style="color: #000000; font-weight: bold;">/</span>cronlogs<span style="color: #000000; font-weight: bold;">/</span>clean_tmp_dir.log</pre></td></tr></table></div>

</li>
<li>Ajouter une ligne, ESCAPE+i</li>
<li>Commencer par le moment de l&#8217;exécution comme avec «Ajouter une ligne dans le crontab»</li>
<li>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000;">30</span> <span style="color: #000000;">19</span>  <span style="color: #000000; font-weight: bold;">*</span>  <span style="color: #000000; font-weight: bold;">*</span>  <span style="color: #000000; font-weight: bold;">*</span></pre></td></tr></table></div>

</li>
<li>Ajouter le nom du username qui va rouler la commande</li>
<li>ex: someuser</li>
<li>Ajouter la commande testée tout a l&#8217;heure<br />
ex: rm /home/someuser/tmp/* > /home/someuser/cronlogs/clean_tmp_dir.log</li>
<li>Ce qui donnera:

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000;">30</span> <span style="color: #000000;">19</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight: bold;">*</span> someuser <span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>someuser<span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/*</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>someuser<span style="color: #000000; font-weight: bold;">/</span>cronlogs<span style="color: #000000; font-weight: bold;">/</span>clean_tmp_dir.log</pre></td></tr></table></div>

</li>
<li>Voilà!</li>
</ul>
<h4><a name="etccron"></a>3. Ajouter une ligne dans un des dossiers /etc/cron.daily/, /etc/cron.hourly/, /etc/cron.monthly</h4>
<p>Même concept que le crontab sauf que l&#8217;on a pas a mentionner quand exécuter, c&#8217;est /etc/crontab  qui dit qand les fichiers sont exécuté</p>
<h3>Sources</h3>
<ul>
<li><a href="http://adminschoice.com/crontab-quick-reference">Crontab Quick reference</a></li>
<li><a href="http://matrix.samizdat.net/pratique/documentation/guide-survie-VI.html">Guide de survie VI</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://renoirboulanger.com/blog/2010/04/comment-automatiser-une-tache-avec-cron-en-utilisant-vim/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Crash Course sur les environnements Java</title>
		<link>http://renoirboulanger.com/blog/2010/02/crash-course-sur-les-environnements-java/</link>
		<comments>http://renoirboulanger.com/blog/2010/02/crash-course-sur-les-environnements-java/#comments</comments>
		<pubDate>Thu, 25 Feb 2010 17:13:15 +0000</pubDate>
		<dc:creator>Renoir Boulanger</dc:creator>
				<category><![CDATA[Technologies]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[p52]]></category>
		<category><![CDATA[Tutoriels]]></category>
		<category><![CDATA[Vulgarisation]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://renoirboulanger.com/?p=1927</guid>
		<description><![CDATA[Crash Course sur les environnements JavaJe suis actuellement en mode &#8220;Documentation&#8221; et je me suis dit que le web pourrait profiter d&#8217;un résumé, en français, du Jargon de l&#8217;univers Java.
Je ne suis pas un développeur Java mais j&#8217;ai eu a administrer des serveurs pendant 4 ans, et j&#8217;en fais encore aujourd&#8217;hui. Ce document résume ma [...]]]></description>
			<content:encoded><![CDATA[<a href='http://renoirboulanger.com/blog/2010/02/crash-course-sur-les-environnements-java/' class='retweet '  style='display:block;margin:10px 0px;' >Crash Course sur les environnements Java</a><p>Je suis actuellement en mode &#8220;Documentation&#8221; et je me suis dit que le web pourrait profiter d&#8217;un résumé, en français, du Jargon de l&#8217;univers Java.</p>
<p>Je ne suis pas un développeur Java mais j&#8217;ai eu a administrer des serveurs pendant 4 ans, et j&#8217;en fais encore aujourd&#8217;hui. Ce document résume ma compréhension des usages. Si vous avez des suggestions ou vous voulez me corriger, dites-moi le <a href="http://renoirboulanger.com/blog/2010/02/crash-course-sur-les-environnements-java#comments">dans les commentaires</a> et j&#8217;ajusterai mon billet.</p>
<p>&nbsp;</p>
<h3>Les versions</h3>
<p>La majeure différence entre les Java réside dans leur version et ce qui y est distribué avec. La différence majeure réside entre</p>
<ul>
<li><strong>JDK </strong>(Java Development Kit),</li>
<li><strong>JRE </strong>(Java Runtime Environement), et finalement il existe aussi la</li>
<li><strong>JME </strong>(Java Mobile Edition) pour les devices mobile.</li>
</ul>
<p>C’est un peu comme une distribution Windows XP Professionnel ou Windows XP Media Centre.</p>
<p>Il existe plusieurs distributeurs d’environnement Java, notamment : <strong>IBM</strong>, <strong>SUN</strong>, <strong>OpenJdk</strong>. La norme et elles sont toutes basés sur la JVM de SUN Microsystems. <em>L’inventeur </em>de Java.</p>
<p>L’Avantage majeur de Java est le fait qu’il existe des distributions pour toutes les plateformes : Windows, Mac, Linux, Solaris, FreeBSD, etc.</p>
<p>&nbsp;</p>
<h3>Termes fréquemment utilisés</h3>
<ul>
<li>« <strong>JVM </strong>» (Java Virtual Machine) est en fait l’appellation utilisée pour parler de ce qui est exécuté. Ce qui est ci-haut mentionné exécutent toutes des JVM… avec des classes (<em>jar</em>) différentes.</li>
<li>« <strong>Jar </strong>» est en fait, grosso-modo, une archive zippée d’un dossier de classe.</li>
<li>« <strong>Class </strong>» une classe compilée Java.
	</li>
<li>« Container » est en fait ce qu’on appelle un Serveur applicatif. Bref, un serveur http qui roule les classes Java.</li>
<li>« <strong>J2EE </strong>» est un accronyme qui peut être vue comme une spécification technique (penser ISO) fournie par SUN pour les standards d’environnement d’exécution (« <em><strong>Container </strong></em>»).</li>
</ul>
<p>&nbsp;</p>
<h3>Serveur Applicatif</h3>
<p>Il en existe plusieurs. La norme avec les logiciels suivant la tendance Open-Source utilisent la version Apache du container J2EE appelé Tomcat. Atlassian utilise Tomcat dans ses version « self hosted » distribués.</p>
</p>
<p>Il en existe d’autres comme Glassfish de Sun Microsystem, WebObjects de Apple, Tomcat de Apache Foundation, JBoss de RedHat, WebSphere de IBM, et bien d’autres.</p>
</p>
<p>&nbsp;</p>
<h3>Une classe</h3>
<p>C&#8217;est quoi?.  C&#8217;est du code java compilé.</p>
<p>La hiérarchie est faite en fonction du « <em>namespacing </em>» inspiré des standards du DNS. Une classe spécifique Java pour un WebService SOAP pour traduire du français au <em>Klingon</em> pourrait être appelé : i.e. com.renoirboulanger.startrek.klingon.soap.jar.</p>
<p>&nbsp;</p>
<h3>Suggestions</h3>
<p>Je pense avoir fait le tour du sujet. Dites-moi dans <a href="http://renoirboulanger.com/blog/2010/02/crash-course-sur-les-environnements-java#comments">les commentaires</a> si j&#8217;ai oublié quelque chose d&#8217;important.</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://renoirboulanger.com/blog/2010/02/crash-course-sur-les-environnements-java/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Une VM Linux qui sert au développement PHP 5.3 avec Eclipse &#8211; partie III</title>
		<link>http://renoirboulanger.com/blog/2009/09/une-vm-linux-qui-sert-au-developpement-php-5-3-avec-eclipse-partie-iii/</link>
		<comments>http://renoirboulanger.com/blog/2009/09/une-vm-linux-qui-sert-au-developpement-php-5-3-avec-eclipse-partie-iii/#comments</comments>
		<pubDate>Wed, 09 Sep 2009 06:04:14 +0000</pubDate>
		<dc:creator>Renoir Boulanger</dc:creator>
				<category><![CDATA[GeekNight]]></category>
		<category><![CDATA[Techniques]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tutoriels]]></category>

		<guid isPermaLink="false">http://renoirboulanger.com/?p=1060</guid>
		<description><![CDATA[Une VM Linux qui sert au développement PHP 5.3 avec Eclipse &#8211; partie IIICe billet est le troisième d&#8217;une série d&#8217;articles décrivant la fabrication d&#8217;une Machine Virtuelle (VM) de développement pour une équipe de dévelopeurs.
Cette partie couvrira l&#8217;installation de Apache et de PHP 5.3 (la dernière version depuis Juin 2009) qui offre beaucoup d&#8217;avancées. Je [...]]]></description>
			<content:encoded><![CDATA[<a href='http://renoirboulanger.com/blog/2009/09/une-vm-linux-qui-sert-au-developpement-php-5-3-avec-eclipse-partie-iii/' class='retweet '  style='display:block;margin:10px 0px;' >Une VM Linux qui sert au développement PHP 5.3 avec Eclipse &#8211; partie III</a><p>Ce billet est le <strong>troisième</strong> d&#8217;une série d&#8217;articles décrivant la fabrication d&#8217;une Machine Virtuelle (VM) de développement pour une équipe de dévelopeurs.</p>
<p>Cette partie couvrira l&#8217;installation de Apache et de PHP 5.3 (la dernière version depuis Juin 2009) qui offre beaucoup d&#8217;avancées. Je pense que c&#8217;est devenu le juste minimum a cause de ces nouvelles fonctionnalités. Voir articles faits par  <span lang="en">IBM developerworks</span> &#8220;<span lang="en">What&#8217;s new in PHP 5.3 (<a href="http://www.ibm.com/developerworks/opensource/library/os-php-5.3new1/index.html">part 1</a>, <a href="http://www.ibm.com/developerworks/opensource/library/os-php-5.3new2/index.html?S_TACT=105AGX44&#038;S_CMP=ART">part 2</a>, <a href="http://www.ibm.com/developerworks/opensource/library/os-php-5.3new3/index.html?S_TACT=105AGX44&#038;S_CMP=ART">part 3</a>, and <a href="http://www.ibm.com/developerworks/opensource/library/os-php-5.3new4/index.html?S_TACT=105AGX44&#038;S_CMP=ART">part 4</a>)</span>&#8220;.</p>
<p><span id="more-1060"></span></p>
<p>J&#8217;ai séparé cette série en quatre volets.</p>
<ol>
<li><strong><a href="http://renoirboulanger.com/blog/2009/09/une-vm-linux-qui-sert-au-developpement-php-5-3-avec-eclipse-partie-i/">Description du concept</a></strong><br />
Ce que je vais discuter dans cette série d&#8217;articles n&#8217;est pas nécessairement connu de tous. Je vais donc vulgariser un peu avant de commencer.</li>
<li><strong><a href="http://renoirboulanger.com/blog/2009/09/une-vm-linux-qui-sert-au-developpement-php-5-3-avec-eclipse-partie-ii/">Installation du système</a></strong><br />
Je donne ici mon secret de magicien avec quelques configurations que je considère importantes pour un environement d&#8217;hébergement web pour améliorer la sécruité (le strict minimum pour cette série d&#8217;articles. Je pourrai en faire un plus poussé plus tard).</li>
<li><strong>Compilation de PHP 5.3</strong> (cet article)<br />
Comment installer Apache 2.x avec le dernier cutting-edge PHP.</li>
<li><strong>Installation de l&#8217;environnement de développement avec Eclipse PDT</strong> (à venir)<br />
La magie se passe par là! Avec ce setup votre équipe pourra répliquer l&#8217;installation de développement a volonté.</li>
</ol>
<h3>Avant tout, quelques précautions</h3>
<div style="background-color:#FFEEEE;border:1px solid #666600;color:#660000;margin:20px;padding:20px 30px;text-align:center;"><strong>Avertissement!  &#8211;  Changement environement:<br />
</strong>Faire des modifications avec Apache et PHP sur un serveur en production peut causer des problèmes sérieux!  Il est conseillé de planifier et de pratiquer le déploiement AVANT de l&#8217;appliquer dans un environnement de production. Vous aurez été avertis!</div>
<p><strong>Varia:</strong></p>
<div>
<ul>
<li>Désinstallez toutes les instances de PHP que vous avez installé. Il est recommandé d&#8217;avoir la version stable pour un environement de production et que l&#8217;environement de développement réflète la production.</li>
<li>Dans mes environements de travail j&#8217;ai choisi d&#8217;utiliser <strong>Debian Linux (stable)</strong> courrant.  J&#8217;ai déjà utilisé d&#8217;autres distributions Linux pour des serveurs mais ça dépasse l&#8217;objectif de cet article.</li>
<li>Chaque ligne de commande commence soit par &#8220;$&#8221; (dollar sign)  ou &#8220;#&#8221; (hash mark). Le # signifie que vous entrez la commande en tant que <strong>root</strong></li>
<li>Le retour de chariot est illustré par un anti-slash &#8220;\&#8221;  car je veut éviter de changer la largeur du billet! Vous pouvez simplement tout coller sur une ligne.</li>
</ul>
</div>
<h3>Compilation de PHP 5.3</h3>
<p><span> </span></p>
<h4>1 Installer Apache</h4>
<p>La première étape est d&#8217;installer Apache. Il est possible de le faire avec plusieurs autres serveurs (lighttpd par exemple) mais je ne l&#8217;utilise pas (lighttpd) pour autre chose que du caching statique ou du Proxying. Alors je ne couvrirai pas comment faire. <a href="http://www.howtoforge.com/lighttpd_mysql_php_debian_etch">Cet article le fait</a>, par contre.</p>
<p>Cette commande devrait faire le travail.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># apt-get install apache2 apache2-mpm-prefork apache2-prefork-dev \</span>
apache2-utils apache2.2-common</pre></td></tr></table></div>

<h4>2. Installer MySQL et/ou PostgreSQL</h4>
<p>L&#8217;engin de base de donnée utilisé est le choix de chacun. Je suis personnellement habitué avec MySQL mais pouvoir avoir les deux peut être utile.</p>
<h5>PostgreSQL</h5>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># apt-get install postgresql-8.3 postgresql-client-8.3 \</span>
postgresql-client-common postgresql-common postgresql-server-dev-<span style="color: #000000;">8.3</span></pre></td></tr></table></div>

<h5>MySQL</h5>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># apt-get install mysql-client mysql-client-5.0    mysql-common \</span>
mysql-server mysql-server-<span style="color: #000000;">5.0</span> mysql-server-core-<span style="color: #000000;">5.0</span></pre></td></tr></table></div>

<h5>3. Installer les librairies requises</h5>
<p>PHP en tant que tel est facile a configurer mais les librairies externes font que c&#8217;est plus compliqué&#8230; malheureusement.  Ce qui est bien c&#8217;est qu&#8217;avec Debian la documentation est entretenue fréquemment et il est facile de se reprendre.</p>
<p>Plusieurs heures peuvent être prises pour simplement préparer la commande &#8220;configure&#8221;.  Avec ces notes vous devriez vous en sortir pas pire <img src='http://renoirboulanger.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Voici les packages que Debian fournit pour ce que PHP demande, comme ça vous pourrez éviter d&#8217;installer arbitrairement plusieurs dizaines de paquets!</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># apt-get install libtidy-dev curl libcurl4-openssl-dev libcurl3 \</span>
libcurl3-gnutls zlib1g zlib1g-dev libxslt1-dev libzip-dev libzip1 \
libxml2 libsnmp-base libsnmp15 libxml2-dev libsnmp-dev libjpeg62 \
libjpeg62-dev libpng12-<span style="color: #000000;">0</span> libpng12-dev zlib1g zlib1g-dev libfreetype6 \
libfreetype6-dev libbz2-dev libxpm-dev libmcrypt-dev libmcrypt4</pre></td></tr></table></div>

<p><strong>Note</strong>:  libxpm4-dev proposé dans <a href="http://www.brandonsavage.net/installing-php-5-3-on-ubuntu/">ma source d&#8217;information</a> n&#8217;est pas trouvé dans Debian Lenny mis a jour le 2009-09-09 j&#8217;ai donc rectifié (pour libxpm-dev) la commande ci-haut.</p>
<h4>4. Télécharger le code source de PHP</h4>
<p>Visiter <a href="http://www.php.net/">http://www.php.net</a> et télécharger la version désirée. Actuellement, la version production est la 5.3</p>
<p>Personnellement je recommande d&#8217;avoir les fichiers de compilation dans /usr/src quoi que j&#8217;ai pas la conaissance de la science infuse <img src='http://renoirboulanger.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># cd /usr/src/</span>
<span style="color: #666666; font-style: italic;"># wget http://us3.php.net/get/php-5.3.0.tar.gz/from/this/mirror</span>
<span style="color: #666666; font-style: italic;"># tar xvfz php-5-3-0.tar.gz</span>
<span style="color: #666666; font-style: italic;"># cd php-5.3</span></pre></td></tr></table></div>

<h4>5. La commande Configure.</h4>
<p>La commande configure peut etre difficile a configurer surtout avec les librairies qu&#8217;on veut généralement mettre&#8230; généralement une certaine mesure du minimum.</p>
<p>Personnellement. Je recommande de faire la commande dans un fichier et de l&#8217;exécuter par la suite.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># vi configure.sh</span>
 .<span style="color: #000000; font-weight: bold;">/</span>configure <span style="color: #660033;">--with-apxs2</span>=<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>apxs2 \
   <span style="color: #660033;">--with-tidy</span>=<span style="color: #000000; font-weight: bold;">/</span>usr <span style="color: #660033;">--with-curl</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin <span style="color: #660033;">--with-curlwrappers</span> \
   <span style="color: #660033;">--with-openssl-dir</span>=<span style="color: #000000; font-weight: bold;">/</span>usr <span style="color: #660033;">--with-zlib-dir</span>=<span style="color: #000000; font-weight: bold;">/</span>usr <span style="color: #660033;">--enable-mbstring</span> \
   <span style="color: #660033;">--with-xpm-dir</span>=<span style="color: #000000; font-weight: bold;">/</span>usr <span style="color: #660033;">--with-xsl</span>=<span style="color: #000000; font-weight: bold;">/</span>usr <span style="color: #660033;">--with-ldap</span> <span style="color: #660033;">--with-xmlrpc</span> \
   <span style="color: #660033;">--with-iconv-dir</span>=<span style="color: #000000; font-weight: bold;">/</span>usr <span style="color: #660033;">--with-snmp</span>=<span style="color: #000000; font-weight: bold;">/</span>usr <span style="color: #660033;">--enable-exif</span> <span style="color: #660033;">--enable-calendar</span> \
   <span style="color: #660033;">--with-bz2</span>=<span style="color: #000000; font-weight: bold;">/</span>usr <span style="color: #660033;">--with-mcrypt</span>=<span style="color: #000000; font-weight: bold;">/</span>usr <span style="color: #660033;">--with-gd</span> <span style="color: #660033;">--with-jpeg-dir</span>=<span style="color: #000000; font-weight: bold;">/</span>usr \
   <span style="color: #660033;">--with-png-dir</span>=<span style="color: #000000; font-weight: bold;">/</span>usr <span style="color: #660033;">--with-zlib-dir</span>=<span style="color: #000000; font-weight: bold;">/</span>usr <span style="color: #660033;">--with-freetype-dir</span>=<span style="color: #000000; font-weight: bold;">/</span>usr \
   <span style="color: #660033;">--enable-mbstring</span> <span style="color: #660033;">--enable-zip</span> <span style="color: #660033;">--with-pear</span></pre></td></tr></table></div>

<p>Je suggère d&#8217;ajouter les commande ci bas au configure plus bas en fonction de votre choix de gestionnaire de base de donnée.</p>
<h5>PostgreSQL</h5>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #660033;">--with-pdo-pgsql</span>=<span style="color: #000000; font-weight: bold;">/</span>usr</pre></td></tr></table></div>

<h5>MySQL</h5>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"> <span style="color: #660033;">--with-pdo-mysql</span>=<span style="color: #000000; font-weight: bold;">/</span>usr <span style="color: #660033;">--with-mysqli</span>=<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>mysql_config <span style="color: #660033;">--with-mysql</span>=<span style="color: #000000; font-weight: bold;">/</span>usr</pre></td></tr></table></div>

<p>Sortir avec :wq puis exécuter le script.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># /bin/bash ./configure.sh</span></pre></td></tr></table></div>

<p>L&#8217;écran devrait bouger beaucoup&#8230; généralement dans la doc on conseille ici d&#8217;aller prendre un café!</p>
<p>&#8230; Si tout va bien tout devrait terminer par quelque chose qui ressemble à &#8220;Thanks for using php&#8221;. Sinon&#8230;. je conseille ma <a href="http://renoirboulanger.com/blog/2009/08/processus-pour-regler-un-probleme-avec-un-ordinateur/">solution aux problèmes numéro un</a>. <img src='http://renoirboulanger.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>Faut pas s&#8217;en faire. Généralement c&#8217;est de tenter avec &#8220;<strong>apt-cache search</strong>&#8221; et &#8220;<strong>apt-get install</strong>&#8221; le nom de la librairie manquante.</p>
<h4>6. Make et Make Install</h4>
<p>Pour l&#8217;installer. Maintenant que PHP est &#8220;configure&#8221;-é  il faut le compiler et l&#8217;installer avec make.</p>
<p>La commande est bien simple.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># make</span></pre></td></tr></table></div>

<p>Beaucoup de sortie ici aussi. Ça risque même d&#8217;être plus long dépendamment de la force du processeur disponible.  C&#8217;est le temps de prendre une marche, encore.</p>
<p>Une fois que tout est terminé avec make, vous pouvez faire, accessoirement un &#8220;make test&#8221;.</p>
<p>La dernière étape est de faire le &#8220;install&#8221;</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># make -i install</span></pre></td></tr></table></div>

<p>Pourquoi le -i? Parceque Ubuntu/Debian risque d&#8217;avertir pour certaines erreurs a cause de la différence d&#8217;installation d&#8217;Apache de Debian/Ubuntu, nous le ferons nous même a bras plus loin dans ce document.</p>
<h4>7. Ajouter le module PHP dans Apache</h4>
<p>Il faut ajouter le module dans Apache pour qu&#8217;il puisse interpreter&#8230; c&#8217;est logique. Étant donné que la commande make -i a surement fait son travail (sous Debian), nous devons nous assurer que tout est en ordre dans la configuration d&#8217;Apache.</p>
<p>Premièrement, copier la librairie compilée:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># updatedb</span>
<span style="color: #666666; font-style: italic;"># locate libphp5</span>
...
<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>modules<span style="color: #000000; font-weight: bold;">/</span>libphp5.so
<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>php-5.3.0<span style="color: #000000; font-weight: bold;">/</span>libs<span style="color: #000000; font-weight: bold;">/</span>libphp5.la
<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>php-5.3.0<span style="color: #000000; font-weight: bold;">/</span>libs<span style="color: #000000; font-weight: bold;">/</span>libphp5.so
...
<span style="color: #666666; font-style: italic;"># cp /usr/src/php-5.3.0/libs/libphp5.so /usr/lib/apache2/modules/libphp5_3.so</span></pre></td></tr></table></div>

<p>Je commencer par mettre a jour la base de donnée &#8220;locate&#8221;, ensuite je cherche où est disponible la librairie, puis ensuite j&#8217;utilise &#8220;cp&#8221; pour déplacer sous un autre nom la librairie.</p>
<p>Ensuite,  dans le dossier:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># cd /etc/apache2/mods-available</span></pre></td></tr></table></div>

<p>Créez un nouveau fichier appelé php5.load et copiez-y le contenu suivant:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">LoadModule php5_module <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>modules<span style="color: #000000; font-weight: bold;">/</span>libphp5_3.so</pre></td></tr></table></div>

<p>Enregistrer le fichier. Ensuite créez un fichier appelé php5.conf et collez-y ce contenu:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">AddType application<span style="color: #000000; font-weight: bold;">/</span>x-httpd-php .php .phtml .php3
AddType application<span style="color: #000000; font-weight: bold;">/</span>x-httpd-php-source .phps</pre></td></tr></table></div>

<p>On est prêts! Il faut le charger dans Apache:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># a2enmod php5</span>
Enabling module php5.
Run <span style="color: #ff0000;">&quot;/etc/init.d/apache2 restart&quot;</span> to activate new configuration<span style="color: #000000; font-weight: bold;">!</span>
<span style="color: #666666; font-style: italic;"># invoke-rc.d apache2 restart</span>
<span style="color: #000000; font-weight: bold;">*</span> Restarting web server apache2
...waiting    ...done.</pre></td></tr></table></div>

<h4>8. Tester l&#8217;installation</h4>
<p>C&#8217;est assez simple rendus là.</p>
<p>On commence par le binaire en ligne de commande:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">$ php <span style="color: #660033;">-v</span>
PHP 5.3.0 <span style="color: #7a0874; font-weight: bold;">&#40;</span>cli<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>built: Aug  <span style="color: #000000;">17</span> <span style="color: #000000;">2009</span> <span style="color: #000000;">19</span>:08:<span style="color: #000000;">32</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
Copyright <span style="color: #7a0874; font-weight: bold;">&#40;</span>c<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #000000;">1997</span>-<span style="color: #000000;">2009</span> The PHP Group
Zend Engine v2.3.0, Copyright <span style="color: #7a0874; font-weight: bold;">&#40;</span>c<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #000000;">1998</span>-<span style="color: #000000;">2009</span> Zend Technologies</pre></td></tr></table></div>

<p>Tout va bien!</p>
<p>Ensuite, voir un phpinfo() dans le docroot. (Généralement /var/www/index.php).</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;</span> ?php
  <span style="color: #990000;">phpinfo</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p><img class="size-full wp-image-1113" style="border:none;" title="PHP 5.3 phpinfo()" src="http://renoirboulanger.com/wp-content/uploads/2009/09/phpinfo_php5_3.png" alt="PHP 5.3 phpinfo()" width="612" height="429" /></p>
<h3>Conclusion</h3>
<p>Je crois avoir bien réussi mon interprétation et ma traduction de l&#8217;article que j&#8217;ai utilisé. J&#8217;y ai ajouté mon grain de sel et rectifié ce qui a marché pour moi. Je vous conseille de documenter pour vos propres besoins ce que vous faites, on sait jamais quand on a besoin de refaire ce qu&#8217;on a déjà fait !</p>
<h3>Références</h3>
<ul>
<li><strong><a lang="en" href="http://www.brandonsavage.net/installing-php-5-3-on-ubuntu/">BrandonSavage.net : Installing PHP 5.3 on Ubuntu</a> </strong></li>
<li><strong><a href="http://www.php-experts.org/developpement-web/5-plugins-indispensables-pour-coder-en-php-avec-lide-eclipse-22">5 plugins indispensables pour coder en PHP avec l&#8217;IDE Eclipse</a></strong><br />Un article que j&#8217;ai beaucoup apprécié car il mentionne ses propres plugins et j&#8217;ai cru bon les ajouter ici.</li>
<li><span lang="en">IBM developerworks</span> &#8220;<span lang="en">What&#8217;s new in PHP 5.3 (<a href="http://www.ibm.com/developerworks/opensource/library/os-php-5.3new1/index.html">part 1</a>, <a href="http://www.ibm.com/developerworks/opensource/library/os-php-5.3new2/index.html?S_TACT=105AGX44&#038;S_CMP=ART">part 2</a>, <a href="http://www.ibm.com/developerworks/opensource/library/os-php-5.3new3/index.html?S_TACT=105AGX44&#038;S_CMP=ART">part 3</a>, and <a href="http://www.ibm.com/developerworks/opensource/library/os-php-5.3new4/index.html?S_TACT=105AGX44&#038;S_CMP=ART">part 4</a>)</span>&#8220;.</li>
<p><strong> </strong></ul>
]]></content:encoded>
			<wfw:commentRss>http://renoirboulanger.com/blog/2009/09/une-vm-linux-qui-sert-au-developpement-php-5-3-avec-eclipse-partie-iii/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Une VM Linux qui sert au développement PHP 5.3 avec Eclipse &#8211; partie II</title>
		<link>http://renoirboulanger.com/blog/2009/09/une-vm-linux-qui-sert-au-developpement-php-5-3-avec-eclipse-partie-ii/</link>
		<comments>http://renoirboulanger.com/blog/2009/09/une-vm-linux-qui-sert-au-developpement-php-5-3-avec-eclipse-partie-ii/#comments</comments>
		<pubDate>Thu, 03 Sep 2009 19:14:05 +0000</pubDate>
		<dc:creator>Renoir Boulanger</dc:creator>
				<category><![CDATA[GeekNight]]></category>
		<category><![CDATA[Open-Source]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Sécurite]]></category>
		<category><![CDATA[Tutoriels]]></category>

		<guid isPermaLink="false">http://renoirboulanger.com/?p=1086</guid>
		<description><![CDATA[Une VM Linux qui sert au développement PHP 5.3 avec Eclipse &#8211; partie IICe billet est le deuxième d&#8217;une série d&#8217;articles décrivant la fabrication d&#8217;une Machine Virtuelle (VM) de développement pour une équipe de dévelopeurs.
Ce billet expliquera comment j&#8217;installe un système Linux que je considère de base pour une infrastructure d&#8217;hébergement applicatif. Je ne couvrirai [...]]]></description>
			<content:encoded><![CDATA[<a href='http://renoirboulanger.com/blog/2009/09/une-vm-linux-qui-sert-au-developpement-php-5-3-avec-eclipse-partie-ii/' class='retweet '  style='display:block;margin:10px 0px;' >Une VM Linux qui sert au développement PHP 5.3 avec Eclipse &#8211; partie II</a><p>Ce billet est le <strong>deuxième</strong> d&#8217;une série d&#8217;articles décrivant la fabrication d&#8217;une Machine Virtuelle (VM) de développement pour une équipe de dévelopeurs.</p>
<p>Ce billet expliquera comment j&#8217;installe un système Linux que je considère de base pour une infrastructure d&#8217;hébergement applicatif. Je ne couvrirai pas les configurations plus avancés pour améliorer la sécurité. Je risque de le faire plus tard.<br />
<span id="more-1086"></span><br />
J&#8217;ai séparé cette série en quatre volets.</p>
<ol>
<li><strong><a href="http://renoirboulanger.com/blog/2009/09/une-vm-linux-qui-sert-au-developpement-php-5-3-avec-eclipse-partie-i">Description du concept</a></strong> (article précédent)
<p>Ce que je vais discuter dans cette série d&#8217;articles n&#8217;est pas nécessairement connu de tous. Je vais donc vulgariser un peu avant de commencer.</li>
<li><strong>Installation du système</strong> (cet article)
<p>Je donne ici mon secret de magicien avec quelques configurations que je considère importantes pour un environement d&#8217;hébergement web pour améliorer la sécruité (le strict minimum pour cette série d&#8217;articles. Je pourrai en faire un plus poussé plus tard).</li>
<li><strong><a href="http://renoirboulanger.com/blog/2009/09/une-vm-linux-qui-sert-au-developpement-php-5-3-avec-eclipse-partie-iii">Compilation de PHP 5.3</a></strong>
<p>Comment installer Apache 2.x avec le dernier cutting-edge PHP.</li>
<li><strong>Installation de l&#8217;environnement de développement avec Eclipse PDT</strong> (à venir)
<p>La magie se passe par là! Avec ce setup votre équipe pourra répliquer l&#8217;installation de développement a volonté.</li>
</ol>
<h3><a name="BaseSystem"></a>Installation du système de base</h3>
<p>J&#8217;utilise personnellement Debian Linux depuis quelques années car je le trouve plus léger que Red Hat Enterprise Linux ou n&#8217;importe quelle saveur de RedHat (Fedora, CentOS, etc)</p>
<p><strong>Note: </strong>Je n&#8217;expliquerai pas comment faire pour  <a href="http://linux.justinhartman.com/Installing_a_Debian_Etch_base_system">installer Debian Linux de base (dans une VM)</a> car c&#8217;est un sujet déjà largement couvert.</p>
<p>Personnellement j&#8217;installe le système avec la version actuelle provenant d&#8217;un mini boot server que j&#8217;ai sur un réseau que je partage avec quelques amis.</p>
<p>Une installation simple <a href="http://linux.justinhartman.com/Installing_a_Debian_Etch_base_system">comme celle ci</a>, ferait très bien l&#8217;affaire.</p>
<ul>
<li>Utiliser le dernier Debian stable</li>
<li>à l&#8217;écran &#8220;<strong>Debian Software Installation</strong>&#8221; <strong>Je coche</strong> généralement ~<strong>rien</strong>~, car<strong> je vais donner plus de détails</strong> ici.</li>
</ul>
<p>Les étapes&#8230;</p>
<ol>
<li>Modifier le

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apt<span style="color: #000000; font-weight: bold;">/</span>sources.list</pre></td></tr></table></div>

<p>et <strong>Enlever la mention du CD-rom</strong> et <strong>Ajouter la mention &#8220;<tt>contrib</tt>&#8220;</strong></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">deb http:<span style="color: #000000; font-weight: bold;">//</span>debian.savoirfairelinux.net<span style="color: #000000; font-weight: bold;">/</span>debian<span style="color: #000000; font-weight: bold;">/</span> lenny main
deb-src http:<span style="color: #000000; font-weight: bold;">//</span>debian.savoirfairelinux.net<span style="color: #000000; font-weight: bold;">/</span>debian<span style="color: #000000; font-weight: bold;">/</span> lenny main
deb http:<span style="color: #000000; font-weight: bold;">//</span>security.debian.org<span style="color: #000000; font-weight: bold;">/</span> lenny<span style="color: #000000; font-weight: bold;">/</span>updates main contrib
deb-src http:<span style="color: #000000; font-weight: bold;">//</span>security.debian.org<span style="color: #000000; font-weight: bold;">/</span> lenny<span style="color: #000000; font-weight: bold;">/</span>updates main contrib
&nbsp;
deb http:<span style="color: #000000; font-weight: bold;">//</span>ftp.debian.org<span style="color: #000000; font-weight: bold;">/</span>debian lenny contrib
deb-src http:<span style="color: #000000; font-weight: bold;">//</span>ftp.debian.org<span style="color: #000000; font-weight: bold;">/</span>debian lenny contrib
&nbsp;
deb http:<span style="color: #000000; font-weight: bold;">//</span>debian-multimedia.org<span style="color: #000000; font-weight: bold;">/</span> lenny main
deb-src http:<span style="color: #000000; font-weight: bold;">//</span>debian-multimedia.org<span style="color: #000000; font-weight: bold;">/</span> lenny main</pre></td></tr></table></div>

<p><strong>Note:</strong> Il s&#8217;agit de mon propre <tt>sources.list</tt> ayant trouvé <tt>savoirfairelinux</tt> comme étant le plus rapide en utilisant <a href="http://linuxhelp.blogspot.com/2007/05/using-netselect-apt-tip-to-select.html">netselect-apt</a> et la liste des <a href="http://www.debian.org/mirror/list">mirroirs Debian</a></li>
<li>Updater les sources

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># apt-get update</span></pre></td></tr></table></div>

</li>
<li>Installer les paquets essentiels

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># apt-get install openssh-server mlocate screen sudo vim ntpdate linux-headers-$(uname -r) syslog-ng build-essential open-vm-tools</span></pre></td></tr></table></div>

<p><strong>Note:</strong> remarquez la présence de <tt>open-vm-tools</tt> il s&#8217;agit d&#8217;un package provenant de Debian contrib pour les VM <strong>VMware</strong> (n&#8217;installez pas si vous utilisez <tt>Xen</tt>)&#8230; au lieu de compiler vm-ware-tools pour le kernel&#8230; Debian s&#8217;en occupe (!!)</li>
<li>Ajouter les droits sudo à <tt>sudo</tt>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># visudo</span></pre></td></tr></table></div>

<ol>
<li>Va ouvrir <tt><a href="http://en.wikipedia.org/wiki/Pico_%28text_editor%29">pico</a></tt></li>
<li>Décommenter <strong><tt>%sudo ALL=NOPASSWD: ALL</tt></strong></li>
<li>Pour quitter, faire CTRL+x y ENTER</li>
</ol>
</li>
<li>Updater la DB de mlocate

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># updatedb</span></pre></td></tr></table></div>

</li>
<li>Lier killall5 sous le nom legacy de <tt>killall</tt>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># ln -s /sbin/killall5 /sbin/killall</span></pre></td></tr></table></div>

</li>
<li>suivre <strong>Procédure de configuration de NTP pour les serveurs</strong>.<br />
<strong>Note</strong> L&#8217;idée est d&#8217;éviter d&#8217;utiliser en mémoire les démons le plus possible. Si utile soit-il (comme ajuster l&#8217;heure, ici). Il est plus pratique qu&#8217;elle soit ajustée aux heures et laisser l&#8217;espace mémoire pour son usage primaire.</p>
<ol>
<li>Entrer en édition dans le fichier

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td 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;">vi</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>ntpdate</pre></td></tr></table></div>

</li>
<li>Trouver dans le fichier la variable <strong><tt>NTPSERVERS</tt></strong>, <strong>Remplacer</strong>, soit par&#8230;

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #007800;">NTPSERVERS</span>=<span style="color: #ff0000;">&quot;0.ca.pool.ntp.org 1.ca.pool.ntp.org 2.ca.pool.ntp.org&quot;</span></pre></td></tr></table></div>

</li>
<li>Faire i (pour Insert)</li>
<li>Ajouter a <tt>NTPOPTIONS</tt>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #007800;">NTPOPTIONS</span>=<span style="color: #ff0000;">&quot;-u&quot;</span></pre></td></tr></table></div>

</li>
<li>Faire ESCAPE</li>
<li>:wq</li>
<li>Créer un fichier <tt>cron.hourly</tt>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td 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;">vi</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>cron.hourly<span style="color: #000000; font-weight: bold;">/</span>ntpdate</pre></td></tr></table></div>

</li>
<li>Ajouter le contenu

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/sh</span>
<span style="color: #007800;">PATH</span>=<span style="color: #000000; font-weight: bold;">/</span>sbin:<span style="color: #000000; font-weight: bold;">/</span>bin
<span style="color: #7a0874; font-weight: bold;">test</span> <span style="color: #660033;">-f</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>ntpdate <span style="color: #000000; font-weight: bold;">||</span> <span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">0</span>
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">test</span> <span style="color: #660033;">-f</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>ntpdate ; <span style="color: #000000; font-weight: bold;">then</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>ntpdate
<span style="color: #000000; font-weight: bold;">else</span>
        <span style="color: #007800;">NTPSERVERS</span>=<span style="color: #ff0000;">&quot;0.ca.pool.ntp.org&quot;</span>
<span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #7a0874; font-weight: bold;">test</span> <span style="color: #660033;">-n</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$NTPSERVERS</span>&quot;</span> <span style="color: #000000; font-weight: bold;">||</span> <span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">0</span>
<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>ntpdate <span style="color: #660033;">-s</span> <span style="color: #007800;">$NTPOPTIONS</span> <span style="color: #007800;">$NTPSERVERS</span> <span style="color: #000000; font-weight: bold;">&amp;</span>gt;<span style="color: #000000; font-weight: bold;">&amp;</span>gt; <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;">&amp;</span>gt;<span style="color: #000000; font-weight: bold;">&amp;</span>amp;<span style="color: #000000;">1</span>
<span style="color: #666666; font-style: italic;"># Exit with a succes anyway, avoids spamming root.</span>
<span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">0</span></pre></td></tr></table></div>

</li>
<li>Changer les permissions pour qu&#8217;il puisse être exécuté

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td 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>cron.hourly<span style="color: #000000; font-weight: bold;">/</span>ntpdate</pre></td></tr></table></div>

</li>
<li>Essayer

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td 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>cron.hourly<span style="color: #000000; font-weight: bold;">/</span>ntpdate</pre></td></tr></table></div>

</li>
<li>Voir dans syslog, ça devrait ressembler à&#8230;

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># tail /var/log/syslog</span>
...
Dec <span style="color: #000000;">30</span> <span style="color: #000000;">13</span>:<span style="color: #000000;">39</span>:<span style="color: #000000;">35</span> willow ntpdate<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">1912</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>: adjust <span style="color: #000000; font-weight: bold;">time</span> server 192.168.1.5 offset <span style="color: #000000;">0.005642</span> sec
...</pre></td></tr></table></div>

</li>
</ol>
</li>
<li>Installer le service d&#8217;envoi courriel&#8230;
<p>Question de pouvoir <strong>recevoir les avertissements</strong> par courriel</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># apt-get install postfix</span></pre></td></tr></table></div>

<ol>
<li>Satellite System (On veut envoyer les courriels ailleurs et rien garder ici)</li>
<li>&#8220;Mail name?&#8221;&#8230;  <strong><tt>NOMDELAVM</tt></strong></li>
<li>&#8220;SMTP relay host?&#8221;&#8230;  votre relai SMTP fourni par votre fournisseur</li>
<li>&#8220;Other destinations&#8230;&#8221; Ajuster les noms</li>
<li>Enter</li>
<li>&#8220;Local networks?&#8221;&#8230; ENTER</li>
<li>&#8230;</li>
<li>Tester l&#8217;envoi<br />
(<strong>NOTE:</strong> vous pouvez aussi utiliser l&#8217;outil Debian <tt>swaks</tt>)</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># mail test@test.com</span>
Subject: Patate <span style="color: #000000;">1</span> am
Message, qui doit terminer avec une ligne seule et un point .
.
Cc:</pre></td></tr></table></div>

</li>
<li>Regarder les mails du destinataire.</li>
</ol>
</li>
</ol>
<h3>Références</h3>
<ul>
<li><a lang="en" href="http://www.vmware.com/products/server/">VMware Server</a> (anglais seulement)</li>
<li><a lang="en" href="http://linux.justinhartman.com/Installing_a_Debian_Etch_base_system">Installing a Debian Base system</a> (anglais seulement)</li>
<li><a lang="en" href="http://helpdeskgeek.com/virtualization/creating-a-virtual-machine-on-vmware-server/">Creating a Virtual Machine on VMware server</a> (anglais seulement)</li>
<li><a lang="en" href="http://linuxhelp.blogspot.com/2007/05/using-netselect-apt-tip-to-select.html">Using <tt>netselect-apt</tt> tip to select</a> (anglais seulement)</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://renoirboulanger.com/blog/2009/09/une-vm-linux-qui-sert-au-developpement-php-5-3-avec-eclipse-partie-ii/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Une VM Linux qui sert au développement PHP 5.3 avec Eclipse &#8211; partie I</title>
		<link>http://renoirboulanger.com/blog/2009/09/une-vm-linux-qui-sert-au-developpement-php-5-3-avec-eclipse-partie-i/</link>
		<comments>http://renoirboulanger.com/blog/2009/09/une-vm-linux-qui-sert-au-developpement-php-5-3-avec-eclipse-partie-i/#comments</comments>
		<pubDate>Thu, 03 Sep 2009 18:53:14 +0000</pubDate>
		<dc:creator>Renoir Boulanger</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tutoriels]]></category>

		<guid isPermaLink="false">http://renoirboulanger.com/?p=722</guid>
		<description><![CDATA[Pour développer, j'utilise depuis deux ans une <em>machine virtuelle</em> (VM) Linux (minimale) qui me sert de "bac à sable"... Le but de cette série d'articles. Dans cette VM il y a tout les outils nécessaires aux projets en-cours et ils sont configurés pour refléter l'environnement de production où je déploie mon travail.

Ce type d'installation est idéal car il permet d'avoir a installer les prérequis une seule fois et pouvoir les dupliquer pour tout les dévelopeurs. Sans oublier que vous n'avez plus de préoccupations de licences logicielles.

A la fin de cette série d'articles vous aurez accès a une VM qui représentera votre environement de production (ajuster à vos besoins de production, évidemment).]]></description>
			<content:encoded><![CDATA[<a href='http://renoirboulanger.com/blog/2009/09/une-vm-linux-qui-sert-au-developpement-php-5-3-avec-eclipse-partie-i/' class='retweet '  style='display:block;margin:10px 0px;' >Une VM Linux qui sert au développement PHP 5.3 avec Eclipse &#8211; partie I</a><p><img class="size-medium wp-image-1082" style="border: none; float: right;" title="La Virtualisation c'est comme des roches en équilibre" src="http://renoirboulanger.com/wp-content/uploads/2009/09/virtualization-200x300.jpg" alt="La Virtualisation c'est comme des roches en équilibre" width="200" height="300" />Ce billet est le <strong>premier</strong> d&#8217;une série d&#8217;articles décrivant la fabrication d&#8217;une Machine Virtuelle (VM) de développement pour une équipe de dévelopeurs.</p>
<p>Je mentionne PHP 5.3 mais en fait ce type d&#8217;installation pourrait être utilisé pour n&#8217;importe quelle technologie web qui peut rouler sous Linux (<tt>Ruby on Rails</tt>, <tt>Java</tt>, <tt>Perl</tt>, etc).</p>
<p>J&#8217;ai séparé cette série en quatre volets.</p>
<ol>
<li><strong>Description du concept</strong> (cet article)Ce que je vais discuter dans cette série d&#8217;articles n&#8217;est pas nécessairement connu de tous. Je vais donc vulgariser un peu avant de commencer.</li>
<li><strong><a href="http://renoirboulanger.com/blog/2009/09/une-vm-linux-qui-sert-au-developpement-php-5-3-avec-eclipse-partie-ii/">Installation du système</a></strong>Je donne ici mon secret de magicien avec quelques configurations que je considère importantes pour un environement d&#8217;hébergement web pour améliorer la sécruité (le strict minimum pour cette série d&#8217;articles. Je pourrai en faire un plus poussé plus tard).</li>
<li><strong><a href="http://renoirboulanger.com/blog/2009/09/une-vm-linux-qui-sert-au-developpement-php-5-3-avec-eclipse-partie-iii">Compilation de PHP 5.3</a></strong>Comment installer Apache 2.x avec le dernier cutting-edge PHP.</li>
<li><strong>Installation de l&#8217;environnement de développement avec Eclipse PDT</strong> (à venir)La magie se passe par là! Avec ce setup votre équipe pourra répliquer l&#8217;installation de développement a volonté.</li>
</ol>
<div style="background: #ececec; margin: 5px 0px; padding: 18px 8px 8px 50px; border: 1px solid #333;">
<h4 style="color: #777; margin-bottom: 10px;">Mise à jour et façon différente de fonctionner</h4>
<p>Dans un billet plus récent (que celui-ci) <a href="http://renoirboulanger.com/blog/2010/07/installer-une-machine-virtuelle-linux-roulant-dans-vmware-fusion-sous-mac-os-x/">j&#8217;explique comment le faire pour un Mac</a>.</p>
</div>
<h3>Mise en contexte</h3>
<p>Pour développer, j&#8217;utilise depuis deux ans une <em>machine virtuelle</em> (VM) Linux (minimale) qui me sert de &#8220;bac à sable&#8221;&#8230; Le but de cette série d&#8217;articles. Dans cette VM il y a tout les outils nécessaires aux projets en-cours et ils sont configurés pour refléter l&#8217;environnement de production où je déploie mon travail.</p>
<p>Ce type d&#8217;installation est idéal car il permet d&#8217;avoir a installer les prérequis une seule fois et pouvoir les dupliquer pour tout les dévelopeurs. Sans oublier que vous n&#8217;avez plus de préoccupations de licences logicielles.</p>
<p>A la fin de cette série d&#8217;articles vous aurez accès a une VM qui représentera votre environement de production (ajuster à vos besoins de production, évidemment).<br />
<span id="more-722"></span></p>
<h3>Concept</h3>
<p>Comme j&#8217;<a href="http://renoirboulanger.com/blog/2007/11/mon-espace-de-travail/">en ai déjà parlé ici</a> une VM roule avec toutes les versions désirés pour pouvoir développer et tester live le code développé. Le code est envoyé au serveur de source (<tt>git</tt>, <tt>subversion</tt>, <tt>cvs</tt>, etc) de toute façon.  C&#8217;est ce qui rend cette VM &#8220;jettable&#8221; et facilement copiée pour des collègues.</p>
<p>C&#8217;est très utile car souvent, les outils utilisés (serveur applicatif, environement de développement, configuration de &#8220;debug&#8221;, scripts sur mesure de l&#8217;équipe infrastructure) doivent être reproduits le plus fidèlement au niveau développement pour s&#8217;assurer de ne pas tomber sur des coquilles rendu au jour &#8220;J&#8221;.</p>
<p>Ok. Trève de présentations!</p>
<h3>Versions de VMware</h3>
<p>Étant donné que tout roule dans une machine virtuelle, il faut savoir laquelle utiliser. Je résume ici leur usage recommandé. Personnellement j&#8217;ai seulement utilisé VMware comme outil de virtualisation. Vous êtes libres d&#8217;utiliser <a href="http://www.xen.org/">Xen</a> ou <a href="http://en.wikipedia.org/wiki/FreeBSD_jail">Jail (avec FreeBSD)</a> si vous avez plus d&#8217;Expérience.</p>
<p>Il y a aussi d&#8217;autres choix bien illustrés dans cet article <a lang="en" href="http://www.dedoimedo.com/computers/virtualization.html">Virtualization, plenty of choices</a></p>
<h4><a href="http://www.vmware.com/products/workstation/">VMware workstation</a></h4>
<p>Est idéale pour chaque poste de travail qui va utiliser cette VM de développement.</p>
<h4><a href="http://www.vmware.com/products/server/">VMware server</a></h4>
<p>Pour les machines de l&#8217;environement de <em>staging</em> avec lesquelles vous voulez avoir le contrôle sur le système d&#8217;exploitation en dessous.</p>
<p>Mais selon-moi, le meilleur a utiliser c&#8217;est&#8230;</p>
<h4><a href="http://www.vmware.com/products/esxi/">VMware server ESXi</a></h4>
<p>Un serveur VMware de 30 Méga-octets qui ne fait QUE rouler des VMs. Le seul hic c&#8217;est qu&#8217;il faut que ce soit un serveur-rack plus ou moins récent (après 2005 environ).</p>
<h4>Installation dans une VM</h4>
<p>Je vous recommande de vous inspirer de ce tutoriel pour l&#8217;installation: <a lang="en" href="http://helpdeskgeek.com/virtualization/creating-a-virtual-machine-on-vmware-server/">Creating a Virtual Machine on VMware server</a>, en anglais)</p>
<h3>Suite</h3>
<p>Commençons par l&#8217;installation de la machine virtuelle.</p>
]]></content:encoded>
			<wfw:commentRss>http://renoirboulanger.com/blog/2009/09/une-vm-linux-qui-sert-au-developpement-php-5-3-avec-eclipse-partie-i/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Manipulation des liens extérieurs et les popup pour améliorer l&#8217;Accessibilité</title>
		<link>http://renoirboulanger.com/blog/2009/08/manipulation-des-liens-exterieurs-et-les-popup-pour-ameliorer-laccessibilite/</link>
		<comments>http://renoirboulanger.com/blog/2009/08/manipulation-des-liens-exterieurs-et-les-popup-pour-ameliorer-laccessibilite/#comments</comments>
		<pubDate>Sun, 23 Aug 2009 21:36:29 +0000</pubDate>
		<dc:creator>Renoir Boulanger</dc:creator>
				<category><![CDATA[Programmation]]></category>
		<category><![CDATA[Accessibilité]]></category>
		<category><![CDATA[Tutoriels]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://renoirboulanger.com/?p=766</guid>
		<description><![CDATA[Manipulation des liens extérieurs et les popup pour améliorer l&#8217;AccessibilitéEn rédigeant Accessibilité et les liens externes j&#8217;ai réalisé qu&#8217;il y aurait trop de matière pour être lue dans un simple billet. Alors j&#8217;ai décidé d&#8217;aller plus en profondeur et de le documenter.
Cet article explique une méthode simple pour transformer tout les liens d&#8217;une page qui [...]]]></description>
			<content:encoded><![CDATA[<a href='http://renoirboulanger.com/blog/2009/08/manipulation-des-liens-exterieurs-et-les-popup-pour-ameliorer-laccessibilite/' class='retweet '  style='display:block;margin:10px 0px;' >Manipulation des liens extérieurs et les popup pour améliorer l&#8217;Accessibilité</a><p>En rédigeant <a href="http://renoirboulanger.com/blog/2009/08/accessibilite-et-les-liens-externes/"><em>Accessibilité et les liens externes</em></a> j&#8217;ai réalisé qu&#8217;il y aurait trop de matière pour être lue dans un simple billet. Alors j&#8217;ai décidé d&#8217;aller plus en profondeur et de le documenter.</p>
<p>Cet article explique une méthode simple pour transformer tout les liens d&#8217;une page qui vont à l&#8217;extérieur du site courrant en ajoutant un icône approprié et la note disant qu&#8217;une fenêtre s&#8217;ouvrira</p>
<p><span id="more-766"></span></p>
<p>&nbsp;</p>
<h3>Les méthodes généralement utilisés</h3>
<p>Actuellement, il existe plusieurs manières de faire. Sauf qu&#8217;elles demandent souvent de le faire à la main pour <em>chaque lien</em> et ca peut être lourd.</p>
<p>Surtout pour la rédaction qui se fout un peu de faire du <em>html propre</em></p>
<p>&nbsp;</p>
<h3>Comment faire un pop-up</h3>
<p>Voici quelques manières&#8230; rien d&#8217;extravagant.</p>
<div>
<ul>
<li><strong>Méthode target</strong>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&lt;a href=&quot;somelink.php&quot; target=&quot;_blank&quot;&gt;Link text&lt;/a&gt;</pre></td></tr></table></div>

<p>Mais le problème c&#8217;est que l&#8217;attribut <tt>target=""</tt> est maintenant obselete. Donc <strong>on ne devrait pas l&#8217;utiliser</strong></p>
</li>
<li><strong>Méthode href javascript window.open</strong>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&lt;a href=&quot;javascript:window.open('http://renoirboulanger.com/','mywindow','width=400,height=200')&quot;&gt;Link text&lt;/a&gt;</pre></td></tr></table></div>

<p> Fonctionnerait bien. Mais du point de vue SEO et Crawling&#8230; on complique la tâche et ne devrait pas etre utilisé car l&#8217;attribut <tt>href=""</tt> est fait pour avoir le URL.<br />Elle n&#8217;est pas recommandée parceque la balise est altérée de son usage natuel: faire un lien et que l&#8217;attribut <tt>href</tt> dise QUOI lier.</p>
</li>
<li><strong>Méthode onClick</strong>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&lt;a href=&quot;somelink.php&quot; onclick=&quot;window.open('http://renoirboulanger.com/','mywindow','width=400,height=200')&quot;&gt;Link text&lt;/a&gt;</pre></td></tr></table></div>

<p>Est une bonne méthode mais <strong>pas facile a expliquer pour l&#8217;équipe de rédaction.</strong></p>
</li>
</ul>
</div>
<p>Ces méthodes font bel et bien le travail mais certaines d&#8217;entre elles (je ne les ai pas toutes listés) sont sémantiquement invalides&#8230; et donne un <a rel="nofollow" href="http://en.wikipedia.org/wiki/Tag_soup">du tagsoup</a></p>
<p>&nbsp;</p>
<h3>Règles pour les liens extérieurs</h3>
<ul>
<li>Une balise html doit être utilisée pour son usage</li>
<li>Le <em>markup</em> doit être le plus simple possible pour éviter les erreurs d&#8217;entrée de l&#8217;édimestre.</li>
<li>On ne peut pas utiliser le <tt>CSS</tt> pour ajouter les icones<br />
<strong>Note</strong>: Parceque les <em>Lecteurs d&#8217;écran</em> (aveugles) &#8220;lisent&#8221; le texte et non pas ce qui a été modifié via <tt>CSS</tt>.</li>
<li>On ne peut pas utiliser de Javascript invalide<br />
<strong>Note</strong>: Si on y va via le DOM, avec les manipulations valide, ca passe bien: bref on évite <tt>innerHTML</tt> et on se fie aux <a href="http://www.w3.org/DOM/">Spécifications du DOM</a></li>
</ul>
<p>D&#8217;autres règles pourraient être mentionnées. Mais le message peut bien se résumer ainsi.</p>
<blockquote><p><strong>En <tt>HTML</tt>, on doit utiliser les balises pour l&#8217;usage qu&#8217;elles sont destinés à faire.</strong></p></blockquote>
<p>&#8230; il ne reste pas tant d&#8217;options. La <a href="#mamethode">méthode que j&#8217;ai élaboré répond a toutes ces conditions</a>.</p>
<p>&nbsp;</p>
<h3>Les <em>autres</em> choses que le lien doit faire</h3>
<p>Dans les lignes guides de l&#8217;accessibilité du web (et en ergonomie/utilisabilité) on mentionne</p>
<blockquote><p>Qu&#8217;on doit avoir un indice qu&#8217;un lien est destiné à ouvrir <em>une page extérieure</em> et/ou <em>un popup</em></p></blockquote>
<p>Source: ma mémoire&#8230; j&#8217;ai pas trouvé de lien référence. Si vous en trouvez, faites <a href="/me-joindre/">moi signe</a></p>
<p>ça veut donc dire qu&#8217;en plus de faire le lien en tant que tel, il faut ajouter une <em>image</em> dans le lien qui va annoncer le popup&#8230; Ouf!</p>
<p>&nbsp;</p>
<h3>Ce qu&#8217;il faudrait&#8230;</h3>
<p>En gros, il faudrait, que pour chaque lien&#8230;</p>
<ul>
<li>Avertir qu&#8217;il y a un lien externe dans un icône image ajouté automatiquement</li>
<li>Placer l&#8217;icone avec la bonne balise et ne pas utiliser le <tt>CSS</tt>.</li>
<li>Avoir un <tt>alt=""</tt> pour l&#8217;image (icône) car sinon c&#8217;est du <em>html invalide</em> en plus qu&#8217;il servirait a avertir</li>
<li>Que le <tt>alt=""</tt> soit dans la langue utilisée dans le site</li>
<li>Que le lien soit utilisable <em>SANS JAVASCRIPT</em> donc, on oublie le <tt>href="javascript..."</tt><br />
<strong>Note</strong>: C&#8217;est une approche qui veut que l&#8217;on puise &#8220;<em>dégrader élégamment</em>&#8221; le code dans la &#8220;<em>pire des situations</em>&#8220;</li>
</ul>
<p>&nbsp;</p>
<h3><a name="mamethode"></a>la Manière idéale</h3>
<p>Il s&#8217;agit d&#8217;une méthode que j&#8217;ai élaborée avec un ancien collègue que l&#8217;on surnomme (alias) <em>Reynold Kirby</em> pour être valide avec toutes les règles ci-haut mentionnés.</p>
<ul>
<li>Lister tout les liens externes qui commencent par <tt>http://</tt>;</li>
<li>Éliminer de la liste les domaines qu&#8217;on ne veut pas qui se fassent transformer;</li>
<li>Créer, via le <tt>DOM</tt>, une image AVEC le bon <tt>alt=""</tt>;</li>
<li>Ajouter un attribut <tt>rel="popup"</tt> pour le handler de popup;</li>
<li>Ajouter, finalement, le handler <tt>onclick=""</tt>.</li>
</ul>
<h4>La &#8220;pogne&#8221;</h4>
<p>On va utiliser le <tt>onclick=""</tt>, mais généré automatiquement via Javascript. Car de toute façon il est ridicule de s&#8217;interdire d&#8217;utiliser javascipt. Dans ce contexte, ce serait donc acceptable. Et toujours mieux que de faire <tt>target="_blank"</tt> et/ou de demander aux édimestres de <em>faire chaque lien à bras</em> (!!)
</p>
<h4>Le code</h4>
<p>Simplement ajouter ce bout de code Javascript aux autres scripts du site.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> strPopUpWarning <span style="color: #339933;">=</span> <span style="color: #3366CC;">'Lien sur un site externe qui va ouvrir dans une nouvelle fenetre.'</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> addImageAtExternalLinks<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
  <span style="color: #003366; font-weight: bold;">var</span> anchorList <span style="color: #339933;">=</span> document.<span style="color: #660066;">getElementsByTagName</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'a'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #000066; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> i<span style="color: #339933;">=</span><span style="color: #CC0000;">0</span><span style="color: #339933;">;</span> i <span style="color: #339933;">&lt;</span> anchorList.<span style="color: #660066;">length</span><span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #006600; font-style: italic;">/**
    * Remarquez les indexOf()... remplacez renoirboulanger 
    * par votre propre nom de domaine... addthis a été ajouté 
    * au cas ou vous avez un service du genre
    **/</span> 
    <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>anchorList<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">href</span> <span style="color: #339933;">!=</span> <span style="color: #3366CC;">''</span> <span style="color: #339933;">&amp;&amp;</span>
    anchorList<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">href</span>.<span style="color: #660066;">indexOf</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'renoirboulanger'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">1</span> <span style="color: #339933;">&amp;&amp;</span>
    anchorList<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">href</span>.<span style="color: #660066;">indexOf</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'javascript'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">1</span> <span style="color: #339933;">&amp;&amp;</span>
    anchorList<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">href</span>.<span style="color: #660066;">indexOf</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'addthis'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      <span style="color: #003366; font-weight: bold;">var</span> elContainer <span style="color: #339933;">=</span> anchorList<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
      <span style="color: #003366; font-weight: bold;">var</span> createdEl <span style="color: #339933;">=</span> document.<span style="color: #660066;">createElement</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'img'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      createdEl.<span style="color: #660066;">alt</span> <span style="color: #339933;">=</span> strPopUpWarning<span style="color: #339933;">;</span>
      createdEl.<span style="color: #660066;">src</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">'/icones/extlink.gif'</span><span style="color: #339933;">;</span>
      elContainer.<span style="color: #660066;">setAttribute</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'rel'</span><span style="color: #339933;">,</span><span style="color: #3366CC;">'popup'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      elContainer.<span style="color: #660066;">appendChild</span><span style="color: #009900;">&#40;</span>createdEl<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      elContainer.<span style="color: #660066;">onclick</span> <span style="color: #339933;">=</span> dopopup<span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
  <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #009966; font-style: italic;">/* Ensuite... l'appel */</span>
addImageAtExternalLinks<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #006600; font-style: italic;">/**
 * Fonctions pour les popup
 *
 * Permet de crere un popup en faisant un lien
 * &lt;a href=&quot;http://www.othersite.com/url/&quot; /&gt;text (usage normal)
 * Mais creer des liens popup au besoin selon des specifites que l'on veut. Donc, un
 *  lien comme ceux ci  genereront...)
 *   &lt;a href=&quot;http://www.othersite.com/url/&quot; rel=&quot;popup&quot; /&gt;text et aussi
 *   &lt;a href=&quot;http://www.othersite.com/url/&quot; rel=&quot;popup standard 800 600&quot; /&gt;text
 *     (un popup de 800x600 avec toolbars)
 *   &lt;a href=&quot;http://www.othersite.com/url/&quot; rel=&quot;popup console 800 600&quot; /&gt;text
 *     (un popup de 800x600 mais sans toolbars)
 *   &lt;a href=&quot;http://www.othersite.com/url/&quot; rel=&quot;popup fullscreen&quot; /&gt;text (un popup plein ecran)
 *
 * En plus, ce qui a ete ajoute est la possibilite (avec addImageAtExternalLinks();) de scanner toutes les
 * href de la page courrante qui ne sont pas interieurs (ou acceptes) et d'y ajouter une image qui dit que c'est
 * un popup (via le DOM) et qui annonce que ca va ouvrir un site exterieur... bref qui prendrait
 *
 * @author Renoir Boulanger &lt;lunique @renoirboulanger.com&gt;
 * @author Reynold Kirby (alias) &lt;reynold .kirby@gmail.com&gt;
 **/</span>
<span style="color: #003366; font-weight: bold;">function</span> dopopup<span style="color: #009900;">&#40;</span>e<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
  <span style="color: #006600; font-style: italic;">// Source: http://www.accessify.com/features/tutorials/the-perfect-popup/</span>
  <span style="color: #006600; font-style: italic;">//set defaults - if nothing in rel attrib, these will be used</span>
  <span style="color: #003366; font-weight: bold;">var</span> t <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;standard&quot;</span><span style="color: #339933;">;</span>
  <span style="color: #003366; font-weight: bold;">var</span> w <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">;</span>
  <span style="color: #003366; font-weight: bold;">var</span> h <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #006600; font-style: italic;">//look for parameters</span>
  attribs <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">rel</span>.<span style="color: #660066;">split</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot; &quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>attribs<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">!=</span><span style="color: #003366; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>t <span style="color: #339933;">=</span> attribs<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><span style="color: #009900;">&#125;</span>
  <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>attribs<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">2</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">!=</span><span style="color: #003366; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>w <span style="color: #339933;">=</span> attribs<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">2</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><span style="color: #009900;">&#125;</span>
  <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>attribs<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">3</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">!=</span><span style="color: #003366; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>h <span style="color: #339933;">=</span> attribs<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">3</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><span style="color: #009900;">&#125;</span>
&nbsp;
  <span style="color: #006600; font-style: italic;">//call the popup script</span>
  popUpWin<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">href</span><span style="color: #339933;">,</span>t<span style="color: #339933;">,</span>w<span style="color: #339933;">,</span>h<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #006600; font-style: italic;">//cancel the default link action if pop-up activated</span>
  <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>window.<span style="color: #660066;">event</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    window.<span style="color: #660066;">event</span>.<span style="color: #660066;">returnValue</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span>
    window.<span style="color: #660066;">event</span>.<span style="color: #660066;">cancelBubble</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>e<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    e.<span style="color: #660066;">stopPropagation</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    e.<span style="color: #660066;">preventDefault</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> popUpWin<span style="color: #009900;">&#40;</span>url<span style="color: #339933;">,</span> type<span style="color: #339933;">,</span> strWidth<span style="color: #339933;">,</span> strHeight<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
  closeWin<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #006600; font-style: italic;">//calls function to close pop-up if already open,</span>
  <span style="color: #006600; font-style: italic;">//to ensure it's re-opened every time, retainining focus</span>
  type <span style="color: #339933;">=</span> type.<span style="color: #660066;">toLowerCase</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>type <span style="color: #339933;">==</span> <span style="color: #3366CC;">&quot;fullscreen&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    strWidth <span style="color: #339933;">=</span> screen.<span style="color: #660066;">availWidth</span><span style="color: #339933;">;</span>
    strHeight <span style="color: #339933;">=</span> screen.<span style="color: #660066;">availHeight</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
  <span style="color: #003366; font-weight: bold;">var</span> tools<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;&quot;</span><span style="color: #339933;">;</span>
  <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>type <span style="color: #339933;">==</span> <span style="color: #3366CC;">&quot;standard&quot;</span><span style="color: #009900;">&#41;</span>
  tools <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;resizable,toolbar=yes,location=yes,scrollbars=yes,menubar=yes,width=&quot;</span><span style="color: #339933;">+</span>strWidth<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;,height=&quot;</span><span style="color: #339933;">+</span>strHeight<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;,top=0,left=0&quot;</span><span style="color: #339933;">;</span>
  <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>type <span style="color: #339933;">==</span> <span style="color: #3366CC;">&quot;console&quot;</span> <span style="color: #339933;">||</span> type <span style="color: #339933;">==</span> <span style="color: #3366CC;">&quot;fullscreen&quot;</span><span style="color: #009900;">&#41;</span>
    tools <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;resizable,toolbar=no,location=no,scrollbars=no,width=&quot;</span><span style="color: #339933;">+</span>strWidth<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;,height=&quot;</span><span style="color: #339933;">+</span>strHeight<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;,left=0,top=0&quot;</span><span style="color: #339933;">;</span>
  newWindow <span style="color: #339933;">=</span> window.<span style="color: #000066;">open</span><span style="color: #009900;">&#40;</span>url<span style="color: #339933;">,</span> <span style="color: #3366CC;">'newWin'</span><span style="color: #339933;">,</span> tools<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  newWindow.<span style="color: #000066;">focus</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #003366; font-weight: bold;">var</span> newWindow <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> closeWin<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
  <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>newWindow <span style="color: #339933;">!=</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>newWindow.<span style="color: #660066;">closed</span><span style="color: #009900;">&#41;</span>
      newWindow.<span style="color: #000066;">close</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">&lt;/</span>reynold<span style="color: #339933;">&gt;&lt;/</span>lunique<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>
</p>
]]></content:encoded>
			<wfw:commentRss>http://renoirboulanger.com/blog/2009/08/manipulation-des-liens-exterieurs-et-les-popup-pour-ameliorer-laccessibilite/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Un firewall simple sous Linux avec «Ferm»</title>
		<link>http://renoirboulanger.com/blog/2009/08/un-firewall-simple-sous-linux-avec-%c2%abferm%c2%bb/</link>
		<comments>http://renoirboulanger.com/blog/2009/08/un-firewall-simple-sous-linux-avec-%c2%abferm%c2%bb/#comments</comments>
		<pubDate>Wed, 19 Aug 2009 04:12:06 +0000</pubDate>
		<dc:creator>Renoir Boulanger</dc:creator>
				<category><![CDATA[GeekNight]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Sécurite]]></category>
		<category><![CDATA[Tutoriels]]></category>
		<category><![CDATA[UNIX]]></category>

		<guid isPermaLink="false">http://renoirboulanger.com/?p=751</guid>
		<description><![CDATA[Un firewall simple sous Linux avec «Ferm»Attention: Article Technique!
Dans le but de faire profiter la postérité et ma mémoire personnelle voici mon premier post d&#8217;une série d&#8217;articles spécialisée sur Linux.
Ces articles proviennent de ma voûte documentaire professionnelle et personnelle.
Évidemment pour les publier ici je dois censurer les détails sensibles, vous me comprendrez (!)
Le fait de [...]]]></description>
			<content:encoded><![CDATA[<a href='http://renoirboulanger.com/blog/2009/08/un-firewall-simple-sous-linux-avec-%c2%abferm%c2%bb/' class='retweet '  style='display:block;margin:10px 0px;' >Un firewall simple sous Linux avec «Ferm»</a><p>Attention: Article Technique!</p>
<p>Dans le but de faire profiter la postérité et ma mémoire personnelle voici mon premier post d&#8217;une série d&#8217;articles spécialisée sur Linux.</p>
<p>Ces articles proviennent de ma voûte documentaire professionnelle et personnelle.</p>
<p>Évidemment pour les publier ici je dois censurer les détails sensibles, vous me comprendrez (!)</p>
<p>Le fait de les avoir dans le format Wiki Markup de Confluence&#8230; et les traduire ici demande du temps pour les reformatter pour mon blogue.</p>
<h2>D&#8217;autres articles spécialisés Debian Linux</h2>
<p>D&#8217;autres articles technique (pour Debian Linux) seront aussi disponibles dans les prochaines semaines.</p>
<p>Voici une liste de quelques uns que je compte publier:</p>
<ol>
<li>Monter une machine en SNMP v2c en lecture seule</li>
<li>Permettre des updates aux serveurs NTP a l&#8217;heure</li>
<li>Installer VMware server 2 sur Debian</li>
<li>Augumenter le niveau de sécurité pour Infra Publique sous Debian</li>
<li>Procédure configuration SYSLOG-NG vers un serveur de log</li>
</ol>
<p>J</p>
<p><span id="more-751"></span></p>
<h2>Installer et configurer</h2>
<p>En fait, sous Debian c&#8217;est pas très compliqué, on ajoute le paquet, puis on le configure comme mentionné plus bas.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># apt-get update</span>
<span style="color: #666666; font-style: italic;"># apt-get install ferm libnet-dns-perl perl iptables</span></pre></td></tr></table></div>

<p>J&#8217;ai fait une petite version qui permet d&#8217;utiliser des variables et mettre le code un peu plus clean (d&#8217;un point de vue programmeur).</p>
<p>Vous pouvez remplacer par ce code ci:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># -*- shell-script -*-</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;">#  Configuration file for ferm(1).</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># vmware-mgmt = 8333</span>
<span style="color: #666666; font-style: italic;"># vmware-console = 902</span>
<span style="color: #666666; font-style: italic;"># ntop = 3000</span>
<span style="color: #666666; font-style: italic;"># ... ports ajoutes dans /etc/services</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Source http://www.krzywanski.net/archives/90</span>
<span style="color: #666666; font-style: italic;"># Interfaces</span>
<span style="color: #000000; font-weight: bold;">@</span>def <span style="color: #007800;">$DEV_LOCAL</span> = lo;
<span style="color: #000000; font-weight: bold;">@</span>def <span style="color: #007800;">$DEV_LAN</span> = <span style="color: #7a0874; font-weight: bold;">&#40;</span>eth1 vmnet1 vmnet8<span style="color: #7a0874; font-weight: bold;">&#41;</span>;
<span style="color: #000000; font-weight: bold;">@</span>def <span style="color: #007800;">$DEV_INTERNET</span> = eth0;
&nbsp;
<span style="color: #666666; font-style: italic;"># Ports</span>
<span style="color: #000000; font-weight: bold;">@</span>def <span style="color: #007800;">$PORTS</span> = <span style="color: #7a0874; font-weight: bold;">&#40;</span>ntp name http https smtp<span style="color: #7a0874; font-weight: bold;">&#41;</span>;
&nbsp;
<span style="color: #666666; font-style: italic;"># Known IPs</span>
<span style="color: #000000; font-weight: bold;">@</span>def <span style="color: #007800;">$SSH_ALLOWED</span> = <span style="color: #7a0874; font-weight: bold;">&#40;</span>69.159.234.55 192.168.2.1<span style="color: #7a0874; font-weight: bold;">&#41;</span>;
<span style="color: #000000; font-weight: bold;">@</span>def <span style="color: #007800;">$SSH_DYNDNS</span> = <span style="color: #000000; font-weight: bold;">@</span>resolve<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>somehost.renoirboulanger.com someotherhost.somenetwork.net<span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>;
&nbsp;
<span style="color: #666666; font-style: italic;"># SSH Clients</span>
<span style="color: #000000; font-weight: bold;">@</span>def <span style="color: #007800;">$SSH_CLIENTS</span> = <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #007800;">$SSH_ALLOWED</span> <span style="color: #007800;">$SSH_DYNDNS</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>;
&nbsp;
table filter <span style="color: #7a0874; font-weight: bold;">&#123;</span>
    chain INPUT <span style="color: #7a0874; font-weight: bold;">&#123;</span>
        policy DROP;
&nbsp;
        <span style="color: #666666; font-style: italic;"># connection tracking</span>
        mod state state INVALID DROP;
        mod state state <span style="color: #7a0874; font-weight: bold;">&#40;</span>ESTABLISHED RELATED<span style="color: #7a0874; font-weight: bold;">&#41;</span> ACCEPT;
&nbsp;
        <span style="color: #666666; font-style: italic;"># allow local packages</span>
        interface <span style="color: #007800;">$DEV_LOCAL</span> ACCEPT;
        interface <span style="color: #007800;">$DEV_LAN</span> ACCEPT;
&nbsp;
        <span style="color: #666666; font-style: italic;"># allow ping from the administrator's network</span>
        interface <span style="color: #007800;">$DEV_INTERNET</span> saddr <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #007800;">$SSH_DYNDNS</span> <span style="color: #007800;">$SSH_ALLOWED</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> proto icmp icmp-type echo-request ACCEPT;
&nbsp;
        <span style="color: #666666; font-style: italic;"># respond to ping</span>
        proto icmp icmp-type echo-request ACCEPT;
&nbsp;
        <span style="color: #666666; font-style: italic;"># allow SSH connections</span>
        proto tcp dport <span style="color: #000000;">2522</span> ACCEPT;
&nbsp;
        proto tcp dport <span style="color: #007800;">$PORTS</span> ACCEPT;
    <span style="color: #7a0874; font-weight: bold;">&#125;</span>
    chain OUTPUT <span style="color: #7a0874; font-weight: bold;">&#123;</span>
        policy ACCEPT;
&nbsp;
        <span style="color: #666666; font-style: italic;"># connection tracking</span>
        mod state state INVALID DROP;
        mod state state <span style="color: #7a0874; font-weight: bold;">&#40;</span>ESTABLISHED RELATED<span style="color: #7a0874; font-weight: bold;">&#41;</span> ACCEPT;
    <span style="color: #7a0874; font-weight: bold;">&#125;</span>
    chain FORWARD <span style="color: #7a0874; font-weight: bold;">&#123;</span>
        policy DROP;
&nbsp;
        <span style="color: #666666; font-style: italic;"># connection tracking</span>
        mod state state INVALID DROP;
        mod state state <span style="color: #7a0874; font-weight: bold;">&#40;</span>ESTABLISHED RELATED<span style="color: #7a0874; font-weight: bold;">&#41;</span> ACCEPT;
    <span style="color: #7a0874; font-weight: bold;">&#125;</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span></pre></td></tr></table></div>

<p>Pour plus de détails a propos de la syntaxe, <a href="http://ferm.foo-projects.org/download/2.0/ferm.html">voir la documentation</a>.</p>
<h2>Autres ressources</h2>
<p>J&#8217;ai utilisé, entre autres ces ressources pour m&#8217;inspirer de ce mini-tutoriel</p>
<ol>
<li><a href="http://www.debian.org/doc/manuals/securing-debian-howto">Securing Debian HOWTO</a></li>
<li><a href="http://www.tldp.org/HOWTO/Security-HOWTO/">Linux Security HOWTO</a></li>
<li><a href="http://www.cromwell-intl.com/security/security-firewall.html">Firewall Tools</a></li>
<li><a href="http://www.debian.org/security/">Debian Security</a></li>
<li><a href="http://www.debian.org/doc/debian-policy/">Debian Policies</a></li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://renoirboulanger.com/blog/2009/08/un-firewall-simple-sous-linux-avec-%c2%abferm%c2%bb/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Effacer un disque dur</title>
		<link>http://renoirboulanger.com/blog/2008/04/effacer-un-disque-dur/</link>
		<comments>http://renoirboulanger.com/blog/2008/04/effacer-un-disque-dur/#comments</comments>
		<pubDate>Wed, 16 Apr 2008 04:45:08 +0000</pubDate>
		<dc:creator>Renoir Boulanger</dc:creator>
				<category><![CDATA[GeekNight]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Sécurite]]></category>
		<category><![CDATA[Tutoriels]]></category>
		<category><![CDATA[UNIX]]></category>

		<guid isPermaLink="false">http://www.renoirboulanger.com/blog/2008/04/16/effacer-un-disque-dur/</guid>
		<description><![CDATA[Effacer un disque durLorsqu&#8217;on se préocupe de ses informations personnelles et qu&#8217;on veut se débarrasser d&#8217;un ordinateur ou d&#8217;un vieux disque dur il faut, idéalement, le vider. J&#8217;ai une petite méthode pour le faire pas trop compliqué et totalement sécuritaire pour les données.
Ma méthode implique

Un disque dur qu&#8217;on veut wiper (effacer)
Un LiveCD de Linux
Du temps
Une [...]]]></description>
			<content:encoded><![CDATA[<a href='http://renoirboulanger.com/blog/2008/04/effacer-un-disque-dur/' class='retweet '  style='display:block;margin:10px 0px;' >Effacer un disque dur</a><p>Lorsqu&#8217;on se préocupe de ses informations personnelles et qu&#8217;on veut se débarrasser d&#8217;un ordinateur ou d&#8217;un vieux disque dur il faut, idéalement, le vider. J&#8217;ai une petite méthode pour le faire pas trop compliqué et totalement sécuritaire pour les données.</p>
<p>Ma méthode implique</p>
<ul>
<li>Un disque dur qu&#8217;on veut wiper (effacer)</li>
<li>Un LiveCD de Linux</li>
<li>Du temps</li>
<li>Une tour d&#8217;ordinateur pour le processus, idéalement inutilisée&#8230; sinon où chercher ou quoi utiliser pour se «dé-s&#8217;emmerder»
<ul>
<li>Un lecteur CD-Rom</li>
</ul>
</li>
</ul>
<p>Attention, un peu technique&#8230; mais tellement conseillé <img src='http://renoirboulanger.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<h3>ÉTAPE UN&#8230; backups?!</h3>
<p>C&#8217;est un peu stupide de le préciser&#8230; mais assurez-vous qu&#8217;il est vraiment vide de vos données avant de faire quoi que ce soit!</p>
<p><strong>Je vous recommande DE NE PAS AVOIR D&#8217;AUTRES DISQUES D&#8217;INSTALLÉ lors de l&#8217;exécution de ce script</strong> Tant que vous exécutez pas le script a l&#8217;<a href="http://renoirboulanger.com/blog/2008/04/effacer-un-disque-dur/#six">étape six</a> vous ne risquez rien (!). </p>
<p><span id="more-531"></span></p>
<h3>ÉTAPE DEUX&#8230; Graver le LiveCD</h3>
<p>Pour faire la chose facile, vous pouvez prendre le LiveCD de Debian, ma distribution préférée:</p>
<p><code lang="bash">http://live.debian.net/cdimage/release/current/i386/iso-cd/</code></p>
<p>Une version &#8216;<tt>debian-live-(.*)-i386-rescue.iso</tt>&#8216; fera l&#8217;affaire.</p>
<div style="background:#ececec;margin:5px 0px;padding:18px 8px 8px 50px;border:1px solid #333">
<h4 style="color:#777;margin-bottom:10px;">OÙ TROUVER LINUX</h4>
<p>Vous pouvez regarder <a href="http://wiki.debian.org/LiveCD">ici</a> pour d&#8217;autres versions de Debian.</p>
<p>Pour remplacer Windows, ce que je recommande c&#8217;est d&#8217;utiliser <a href="http://www.ubuntu.com/">Ubuntu Linux</a> (ce que j&#8217;utilise pour mon environnement de Bureau).</p>
<p>Mais ce n&#8217;est pas le but de cet article <img src='http://renoirboulanger.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>Juste une dernière note comme ça: Debian, pour moi, sert pour les serveurs&#8230; et Ubuntu est basé sur Debian.</p>
<p>Pour ce qui concerne Linux et notre utilisation actuelle, n&#8217;importe quelle version fera l&#8217;affaire.</p></div>
<p>Les commandes nécessaires seront celles de base pour n&#8217;importe quel Linux depuis ses débuts :</p>
<ul>
<li>/dev/urandom, ou</li>
<li> /dev/zero</li>
<li>dd</li>
</ul>
<p>Je ne me rappelle pas quand Linux en général a inclus ces trucs mais c&#8217;est ce qu&#8217;il faut.</p>
<p>En gros les deux premiers sont des device files qui fournissent du junk aléatoire&#8230; et l&#8217;autre. Que des zéros!</p>
<p>Tandis que &#8220;dd&#8221; est un utilitaire pour écrire en device to device&#8230;. (aka. dd) <img src='http://renoirboulanger.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<h3>ÉTAPE TROIS, on vide</h3>
<p>En fait, on enlève tout les autres disques durs question de ne pas se tromper!</p>
<p>Ensuite, il est bien de remarquer que le processus peut prendre du temps. Ce serait idéal d&#8217;avoir une tour qui sert a rien&#8230; sinon on tombe a devoir attendre après.</p>
<h3>ÉTAPE QUATRE, On démarre le LiveCD</h3>
<p>&#8230; On attend le command prompt. C&#8217;est comme du DOS à l&#8217;époque, sauf que c&#8217;est vraiment plus puissant!</p>
<p>Pour reconnaitre un prompt linux, on voit quelque chose du genre:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">user<span style="color: #000000; font-weight: bold;">@</span>debian:~ $</pre></td></tr></table></div>

<p>ou encore&#8230; si on voit le dièze (#)&#8230; c&#8217;est qu&#8217;on est un super utilisateur (root). Un LiveCD nous envoit généralement en root alors on devrait voir quelque chose de similaire à:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">root<span style="color: #000000; font-weight: bold;">@</span>debian: ~ <span style="color: #666666; font-style: italic;">#</span></pre></td></tr></table></div>

<h3>ÉTAPE CINQ, on script un peu</h3>
<p>On peut le faire de plusieurs façon la même chose.  En gros, on se doit, pour s&#8217;assurer d&#8217;effacer complè<span style="background-color: #ffffff; ">tement le disque de le remplir au moins huit fois au minimum de données random. Alors je propose le petit script qui se copie bien à la main.</span></p>
<p>Si vous avez vidé vos disques durs le disque dur a vider devraît être /dev/hda</p>
<p>Pour vous en assurer, faites</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">root<span style="color: #000000; font-weight: bold;">@</span>debian: ~<span style="color: #666666; font-style: italic;"># file /dev/hda</span></pre></td></tr></table></div>

<p>Un output similaire ceci devrait sortir&#8230;</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>hda: block special <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">3</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">0</span><span style="color: #7a0874; font-weight: bold;">&#41;</span></pre></td></tr></table></div>

<div style="background:#ececec;margin:5px 0px;padding:18px 8px 8px 50px;border:1px solid #333">
<h4 style="color:#777;margin-bottom:10px;">«CRASH COURSE» SUR LES PARTITIONS ET LINUX</h4>
<p>Pour vous assurer de ne pas effacer un bon disque dur, je vous <strong>re-recommande DE NE PAS AVOIR D&#8217;AUTRES DISQUES D&#8217;INSTALLÉ lors de l&#8217;exécution de ce script</strong> (<a href="http://renoirboulanger.com/blog/2008/04/effacer-un-disque-dur/#six">étape six</a>)!!!</p>
<p>Parceque si c&#8217;est pas le disque <tt>/dev/hda</tt>, c&#8217;est peut être <tt>/dev/sda</tt> ou même un autre nom.</p>
<p>Petit cours rapide de partitionnement sous Linux.</p>
<p>Les disques durs n&#8217;ont pas de lettres&#8230; tout dépend où dans le système on &#8220;monte&#8221; la partition.</p>
<p>En fait les noms vont ainsi</p>
<ul>
<li><tt>hda</tt>, <tt>hdb</tt>, <tt>hdc</tt>&#8230; pour les disques durs IDE</li>
<li><tt>sda</tt>, <tt>sdb</tt>, <tt>sdc</tt>&#8230;. pour les disques SATA et SCSI et USB</li>
</ul>
<p>Vous imaginez que le &#8216;a&#8217; (b,c,d&#8230;) représente l&#8217;ordre selon la nappe de connecteurs.</p>
<p>La première partition du premier disque sera donc: <tt>/dev/sda1</tt>
</div>
<p>Si tout est beau&#8230; on continue.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">root<span style="color: #000000; font-weight: bold;">@</span>debian: ~<span style="color: #666666; font-style: italic;"># vi wipedisk.sh</span></pre></td></tr></table></div>

<p>En VI, il faut faire &#8216;i&#8217; avant de commencer d&#8217;écrire&#8230;</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
<span style="color: #000000; font-weight: bold;">for</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #007800;">i</span>=<span style="color: #000000;">1</span>;i<span style="color: #000000; font-weight: bold;">&amp;</span>lt;=<span style="color: #000000;">10</span>;i+=<span style="color: #000000;">1</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>; <span style="color: #000000; font-weight: bold;">do</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Passe <span style="color: #007800;">$i</span>&quot;</span>
<span style="color: #c20cb9; font-weight: bold;">dd</span> <span style="color: #007800;"><span style="color: #000000; font-weight: bold;">if</span></span>=<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>urandom <span style="color: #007800;">of</span>=<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>hda
<span style="color: #c20cb9; font-weight: bold;">sleep</span> <span style="color: #000000;">1</span>
<span style="color: #000000; font-weight: bold;">done</span></pre></td></tr></table></div>

<p>Ensuite on quitte <strong>en faisant</strong> <strong>[escape]</strong> on <strong>écrit</strong> &#8220;<strong>:wq</strong>&#8221; (deux points&#8230; &#8220;w&#8221; et &#8220;q&#8221;&#8230; qui signifie commande write quit)</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">root<span style="color: #000000; font-weight: bold;">@</span>debian: ~<span style="color: #666666; font-style: italic;"># chmod 755 wipedisk.sh</span></pre></td></tr></table></div>

<p>Qui va rendre le fichier exécutable.</p>
<h3><a name="six"></a>ÉTAPE SIX&#8230; on exécute.</h3>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">root<span style="color: #000000; font-weight: bold;">@</span>debian: ~<span style="color: #666666; font-style: italic;"># ./wipedisk.sh</span></pre></td></tr></table></div>

<p>En général, ça peut prendre du temps. Mais à la fin d&#8217;une soirée de film&#8230; le disque devrait être totalement rempli d&#8217;ordures aléatoire.</p>
<p>Au plaisir!</p>
]]></content:encoded>
			<wfw:commentRss>http://renoirboulanger.com/blog/2008/04/effacer-un-disque-dur/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

