<?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>Fri, 27 Aug 2010 14:18:17 +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>Iptables &#8211; supprimer une règle spécifique</title>
		<link>http://naeh.net/iptables-supprimer-une-regle-specifique/</link>
		<comments>http://naeh.net/iptables-supprimer-une-regle-specifique/#comments</comments>
		<pubDate>Fri, 27 Aug 2010 14:16:34 +0000</pubDate>
		<dc:creator>Naeh</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Linux - Logiciels]]></category>
		<category><![CDATA[Linux - OS]]></category>
		<category><![CDATA[fail2ban]]></category>
		<category><![CDATA[iptables]]></category>

		<guid isPermaLink="false">http://naeh.net/?p=179</guid>
		<description><![CDATA[Si comme moi, vous utilisez fail2ban ce qui est une très bonne chose, et que comme moi vous avez oublié de lui dire d'ignorer votre IP ce qui est une mauvaise chose et que par malheur vous vous plantez X fois (chez moi au bout du 2eme fail en 2 heures ==> ban pendant 10 [...]]]></description>
			<content:encoded><![CDATA[<p>Si comme moi, vous utilisez fail2ban ce qui est une très bonne chose, et que comme moi vous avez oublié de lui dire d'ignorer votre IP ce qui est une mauvaise chose et que par malheur vous vous plantez X fois (chez moi au bout du 2eme fail en 2 heures ==> ban pendant 10 jours !) </p>
<p>pour commencer il faut trouver une autre porte d'entrée au serveur (une autre adresse IP)</p>
<p>en suite le but est de supprimer la règle concernant votre IP sans devoir toucher aux autres règles voici comment faire :</p>

<div class="wp_codebox"><table><tr id="p1794"><td class="code" id="p179code4"><pre class="bash" style="font-family:monospace;">iptables <span style="color: #660033;">-L</span> <span style="color: #660033;">--line-numbers</span></pre></td></tr></table></div>

<p>ce qui donne (entre autre) :</p>

<div class="wp_codebox"><table><tr id="p1795"><td class="code" id="p179code5"><pre class="bash" style="font-family:monospace;">Chain fail2ban-ssh <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">1</span> references<span style="color: #7a0874; font-weight: bold;">&#41;</span>
num  target     prot opt <span style="color: #7a0874; font-weight: bold;">source</span>               destination
<span style="color: #000000;">1</span>    DROP       all  <span style="color: #660033;">--</span>  kol-static-<span style="color: #000000;">36</span>-<span style="color: #000000;">240</span>-<span style="color: #000000;">16</span>-<span style="color: #000000;">61</span>.direct.net.in  anywhere
<span style="color: #000000;">2</span>    DROP       all  <span style="color: #660033;">--</span>  unknown-host.yaltanet.com.ua  anywhere
<span style="color: #000000;">3</span>    RETURN     all  <span style="color: #660033;">--</span>  anywhere             anywhere</pre></td></tr></table></div>

<p>là on vois qu'il y a 2 ip bannies, il faut repérer le numéro de ligne de cette qu'on veut supprimer (ce qui revient à autoriser l'ip a se connecter au serveur)</p>

<div class="wp_codebox"><table><tr id="p1796"><td class="code" id="p179code6"><pre class="bash" style="font-family:monospace;">iptables <span style="color: #660033;">-D</span> fail2ban-ssh X</pre></td></tr></table></div>

<p>fail2ban-ssh : le nom de la chain créée par fail2ban pour le ssh<br />
X : le #numéro de ligne qui nous intéresse</p>
]]></content:encoded>
			<wfw:commentRss>http://naeh.net/iptables-supprimer-une-regle-specifique/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Subversion 1.6 sur Debian lenny</title>
		<link>http://naeh.net/subversion-1-6-sur-debian-lenny/</link>
		<comments>http://naeh.net/subversion-1-6-sur-debian-lenny/#comments</comments>
		<pubDate>Wed, 30 Jun 2010 18:56:54 +0000</pubDate>
		<dc:creator>Naeh</dc:creator>
				<category><![CDATA[Linux - Logiciels]]></category>
		<category><![CDATA[svn subversion debian backports]]></category>

		<guid isPermaLink="false">http://naeh.net/?p=169</guid>
		<description><![CDATA[alors là c'est le billet mémo par excellence :)
étant utilisateur occasionnel de tortoiseSVN à jour, impossible pour moi d'utiliser svn en ligne de commande (beaucoup plus rapide que tortoise) sur ma debian, d'où l'idée de d'installer svn 1.6 qui n'est pas disponible dans les paquets debian.
la procédure consiste a utiliser les backports, elle est très [...]]]></description>
			<content:encoded><![CDATA[<p>alors là c'est le billet mémo par excellence :)</p>
<p>étant utilisateur occasionnel de tortoiseSVN à jour, impossible pour moi d'utiliser svn en ligne de commande (beaucoup plus rapide que tortoise) sur ma debian, d'où l'idée de d'installer svn 1.6 qui n'est pas disponible dans les paquets debian.</p>
<p>la procédure consiste a utiliser les backports, elle est très simple, encore faut-il la connaitre (ou la trouver facilement)</p>
<p>pour commencer il faut savoir que svn 1.5 doit être déjà installé sur la machine, si ce n'est pas le cas, faire :</p>

<div class="wp_codebox"><table><tr id="p16911"><td class="code" id="p169code11"><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> subversion subversion-tools apache2 libapache2-svn</pre></td></tr></table></div>

<p>1. configuration du sources.list<br />
il faut ajouter cette ligne à la fin du fichier <em>/etc/apt/sources.list</em></p>

<div class="wp_codebox"><table><tr id="p16912"><td class="code" id="p169code12"><pre class="sh" style="font-family:monospace;">deb http://www.backports.org/debian lenny-backports main contrib non-free</pre></td></tr></table></div>

<p>2. configurer les backports :</p>

<div class="wp_codebox"><table><tr id="p16913"><td class="code" id="p169code13"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">wget</span> <span style="color: #660033;">-O</span> - http:<span style="color: #000000; font-weight: bold;">//</span>backports.org<span style="color: #000000; font-weight: bold;">/</span>debian<span style="color: #000000; font-weight: bold;">/</span>archive.key <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">apt-key</span> add -
<span style="color: #c20cb9; font-weight: bold;">apt-get</span> update</pre></td></tr></table></div>

<p>3. on instalel svn en spécifiant la source (backports) :</p>

<div class="wp_codebox"><table><tr id="p16914"><td class="code" id="p169code14"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #660033;">-t</span> lenny-backports <span style="color: #c20cb9; font-weight: bold;">install</span> subversion subversion-tools libapache2-svn</pre></td></tr></table></div>

<p>et maintenant on peut utiliser svn en ligne de commande avec des référentiels "commités" avec des version récentes de subversion (comme tortoise)</p>
<p>Source du tuto : <a href="http://swherdman.com/2009/05/subversion-16-on-debian-lenny/">http://swherdman.com/2009/05/subversion-16-on-debian-lenny/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://naeh.net/subversion-1-6-sur-debian-lenny/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Configuration d&#8217;Exim avec nom de domaine géré par gandi</title>
		<link>http://naeh.net/configuration-dexim-avec-nom-de-domaine-gere-par-gandi/</link>
		<comments>http://naeh.net/configuration-dexim-avec-nom-de-domaine-gere-par-gandi/#comments</comments>
		<pubDate>Sat, 27 Mar 2010 12:26:40 +0000</pubDate>
		<dc:creator>Naeh</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Linux - Logiciels]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[exim]]></category>
		<category><![CDATA[gandi]]></category>
		<category><![CDATA[postfix]]></category>

		<guid isPermaLink="false">http://naeh.net/?p=151</guid>
		<description><![CDATA[Bonjour,
aujourd'hui nous allons voir comment, facilement, exploiter une fonctionnalité offerte par Gandi (ou bien comprise dans le prix de nom de domaine, ça dépend comment on voit les choses).
beaucoup d'entre nous n'ont pas le temps (et souvent pas l'envie de non plus) de se prendre la tête avec un vrai MTA genre postfix ou exim [...]]]></description>
			<content:encoded><![CDATA[<p>Bonjour,</p>
<p>aujourd'hui nous allons voir comment, facilement, exploiter une fonctionnalité offerte par Gandi (ou bien comprise dans le prix de nom de domaine, ça dépend comment on voit les choses).</p>
<p>beaucoup d'entre nous n'ont pas le temps (et souvent pas l'envie de non plus) de se prendre la tête avec un vrai MTA genre postfix ou exim et le configurer en s'assurant de bien renseigner les enregistrement MX chez le registrar, d'installer les bons outils pour le POP (ou IMAP) etc. etc.</p>
<p>il faut savoir qu'avec un nom de domaine de chez Gandi, on a droit a quelques comptes emails (5 par domaine de mémoire) et une infinité d'alias sur ces comptes.</p>
<p>ce qu'on va voir ici, c'est comment configurer une machine (serveur dédié) pour assurer le minimum syndical en s'appuyant sur le service proposé par gandi.</p>
<p>dans notre exemple il s'agira d'un Exim4 (c'est le seul avec lequel j'ai testé pour l'instant, et ça marche tellement bien que je n'ai pas envie de changer :-)  )</p>
<p>on va supposer un compte admin@mon-domaine.com</p>
<p>tout d'abord il faut éditer le fichier : <strong>/etc/exim4/passwd.client</strong> en ajoutant tout à la fin :</p>

<div class="wp_codebox"><table><tr id="p15119"><td class="code" id="p151code19"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">*</span>:admin<span style="color: #000000; font-weight: bold;">@</span>mon-domaine.com:MOT-DE-PASSE-DU-COMPTE</pre></td></tr></table></div>

<p>en suite, on va éditer le fichier <strong>/etc/exim4/update-exim4.conf.conf</strong> pour avoir quelque chose comme :</p>

<div class="wp_codebox"><table><tr id="p15120"><td class="code" id="p151code20"><pre class="bash" style="font-family:monospace;"><span style="color: #007800;">dc_eximconfig_configtype</span>=<span style="color: #ff0000;">'satellite'</span>
<span style="color: #007800;">dc_other_hostnames</span>=<span style="color: #ff0000;">''</span>
<span style="color: #007800;">dc_local_interfaces</span>=<span style="color: #ff0000;">'127.0.0.1'</span>
<span style="color: #007800;">dc_readhost</span>=<span style="color: #ff0000;">'mon-domaine.com'</span>
<span style="color: #007800;">dc_relay_domains</span>=<span style="color: #ff0000;">''</span>
<span style="color: #007800;">dc_minimaldns</span>=<span style="color: #ff0000;">'false'</span>
<span style="color: #007800;">dc_relay_nets</span>=<span style="color: #ff0000;">''</span>
<span style="color: #007800;">dc_smarthost</span>=<span style="color: #ff0000;">'mail.gandi.net:587'</span>
<span style="color: #007800;">CFILEMODE</span>=<span style="color: #ff0000;">'644'</span>
<span style="color: #007800;">dc_use_split_config</span>=<span style="color: #ff0000;">'false'</span>
<span style="color: #007800;">dc_hide_mailname</span>=<span style="color: #ff0000;">'true'</span>
<span style="color: #007800;">dc_mailname_in_oh</span>=<span style="color: #ff0000;">'true'</span>
<span style="color: #007800;">dc_localdelivery</span>=<span style="color: #ff0000;">'mail_spool'</span></pre></td></tr></table></div>

<p>un petit</p>

<div class="wp_codebox"><table><tr id="p15121"><td class="code" id="p151code21"><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>exim4 reload</pre></td></tr></table></div>

<p>et le tour est joué :)</p>
<p>votre serveur envoie maintenant ces mails en utilisant le compte gandi, plus de soucis de conf complexe, maj à risque etc a se faire...</p>
<p>pour tester :</p>

<div class="wp_codebox"><table><tr id="p15122"><td class="code" id="p151code22"><pre class="bash" style="font-family:monospace;">test-machine:<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>exim4<span style="color: #666666; font-style: italic;"># mail user@omain.tld</span>
Subject: <span style="color: #7a0874; font-weight: bold;">test</span>
ceci est un message de <span style="color: #7a0874; font-weight: bold;">test</span> <span style="color: #000000; font-weight: bold;">!</span>
.
Cc:</pre></td></tr></table></div>

<p>PS. procédure trouvé il y a un moment sur les forums gandi, mais je n'arrive jamais a la retrouver je la mets ici, au cas où.<br />
PS2. comme d'habitude, notre distribution ici est une Debian :)</p>
]]></content:encoded>
			<wfw:commentRss>http://naeh.net/configuration-dexim-avec-nom-de-domaine-gere-par-gandi/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<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>1</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="p11525"><td class="code" id="p115code25"><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="p11526"><td class="code" id="p115code26"><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="p11031"><td class="code" id="p110code31"><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="p11032"><td class="code" id="p110code32"><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="p11033"><td class="code" id="p110code33"><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="p11034"><td class="code" id="p110code34"><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="p10037"><td class="code" id="p100code37"><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="p10038"><td class="code" id="p100code38"><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="p9541"><td class="code" id="p95code41"><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="p9542"><td class="code" id="p95code42"><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="p8548"><td class="code" id="p85code48"><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="p8549"><td class="code" id="p85code49"><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="p8550"><td class="code" id="p85code50"><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="p8551"><td class="code" id="p85code51"><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="p8552"><td class="code" id="p85code52"><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>
	</channel>
</rss>
