<?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>Naeh.net</title>
	<atom:link href="http://naeh.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://naeh.net</link>
	<description>Le mémo du développeur</description>
	<lastBuildDate>Sat, 20 Feb 2010 19:37:14 +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>Nouvelle version, nouvelle robe</title>
		<link>http://naeh.net/nouvelle-version-nouvelle-robe/</link>
		<comments>http://naeh.net/nouvelle-version-nouvelle-robe/#comments</comments>
		<pubDate>Sat, 20 Feb 2010 15:24:34 +0000</pubDate>
		<dc:creator>Naeh</dc:creator>
				<category><![CDATA[Divers]]></category>
		<category><![CDATA[theme]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://naeh.net/?p=134</guid>
		<description><![CDATA[Je viens de mettre à jour wordpress a sa dernière version (depuis le temps que je voulais le faire) et j'en ai profité pour changer de thème, ça change complètent du précédent, j'espère qu'il n y aura pas beaucoup de bugs, si vous en voyez, merci de les signaler en commentaires à ce billet.
Bon surf [...]]]></description>
			<content:encoded><![CDATA[<p>Je viens de mettre à jour wordpress a sa dernière version (depuis le temps que je voulais le faire) et j'en ai profité pour changer de thème, ça change complètent du précédent, j'espère qu'il n y aura pas beaucoup de bugs, si vous en voyez, merci de les signaler en commentaires à ce billet.</p>
<p>Bon surf sur naeh.net, le mémo du développeur :)</p>
]]></content:encoded>
			<wfw:commentRss>http://naeh.net/nouvelle-version-nouvelle-robe/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>La dure vie du développeur web</title>
		<link>http://naeh.net/la-dure-vie-du-developpeur-web/</link>
		<comments>http://naeh.net/la-dure-vie-du-developpeur-web/#comments</comments>
		<pubDate>Tue, 15 Dec 2009 21:51:56 +0000</pubDate>
		<dc:creator>Naeh</dc:creator>
				<category><![CDATA[Divers]]></category>
		<category><![CDATA[développement]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://naeh.net/?p=126</guid>
		<description><![CDATA[une excellente parodie en l'honneur des développeurs web, dont je fais fièrement partie :D

le site e-commerce à 400€ c'est trop fort :-)
]]></description>
			<content:encoded><![CDATA[<p>une excellente parodie en l'honneur des développeurs web, dont je fais fièrement partie :D</p>
<p><center><object width="480" height="275"><param name="movie" value="http://www.dailymotion.com/swf/xbfjlq&#038;related=0"></param><param name="allowFullScreen" value="true"></param><param name="allowScriptAccess" value="always"></param><embed src="http://www.dailymotion.com/swf/xbfjlq&#038;related=0" type="application/x-shockwave-flash" width="480" height="275" allowfullscreen="true" allowscriptaccess="always"></embed></object></center></p>
<p>le site e-commerce à 400€ c'est trop fort :-)</p>
]]></content:encoded>
			<wfw:commentRss>http://naeh.net/la-dure-vie-du-developpeur-web/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Configurer la locale et l&#8217;heure &#8211; Debian -</title>
		<link>http://naeh.net/configurer-la-locale-et-lheure-debian/</link>
		<comments>http://naeh.net/configurer-la-locale-et-lheure-debian/#comments</comments>
		<pubDate>Sat, 31 Oct 2009 12:42:32 +0000</pubDate>
		<dc:creator>Naeh</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Linux - OS]]></category>
		<category><![CDATA[date]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[heure]]></category>
		<category><![CDATA[locale]]></category>
		<category><![CDATA[timezone]]></category>

		<guid isPermaLink="false">http://naeh.net/?p=115</guid>
		<description><![CDATA[Aujourd'hui on va voir comment configurer l'heure du système avec le bon fuseau horaire, ainsi que la locale pour, par exemple, passer une debian en Anglais en Français
on commence par la locale :
taper :

dpkg-reconfigure locales

choisir la bonne langue/locale et valider, comme ici :

faire de même à l'ecran suivant :

en suite on passe a l'heure, c'est [...]]]></description>
			<content:encoded><![CDATA[<p>Aujourd'hui on va voir comment configurer l'heure du système avec le bon fuseau horaire, ainsi que la locale pour, par exemple, passer une debian en Anglais en Français</p>
<p>on commence par la locale :<br />
taper :</p>

<div class="wp_codebox"><table><tr id="p1153"><td class="code" id="p115code3"><pre class="bash" style="font-family:monospace;">dpkg-reconfigure locales</pre></td></tr></table></div>

<p>choisir la bonne langue/locale et valider, comme ici :<br />
<center><a href="http://naeh.net/wp-content/uploads/2009/10/config_locale.jpg"><img src="http://naeh.net/wp-content/uploads/2009/10/config_locale-300x153.jpg" alt="config_locale" title="config_locale" width="300" height="153" class="aligncenter size-medium wp-image-116" border="0" /></a></center></p>
<p>faire de même à l'ecran suivant :<br />
<center><a href="http://naeh.net/wp-content/uploads/2009/10/config_locale2.jpg"><img src="http://naeh.net/wp-content/uploads/2009/10/config_locale2-300x112.jpg" alt="config_locale2" title="config_locale2" width="300" height="112" class="aligncenter size-medium wp-image-117" border="0" /></a></center></p>
<p>en suite on passe a l'heure, c'est très simple<br />
on tape :</p>

<div class="wp_codebox"><table><tr id="p1154"><td class="code" id="p115code4"><pre class="bash" style="font-family:monospace;">dpkg-reconfigure tzdata</pre></td></tr></table></div>

<p>et là on va avoir un écran où il faudra sélectionner "<strong>Europe</strong>" puis valider, en suite sélectionner "<strong>Paris</strong>" puis valider et c'est ok, l'heure est automatiquement régler avec le bon fuseau horaire, pas besoin de régler l'heure a la main puisque ntpdate s'occupe de la garder à jour.</p>
<p>N.B. Tous se fait sous root.</p>
]]></content:encoded>
			<wfw:commentRss>http://naeh.net/configurer-la-locale-et-lheure-debian/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Installer et configurer Munin</title>
		<link>http://naeh.net/installer-et-configurer-munin/</link>
		<comments>http://naeh.net/installer-et-configurer-munin/#comments</comments>
		<pubDate>Sat, 24 Oct 2009 11:20:10 +0000</pubDate>
		<dc:creator>Naeh</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Linux - Logiciels]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[munin]]></category>
		<category><![CDATA[stats]]></category>

		<guid isPermaLink="false">http://naeh.net/?p=110</guid>
		<description><![CDATA[... sur une debian.
Aujourd'hui on va voir comment installer et configurer l'outil de monitoring munin
Un petit article aide mémoire comme beaucoup d'autres sur ce blog :)
pour commencer :

apt-get install munin munin-node

en suite il faut éditer le fichier de configuration : /etc/munin/munin.conf
changer juste la valeur de htmldir pour choisir un répertoire où les fichiers html des [...]]]></description>
			<content:encoded><![CDATA[<p>... sur une debian.</p>
<p>Aujourd'hui on va voir comment installer et configurer l'outil de monitoring munin</p>
<p>Un petit article aide mémoire comme beaucoup d'autres sur ce blog :)</p>
<p>pour commencer :</p>

<div class="wp_codebox"><table><tr id="p1109"><td class="code" id="p110code9"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> munin munin-node</pre></td></tr></table></div>

<p>en suite il faut éditer le fichier de configuration : <em>/etc/munin/munin.conf</em></p>
<p>changer juste la valeur de htmldir pour choisir un répertoire où les fichiers html des rapports seront déposés, pour moi c'est sous un vhosts de statistiques, exemple :</p>

<div class="wp_codebox"><table><tr id="p11010"><td class="code" id="p110code10"><pre class="bash" style="font-family:monospace;">htmldir	<span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>munin</pre></td></tr></table></div>

<p>vous pouvez aussi laisser la valeur par défaut.</p>
<p>un autre fichier de configuration pourrait vous intéresser, personnellement je n'ai pas eu a le toucher : <em>/etc/munin/munin-node.conf</em></p>
<p><strong>Important : </strong>Assurez vous que le répertoire "htmldir" choisi plus haut soit accessible en écriture a l'utilisateur munin (sinon le cron vous bombarde de mails pas cool), moi j'ai fait un :</p>

<div class="wp_codebox"><table><tr id="p11011"><td class="code" id="p110code11"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">chown</span> <span style="color: #660033;">-R</span> munin:www-data MON<span style="color: #000000; font-weight: bold;">/</span>HTML<span style="color: #000000; font-weight: bold;">/</span>DIR<span style="color: #000000; font-weight: bold;">/</span>DE<span style="color: #000000; font-weight: bold;">/</span>MUNIN</pre></td></tr></table></div>

<p>maintenant on restart tout ça :</p>

<div class="wp_codebox"><table><tr id="p11012"><td class="code" id="p110code12"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>munin-node restart</pre></td></tr></table></div>

<p>quelques minutes après (le temps de générer quelques stats) on va a l'url correspondant au htmldir et on admire les garphs :)</p>
<p><center><img src="http://naeh.net/wp-content/uploads/2009/10/localhostlocaldomain-memory-day.png" alt="localhostlocaldomain-memory-day" title="localhostlocaldomain-memory-day" width="495" height="415" class="aligncenter size-full wp-image-111 margin:0 auto;" /></center></p>
]]></content:encoded>
			<wfw:commentRss>http://naeh.net/installer-et-configurer-munin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>convertir un array en utf8</title>
		<link>http://naeh.net/convertir-un-array-en-utf8/</link>
		<comments>http://naeh.net/convertir-un-array-en-utf8/#comments</comments>
		<pubDate>Tue, 09 Jun 2009 20:03:22 +0000</pubDate>
		<dc:creator>Naeh</dc:creator>
				<category><![CDATA[PHP / MySQL]]></category>
		<category><![CDATA[Programmation]]></category>
		<category><![CDATA[array]]></category>
		<category><![CDATA[conversion]]></category>
		<category><![CDATA[php5]]></category>
		<category><![CDATA[utf-8]]></category>

		<guid isPermaLink="false">http://naeh.net/?p=100</guid>
		<description><![CDATA[dans un précédent article nous avons vu comment convertir un texte en utf8.
aujourd'hui on va voir comment faire la même chose mais avec un tableau, sans passer par un foreach, ni aucune autre boucle.
pour cela nous allons utiliser une seule fonction qui convertira ce qu'on lui donne en entrée en utf8.
pour l'instant elle va savoir [...]]]></description>
			<content:encoded><![CDATA[<p>dans un <a href="http://naeh.net/comment-convertir-un-texte-en-utf-8/">précédent article</a> nous avons vu comment convertir un texte en utf8.</p>
<p>aujourd'hui on va voir comment faire la même chose mais avec un tableau, sans passer par un foreach, ni aucune autre boucle.</p>
<p>pour cela nous allons utiliser une seule fonction qui convertira ce qu'on lui donne en entrée en utf8.<br />
pour l'instant elle va savoir gérer, les chaînes de caractères et les tableaux.</p>

<div class="wp_codebox"><table><tr id="p10015"><td class="code" id="p100code15"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> toUTF8<span style="color: #009900;">&#40;</span><span style="color: #000088;">$param</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><a href="http://www.php.net/is_array"><span style="color: #990000;">is_array</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$param</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <a href="http://www.php.net/array_walk_recursive"><span style="color: #990000;">array_walk_recursive</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$param</span><span style="color: #339933;">,</span> <a href="http://www.php.net/create_function"><span style="color: #990000;">create_function</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'&amp;$item, $index'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'$item = toUTF8($item);'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">return</span> <span style="color: #000088;">$param</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <a href="http://www.php.net/mb_detect_order"><span style="color: #990000;">mb_detect_order</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'UTF-8, ISO-8859-15, ISO-8859-1, Windows-1252'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #666666; font-style: italic;">//parfois si le dernier caractère de la chaine est accentué, la conversion peut foirer, </span>
    <span style="color: #666666; font-style: italic;">//donc on force avec un caractère qui ne l'est pas.</span>
    <span style="color: #666666; font-style: italic;">//(astuce trouvée sur les commentaires de la doc sur php.net)</span>
    <span style="color: #000088;">$param</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">'_'</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$currentCharset</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/mb_detect_encoding"><span style="color: #990000;">mb_detect_encoding</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$param</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$currentCharset</span> <span style="color: #339933;">!=</span> <span style="color: #0000ff;">'UTF-8'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$param</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/mb_convert_encoding"><span style="color: #990000;">mb_convert_encoding</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$param</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'UTF-8'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$currentCharset</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #b1b100;">return</span> <a href="http://www.php.net/substr"><span style="color: #990000;">substr</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$param</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <a href="http://www.php.net/strlen"><span style="color: #990000;">strlen</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$param</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>	  
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>et voilà, cette fonction convertira array ou string en utf8 sans brancher...</p>
<p>en bonus voici une fonction somme que j'ai trouvé dans les commentaire de la doc sur php.net (une sorte de coup de coeur pour moi :-D)</p>

<div class="wp_codebox"><table><tr id="p10016"><td class="code" id="p100code16"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> sum<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$s</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span><a href="http://www.php.net/func_get_args"><span style="color: #990000;">func_get_args</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$a</span><span style="color: #009900;">&#41;</span> <span style="color: #000088;">$s</span><span style="color: #339933;">+=</span> <a href="http://www.php.net/is_numeric"><span style="color: #990000;">is_numeric</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$a</span><span style="color: #009900;">&#41;</span>?<span style="color: #000088;">$a</span><span style="color: #339933;">:</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">return</span> <span style="color: #000088;">$s</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">print</span> sum<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">2</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">3</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">4</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">5</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">6</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// will return 21</span>
<span style="color: #b1b100;">print</span> sum<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">3</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">2</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// will return 6</span>
<span style="color: #b1b100;">print</span> sum<span style="color: #009900;">&#40;</span><span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">,</span><a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">5</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">5</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// will return 10</span></pre></td></tr></table></div>

<p>trop fort non ?</p>
]]></content:encoded>
			<wfw:commentRss>http://naeh.net/convertir-un-array-en-utf8/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>protéger un ou plusieurs fichiers par htaccess</title>
		<link>http://naeh.net/proteger-un-ou-plusieurs-fichiers-par-htaccess/</link>
		<comments>http://naeh.net/proteger-un-ou-plusieurs-fichiers-par-htaccess/#comments</comments>
		<pubDate>Fri, 08 May 2009 16:46:23 +0000</pubDate>
		<dc:creator>Naeh</dc:creator>
				<category><![CDATA[Divers]]></category>
		<category><![CDATA[Programmation]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[htaccess]]></category>

		<guid isPermaLink="false">http://naeh.net/?p=95</guid>
		<description><![CDATA[Nous avons vu dans précédent article comment protéger un répertoire avec htaccess, c'est l'utilisation la plus courante de cette technique, mais ici nous allons nous intéresser a comment faire la même chose mais pour protéger uniquement un ou quelques fichiers d'un répertoire, c'est à dire, dans le même répertoire, certains fichiers seront protégés mais pas [...]]]></description>
			<content:encoded><![CDATA[<p>Nous avons vu dans <a href="http://naeh.net/proteger-un-repertoire-par-un-htaccess/">précédent article</a> comment protéger un répertoire avec htaccess, c'est l'utilisation la plus courante de cette technique, mais ici nous allons nous intéresser a comment faire la même chose mais pour protéger uniquement un ou quelques fichiers d'un répertoire, c'est à dire, dans le même répertoire, certains fichiers seront protégés mais pas d'autres.</p>
<p>pour protéger un seul fichier voici ce qu'il faut mettre dans le .htaccess :</p>

<div class="wp_codebox"><table><tr id="p9519"><td class="code" id="p95code19"><pre class="html" style="font-family:monospace;">&lt;Files fichier.ext&gt;
require valid-user
&lt;/Files&gt;</pre></td></tr></table></div>

<p>pour en protéger plusieurs :</p>

<div class="wp_codebox"><table><tr id="p9520"><td class="code" id="p95code20"><pre class="html" style="font-family:monospace;">&lt;Files fichier1.ext fichier2.ext fichier3.ext&gt;
require valid-user
&lt;/Files&gt;</pre></td></tr></table></div>

<p>cette syntaxe est a utiliser en complément de celle expliquée dans <a href="http://naeh.net/proteger-un-repertoire-par-un-htaccess">l'autre article</a> bien sûr.</p>
<p>bonne protection de fichiers...</p>
]]></content:encoded>
			<wfw:commentRss>http://naeh.net/proteger-un-ou-plusieurs-fichiers-par-htaccess/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Lighttpd vs Apache vs Lighttpd + Apache</title>
		<link>http://naeh.net/lighttpd-vs-apache-vs-lighttpd-apache/</link>
		<comments>http://naeh.net/lighttpd-vs-apache-vs-lighttpd-apache/#comments</comments>
		<pubDate>Tue, 07 Apr 2009 21:37:46 +0000</pubDate>
		<dc:creator>Naeh</dc:creator>
				<category><![CDATA[Divers]]></category>
		<category><![CDATA[Linux - Logiciels]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[benchmark]]></category>
		<category><![CDATA[lamp]]></category>
		<category><![CDATA[lighttpd]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[php5]]></category>

		<guid isPermaLink="false">http://naeh.net/?p=85</guid>
		<description><![CDATA[Il fut un temps où on ne se posait pas de question quant au serveur web, on prend Apache et on en parle plus, aujourd'hui les choses ont changé, Apache reste quand même le plus utilisé avec plus de 66% des parts de marché, suivi par IIS, puis tous les autres "petits" derrière, néanmoins en [...]]]></description>
			<content:encoded><![CDATA[<p>Il fut un temps où on ne se posait pas de question quant au serveur web, on prend Apache et on en parle plus, aujourd'hui les choses ont changé, Apache reste quand même le plus utilisé avec plus de 66% des parts de marché, suivi par IIS, puis tous les autres "petits" derrière, néanmoins en fonction des besoins, certains de ces petits peuvent s'avérer bien plus performants qu'Apache, aujourd'hui on va tester 3 configurations possibles avec Apache et Lighttpd.</p>
<p>d'après ce qu'on peut lire un peu partout sur le net, Lighttpd (lighty pour les intimes) est beaucoup plus performant quand il s'agit de servir des pages statiques, mais qu'en est-il vraiment ? et comment s'en sort-il avec le contenu dynamique ? (des sites statiques ça n'existe plus de nos jours ^^).</p>
<p>pour notre test, on va prendre un site très léger, basé sur Zend framework (donc loin d'être statique), contenant une page qui affiche 9 images au hasard a partir d'une tables mysql contenant environ 1000 enregistrements (seulement les emplacement des images sont stockés dans la base). Le serveur de test est un kimsufi L (petit processeur et 1Go de RAM).</p>
<p><strong>versions utilisées : </strong><br />
<a href="http://www.apache.org/" target="_blank">Apache 2.2.9</a><br />
<a href="http://www.lighttpd.net/" target="_blank">Lighttpd 1.4.19</a><br />
<a href="http://fr.php.net/" target="_blank">PHP 5.2.6</a></p>
<p>pour les tests on utilise <a href="http://packages.debian.org/fr/sid/siege" target="_blank">siege</a>, on lance donc un siege avec 100 concurrency sur 10 minutes, voici la commande :</p>

<div class="wp_codebox"><table><tr id="p8526"><td class="code" id="p85code26"><pre class="bash" style="font-family:monospace;">siege <span style="color: #660033;">-c100</span> <span style="color: #660033;">-t10M</span> URL_DU_SITE</pre></td></tr></table></div>

<p>on note également le Load average de la machine a la fin de l'opération.</p>
<h2>1ère configuration : Lighttpd tout seul</h2>
<p>voici le resultat :</p>

<div class="wp_codebox"><table><tr id="p8527"><td class="code" id="p85code27"><pre class="bash" style="font-family:monospace;">Load average : <span style="color: #000000;">4.87</span>
&nbsp;
Lifting the server siege...      done.
Transactions:		       <span style="color: #000000;">23859</span> hits
Availability:		      <span style="color: #000000;">100.00</span> <span style="color: #000000; font-weight: bold;">%</span>
Elapsed <span style="color: #000000; font-weight: bold;">time</span>:		      <span style="color: #000000;">600.37</span> secs
Data transferred:	       <span style="color: #000000;">83.25</span> MB
Response <span style="color: #000000; font-weight: bold;">time</span>:		        <span style="color: #000000;">2.02</span> secs
Transaction rate:	       <span style="color: #000000;">39.74</span> trans<span style="color: #000000; font-weight: bold;">/</span>sec
Throughput:		        <span style="color: #000000;">0.14</span> MB<span style="color: #000000; font-weight: bold;">/</span>sec
Concurrency:		       <span style="color: #000000;">80.21</span>
Successful transactions:       <span style="color: #000000;">23859</span>
Failed transactions:	           <span style="color: #000000;">0</span>
Longest transaction:	        <span style="color: #000000;">5.20</span>
Shortest transaction:	        <span style="color: #000000;">0.10</span></pre></td></tr></table></div>

<h2>2ème configuration : Apache2 tout seul</h2>
<p>le résultat :</p>

<div class="wp_codebox"><table><tr id="p8528"><td class="code" id="p85code28"><pre class="bash" style="font-family:monospace;">Load average : <span style="color: #000000;">77.51</span>
&nbsp;
Lifting the server siege...      done.
Transactions:		       <span style="color: #000000;">23543</span> hits
Availability:		      <span style="color: #000000;">100.00</span> <span style="color: #000000; font-weight: bold;">%</span>
Elapsed <span style="color: #000000; font-weight: bold;">time</span>:		      <span style="color: #000000;">599.66</span> secs
Data transferred:	       <span style="color: #000000;">82.16</span> MB
Response <span style="color: #000000; font-weight: bold;">time</span>:		        <span style="color: #000000;">2.04</span> secs
Transaction rate:	       <span style="color: #000000;">39.26</span> trans<span style="color: #000000; font-weight: bold;">/</span>sec
Throughput:		        <span style="color: #000000;">0.14</span> MB<span style="color: #000000; font-weight: bold;">/</span>sec
Concurrency:		       <span style="color: #000000;">80.22</span>
Successful transactions:       <span style="color: #000000;">23543</span>
Failed transactions:	           <span style="color: #000000;">0</span>
Longest transaction:	       <span style="color: #000000;">10.51</span>
Shortest transaction:	        <span style="color: #000000;">0.05</span></pre></td></tr></table></div>

<h2>3ème configuration : Lighttpd + Apache</h2>
<p>maintenant faisons le test en couplant les 2, dans cette configuration tout ce qui est statique (images, css, js, etc.) sera servi par lighty alors que les scripts php eux, seront traités par apache, pour cela on active le mod_proxy dans lighty, et on ajoute le code suivant dans le vhost de notre site :</p>

<div class="wp_codebox"><table><tr id="p8529"><td class="code" id="p85code29"><pre class="bash" style="font-family:monospace;"> <span style="color: #007800;">$HTTP</span><span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #ff0000;">&quot;url&quot;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #000000; font-weight: bold;">!</span>~ <span style="color: #ff0000;">&quot;\.(js|css|gif|jpg|png|ico|txt|swf|html|htm)$&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
               proxy.server  = <span style="color: #7a0874; font-weight: bold;">&#40;</span> <span style="color: #ff0000;">&quot;&quot;</span> =<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>
                               <span style="color: #7a0874; font-weight: bold;">&#40;</span> <span style="color: #ff0000;">&quot;host&quot;</span> =<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #ff0000;">&quot;127.0.0.1&quot;</span>, <span style="color: #ff0000;">&quot;port&quot;</span> =<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000;">8080</span> <span style="color: #7a0874; font-weight: bold;">&#41;</span>
                       <span style="color: #7a0874; font-weight: bold;">&#41;</span>
               <span style="color: #7a0874; font-weight: bold;">&#41;</span>
       <span style="color: #7a0874; font-weight: bold;">&#125;</span></pre></td></tr></table></div>

<p>vous l'aurez compris, Apache écoute sur le port 8080 (c'est fait en changeant le fichier /etc/apache2/ports.conf).</p>
<p>voici le résultat :</p>

<div class="wp_codebox"><table><tr id="p8530"><td class="code" id="p85code30"><pre class="bash" style="font-family:monospace;">Load average : <span style="color: #000000;">14.79</span>
&nbsp;
Lifting the server siege...      done.
Transactions:		       <span style="color: #000000;">22684</span> hits
Availability:		      <span style="color: #000000;">100.00</span> <span style="color: #000000; font-weight: bold;">%</span>
Elapsed <span style="color: #000000; font-weight: bold;">time</span>:		      <span style="color: #000000;">600.25</span> secs
Data transferred:	       <span style="color: #000000;">79.10</span> MB
Response <span style="color: #000000; font-weight: bold;">time</span>:		        <span style="color: #000000;">2.13</span> secs
Transaction rate:	       <span style="color: #000000;">37.79</span> trans<span style="color: #000000; font-weight: bold;">/</span>sec
Throughput:		        <span style="color: #000000;">0.13</span> MB<span style="color: #000000; font-weight: bold;">/</span>sec
Concurrency:		       <span style="color: #000000;">80.53</span>
Successful transactions:       <span style="color: #000000;">22684</span>
Failed transactions:	           <span style="color: #000000;">0</span>
Longest transaction:	        <span style="color: #000000;">8.61</span>
Shortest transaction:	        <span style="color: #000000;">0.07</span></pre></td></tr></table></div>

<p>plutôt surprenant !</p>
<h2>Conclusion :</h2>
<p>Lighty s'en sort très bien au vu des transactions/s (ou le nombre total de transactions traitées), contrairement a ce qu'on pouvait attendre, coupler les 2 nous fait perdre en performances (on enregistre quand même un load average nettement inférieur a la config d'apache tout seul).</p>
<p>personnellement ce que je retiens, c'est que lighty n'est pas si mauvais que ça pour le contenu dynamique, les performances restent quand très proches dans les 3 cas, donc autant utiliser la solution qui nous plait :-)</p>
]]></content:encoded>
			<wfw:commentRss>http://naeh.net/lighttpd-vs-apache-vs-lighttpd-apache/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Masked Input Plugin</title>
		<link>http://naeh.net/masked-input-plugin/</link>
		<comments>http://naeh.net/masked-input-plugin/#comments</comments>
		<pubDate>Sun, 22 Mar 2009 14:00:55 +0000</pubDate>
		<dc:creator>Naeh</dc:creator>
				<category><![CDATA[Divers]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[plugin]]></category>

		<guid isPermaLink="false">http://naeh.net/?p=72</guid>
		<description><![CDATA[Ou comment permettre à un utilisateur se saisir plus facilement dans un formulaire des données a longueur fixe, ou de format spécifique (dates, numéros de téléphone, etc.) sans se préoccuper du formatage.
C'est un plugin pour jQuery, il a été testé sur Internet Explorer 6 / 7, Firefox 1.5/2/3, Safari, Opera et Chrome.
Son fonctionnement :
on va [...]]]></description>
			<content:encoded><![CDATA[<p>Ou comment permettre à un utilisateur se saisir plus facilement dans un formulaire des données a longueur fixe, ou de format spécifique (dates, numéros de téléphone, etc.) sans se préoccuper du formatage.</p>
<p>C'est un plugin pour jQuery, il a été testé sur Internet Explorer 6 / 7, Firefox 1.5/2/3, Safari, Opera et Chrome.</p>
<p><strong>Son fonctionnement :</strong><br />
on va prendre un champ date au format <strong>dd/mm/YYYY</strong> pour l'exemple :</p>
<p>quand le champ du formulaire reçoit le focus, le plugin va automatiquement pré-remplir le champ avec "<strong>__/__/____</strong>" et votre saisie va automatiquement remplacer la chaine par défaut, ainsi pour une date vous n'aurez pas a saisir les / juste les information de la date, ce qui est quand même par mal pour l'utilisateur final.</p>
<p>vous trouverez plus d'exemples sur cette page : <a href="http://digitalbush.com/projects/masked-input-plugin/">Masked Input Plugin</a></p>
<p>l'onglet "usage" vous sera de grande utilité pour la partie implémentation et utilisation.</p>
<p>voici une vidéo pour illustrer quelques exemples :<br />
<center><br />
<object width="480" height="295"><param name="movie" value="http://www.youtube.com/v/BMaTiGKykl8&#038;hl=fr&#038;fs=1&#038;rel=0"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/BMaTiGKykl8&#038;hl=fr&#038;fs=1&#038;rel=0" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="295"></embed></object></center></p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://naeh.net/masked-input-plugin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Internet Explorer 8</title>
		<link>http://naeh.net/internet-explorer-8/</link>
		<comments>http://naeh.net/internet-explorer-8/#comments</comments>
		<pubDate>Sun, 22 Mar 2009 12:19:19 +0000</pubDate>
		<dc:creator>Naeh</dc:creator>
				<category><![CDATA[Divers]]></category>
		<category><![CDATA[Windows - Logiciels]]></category>
		<category><![CDATA[internet explorer 8]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://naeh.net/?p=66</guid>
		<description><![CDATA[IE 8 a été annoncé en version finale lors du MIX09 de Microsoft qui s'est déroulé du 19 au 20 mars à Las vegas. Tout le monde peut le télécharger depuis le 19 mars.
Du coté des développeurs cette version est très attendue, surtout après une version 7 un peu décevante... Donc qu'en est-il avec cette [...]]]></description>
			<content:encoded><![CDATA[<p>IE 8 a été annoncé en version finale lors du <a href="http://live.visitmix.com/" target="_blank">MIX09</a> de Microsoft qui s'est déroulé du 19 au 20 mars à Las vegas. Tout le monde peut le télécharger depuis le 19 mars.</p>
<p>Du coté des développeurs cette version est très attendue, surtout après une version 7 un peu décevante... Donc qu'en est-il avec cette nouvelle version ?</p>
<p>Chez nous les développeurs, la règle d'or est : "on ne réinvente pas la roue !", du coup au lieux de vous faire un article en 30 pages, je vais juste relayer un super article fait par <a href="http://www.alsacreations.com">Alsacréations</a> avec toutes les nouveautés d'IE8, tout ce qu'il supporte, ne supporte pas, etc. en résumé : <a href="http://www.alsacreations.com/actu/lire/680-telecharger-internet-explorer-8.html">un article complet sur IE8</a>, bonne lecture...</p>
]]></content:encoded>
			<wfw:commentRss>http://naeh.net/internet-explorer-8/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>VirtualBox configurer la connexion réseau de la machine virtuelle</title>
		<link>http://naeh.net/virtualbox-configurer-la-connexion-reseau-de-la-machine-virtuelle/</link>
		<comments>http://naeh.net/virtualbox-configurer-la-connexion-reseau-de-la-machine-virtuelle/#comments</comments>
		<pubDate>Tue, 09 Dec 2008 22:18:51 +0000</pubDate>
		<dc:creator>Naeh</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Linux - OS]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[Windows - Logiciels]]></category>
		<category><![CDATA[Windows - OS]]></category>
		<category><![CDATA[connexion]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[internet]]></category>
		<category><![CDATA[réseau]]></category>
		<category><![CDATA[virtualBox]]></category>

		<guid isPermaLink="false">http://naeh.net/?p=63</guid>
		<description><![CDATA[Après l'installation d'une machine virtuelle avec VirtualBox, il faut bien sûr la connecter à Internet, pour cela on a 2 méthodes :

Le mode NAT
Adaptateur réseau hôte

Le mode NAT :
Avec ce type de configuration, la machine aura accès au net, mais sans plus, elle ne sera pas joignable, elle ne sera pas visible sur le réseau, [...]]]></description>
			<content:encoded><![CDATA[<p>Après l'installation d'une machine virtuelle avec VirtualBox, il faut bien sûr la connecter à Internet, pour cela on a 2 méthodes :</p>
<ol>
<li>Le mode NAT</li>
<li>Adaptateur réseau hôte</li>
</ol>
<h3>Le mode NAT :</h3>
<p>Avec ce type de configuration, la machine aura accès au net, mais sans plus, elle ne sera pas joignable, elle ne sera pas visible sur le réseau, c'est le plus simple, le plus rapide, mais pas le plus efficace, néanmoins, ça peut suffire dans la plupart des cas. D'ailleurs, c'est la configuration par défaut de VirtualBox, donc il n'y a rien à faire pour que ça fonctionne.</p>
<h3>Adaptateur réseau du système hôte :</h3>
<p>Cette configuration fait que, non seulement, la machine virtuelle aura accès au net, mais elle sera elle même joignable depuis le réseau, avec cette configuration, la machine virtuelle apparaitra sur le réseau comme une machine indépendante du système hôte, ce qui est plutôt appréciable pour certaines utilisations, indispensable pour d'autres.</p>
<p>Nous allons voir comment procéder à cette configuration dans le cadre d'un système hôte sous XP (ou Vista) et une machine virtuelle sous Linux (Debian Etch en l'occurrence).</p>
<p>Tout d'abord, aller dans les paramètres de la machine virtuelle (éteinte ;-) ) et modifier les options du réseau, dans la partie basse de la fenêtre ajouter une interface réseau (cliquez sur le "+" a droite de la fenêtre, cela créera une interface réseau supplémentaire qu'on utilisera plus tard (visible dans les connexions réseau).</p>
<p>dans "Attaché à :" sélectionnez "Adaptateur réseau hôte", puis validez.</p>
<p>aller dans les connexions réseau, sélectionnez votre connexion habituelle (en général elle s'appelle :"connexion au réseau local") et la connexion virtuelle créée précédemment, puis cliquez sur le bouton droit de la souris (il faut sélectionner les 2 en même temps), et dans le menu contextuel cliquez sur "connexion de ponts", ceci va créer un pont entre les 2 connexions réseau (en gros il va donner la connexion a l'interface virtuelle).</p>
<p>normalement si tout va bien votre machine virtuelle est ajouté au réseau (il faut l'allumer hein ;-) ), elle obtient directement son adresse IP (si vous avez un serveur DHCP sur le réseau bien sûr, sinon rester en NAT ou configurez une IP fixe).</p>
<p>En cas de problème n'hésitez pas à recommencer, parfois ça a du mal a fonctionner.</p>
<h4>Quelques pistes en cas de problème :</h4>
<p>parfois, si on a fait plusieurs tests, bidouillé un peu /etc/network/interfaces etc. l'interface coté linux peut changer de nom, en général c'est eth0 mais c'est pas toujours le cas, voici un moyen simple de savoir comment est appelée l'interface réseau :</p>

<div class="wp_codebox"><table><tr id="p6333"><td class="code" id="p63code33"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #000000; font-weight: bold;">/</span>proc<span style="color: #000000; font-weight: bold;">/</span>net<span style="color: #000000; font-weight: bold;">/</span>dev</pre></td></tr></table></div>

<p>dans le résultat de cette commande on voit le nom de l'interface, pratique pour la configurer à la main (IP statique par exemple) en tout cas ça m'a bien servi pour voir que mon interface s'appelait eth4 ;-)</p>
<p>n'oublier pas une petit</p>

<div class="wp_codebox"><table><tr id="p6334"><td class="code" id="p63code34"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>networking restart</pre></td></tr></table></div>

<p>après chanque changement dans /etc/network/interfaces</p>
<p>Bonne chance, et bonne virtualisation :-)</p>
]]></content:encoded>
			<wfw:commentRss>http://naeh.net/virtualbox-configurer-la-connexion-reseau-de-la-machine-virtuelle/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>
