<?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 &#187; Serveur</title>
	<atom:link href="http://naeh.net/tag/serveur/feed/" rel="self" type="application/rss+xml" />
	<link>http://naeh.net</link>
	<description>Le mémo du développeur</description>
	<lastBuildDate>Wed, 30 Jun 2010 18:56:54 +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>Installer libssh2, ssh2 pour php</title>
		<link>http://naeh.net/installer-libssh2-ssh2-pour-php/</link>
		<comments>http://naeh.net/installer-libssh2-ssh2-pour-php/#comments</comments>
		<pubDate>Wed, 08 Oct 2008 20:51:00 +0000</pubDate>
		<dc:creator>Naeh</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Linux - Logiciels]]></category>
		<category><![CDATA[PHP / MySQL]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[cli]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[extension]]></category>
		<category><![CDATA[libssh2]]></category>
		<category><![CDATA[php5]]></category>
		<category><![CDATA[Serveur]]></category>
		<category><![CDATA[ssh2]]></category>

		<guid isPermaLink="false">http://naeh.net/?p=56</guid>
		<description><![CDATA[Dans cet article nous allons voir comment installer l'extension ssh2 pour php5, cette extension permet l'utilisation de fonctionnalités SSH2 avec php (très utiles quand on veut faire du SFTP par exemple) pour plus d'informations cf. la documentation officielle sur php.net
Pour l'installation, ce n'est pas très compliqué, il suffit de suivre ces quelques étapes à la [...]]]></description>
			<content:encoded><![CDATA[<p>Dans cet article nous allons voir comment installer l'extension ssh2 pour php5, cette extension permet l'utilisation de fonctionnalités SSH2 avec php (très utiles quand on veut faire du SFTP par exemple) pour plus d'informations cf. <a href="http://fr.php.net/manual/fr/book.ssh2.php" target="_blank">la documentation officielle sur php.net</a></p>
<p>Pour l'installation, ce n'est pas très compliqué, il suffit de suivre ces quelques étapes à la lettre et tout ira très bien ;-)</p>
<p>tout d'abord il faut s'assurer d'avoir les bons paquets d'installés, en voici une liste :</p>
<ul>
<li>php5-dev</li>
<li>openssl</li>
<li>libssl-dev</li>
<li>gcc</li>
<li>make</li>
<li>etc. je suppose que si vous installez cette extension, c'est que vous avez déjà php, apache etc.</li>
</ul>
<p><em>Toute la suite s'effectue en root</em></p>
<p>mais avant toute chose, n'oublions pas de faire un petit :</p>

<div class="wp_codebox"><table><tr id="p5611"><td class="code" id="p56code11"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">apt-get</span> update
<span style="color: #c20cb9; font-weight: bold;">apt-get</span> upgrade</pre></td></tr></table></div>

<p>en suite il faut créer un répertoire de travail :</p>

<div class="wp_codebox"><table><tr id="p5612"><td class="code" id="p56code12"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> ~
<span style="color: #c20cb9; font-weight: bold;">mkdir</span> libssh2
<span style="color: #7a0874; font-weight: bold;">cd</span> libssh2</pre></td></tr></table></div>

<p>ensuite télécharger libssh2 :</p>

<div class="wp_codebox"><table><tr id="p5613"><td class="code" id="p56code13"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>ovh.dl.sourceforge.net<span style="color: #000000; font-weight: bold;">/</span>sourceforge<span style="color: #000000; font-weight: bold;">/</span>libssh2<span style="color: #000000; font-weight: bold;">/</span>libssh2-<span style="color: #000000;">0.14</span>.tar.gz</pre></td></tr></table></div>

<p>puis l'extraire :</p>

<div class="wp_codebox"><table><tr id="p5614"><td class="code" id="p56code14"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">tar</span> <span style="color: #660033;">-xzvf</span> libssh2-<span style="color: #000000;">0.14</span>.tar.gz</pre></td></tr></table></div>

<p>aller dans le répertoire créé et installer libssh2 :</p>

<div class="wp_codebox"><table><tr id="p5615"><td class="code" id="p56code15"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> libssh2-<span style="color: #000000;">0.14</span>
.<span style="color: #000000; font-weight: bold;">/</span>configure <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #c20cb9; font-weight: bold;">make</span> all <span style="color: #c20cb9; font-weight: bold;">install</span></pre></td></tr></table></div>

<p>maintenant que libssh2 est installée, passons a ssh2 :</p>
<p>on sort du repertoire de libssh2 et on télécharge ssh2 :</p>

<div class="wp_codebox"><table><tr id="p5616"><td class="code" id="p56code16"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> ..
<span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>pecl.php.net<span style="color: #000000; font-weight: bold;">/</span>get<span style="color: #000000; font-weight: bold;">/</span>ssh2-<span style="color: #000000;">0.10</span>.tgz</pre></td></tr></table></div>

<p>extraire l'archive téléchargée :</p>

<div class="wp_codebox"><table><tr id="p5617"><td class="code" id="p56code17"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">tar</span> <span style="color: #660033;">-xzvf</span> ssh2-<span style="color: #000000;">0.10</span>.tgz</pre></td></tr></table></div>

<p>aller dans le répertoire créé et installer ssh2 :</p>

<div class="wp_codebox"><table><tr id="p5618"><td class="code" id="p56code18"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> ssh2-<span style="color: #000000;">0.10</span>
phpize <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> .<span style="color: #000000; font-weight: bold;">/</span>configure <span style="color: #660033;">--with-ssh2</span> <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #c20cb9; font-weight: bold;">make</span></pre></td></tr></table></div>

<p>maintenant que l'installation est terminée, on active l'extension, ici on va copier le fichier ssh2.so dans le répertoire des extension de php5 (il peut être différent du mien selon la distrib et l'installation) :</p>

<div class="wp_codebox"><table><tr id="p5619"><td class="code" id="p56code19"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">cp</span> modules<span style="color: #000000; font-weight: bold;">/</span>ssh2.so <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>php5<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">20060613</span>+lfs</pre></td></tr></table></div>

<p>puis on ajoute l'extension en créant un fichier ssh2.ini dans le répertoire conf.d (comme pour toutes les autres extensions de php) on n'oublie pas de le faire pour apache mais aussi pour le mode CLI.</p>

<div class="wp_codebox"><table><tr id="p5620"><td class="code" id="p56code20"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;extension=ssh2.so&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>php5<span style="color: #000000; font-weight: bold;">/</span>cli<span style="color: #000000; font-weight: bold;">/</span>conf.d<span style="color: #000000; font-weight: bold;">/</span>ssh2.ini
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;extension=ssh2.so&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>php5<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>conf.d<span style="color: #000000; font-weight: bold;">/</span>ssh2.ini
<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>apache2 restart</pre></td></tr></table></div>

<p>Et voilà, notre extension est installée, a vous ssh2 et sftp avec php :)</p>
]]></content:encoded>
			<wfw:commentRss>http://naeh.net/installer-libssh2-ssh2-pour-php/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>changer la locale sous debian</title>
		<link>http://naeh.net/changer-la-locale-sous-debian/</link>
		<comments>http://naeh.net/changer-la-locale-sous-debian/#comments</comments>
		<pubDate>Mon, 22 Sep 2008 21:35:17 +0000</pubDate>
		<dc:creator>Naeh</dc:creator>
				<category><![CDATA[Linux - OS]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[locale]]></category>
		<category><![CDATA[Serveur]]></category>

		<guid isPermaLink="false">http://naeh.net/changer-la-locale-sous-debian/</guid>
		<description><![CDATA[aller, une petite astuce que j'ai mis du temps a trouver, je voulais changer la locale de mon serveur pour passer de fr_FR.ISOXXXXX à fr_FR.UTF-8.
il faut s'assurer que le paquet locale est deja installé (par défaut sur une etch il me semble) et faire un coup de :

dpkg-reconfigure locales

et là on sélectionne la locale voulue [...]]]></description>
			<content:encoded><![CDATA[<p>aller, une petite astuce que j'ai mis du temps a trouver, je voulais changer la locale de mon serveur pour passer de fr_FR.ISOXXXXX à fr_FR.UTF-8.</p>
<p>il faut s'assurer que le paquet locale est deja installé (par défaut sur une etch il me semble) et faire un coup de :</p>

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

<p>et là on sélectionne la locale voulue en la mettant par défaut, se déconnecter, se reconnecter et le tour est joué :)</p>
]]></content:encoded>
			<wfw:commentRss>http://naeh.net/changer-la-locale-sous-debian/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Forcer le téléchargement d&#8217;un fichier avec PHP</title>
		<link>http://naeh.net/forcer-le-telechargement-dun-fichier-avec-php/</link>
		<comments>http://naeh.net/forcer-le-telechargement-dun-fichier-avec-php/#comments</comments>
		<pubDate>Tue, 18 Mar 2008 22:16:33 +0000</pubDate>
		<dc:creator>Naeh</dc:creator>
				<category><![CDATA[PHP / MySQL]]></category>
		<category><![CDATA[Programmation]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[header]]></category>
		<category><![CDATA[IE]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[Serveur]]></category>
		<category><![CDATA[telecharger]]></category>

		<guid isPermaLink="false">http://naeh.net/forcer-le-telechargement-dun-fichier-avec-php/</guid>
		<description><![CDATA[Dance cet article nous allons voir comment forcer le navigateur à télécharger un fichier (n'importe lequel) au lieux de l'ouvrir. Pour cela nous allons utiliser les Headers qu'envoie le serveur au navigateur (fonction header de php).
Voici le code a utiliser :

 //date actuelle
$date = gmdate&#40;'D, d M Y H:i:s'&#41;;
&#160;
header&#40;&#34;Content-Type: text/xml&#34;&#41;; //Ici par exemple c'est pour [...]]]></description>
			<content:encoded><![CDATA[<p>Dance cet article nous allons voir comment forcer le navigateur à télécharger un fichier (n'importe lequel) au lieux de l'ouvrir. Pour cela nous allons utiliser les <strong>Headers</strong> qu'envoie le serveur au navigateur (<a href="http://fr3.php.net/manual/fr/function.header.php" target="_blank">fonction header de php</a>).</p>
<p>Voici le code a utiliser :</p>

<div class="wp_codebox"><table><tr id="p5025"><td class="code" id="p50code25"><pre class="php" style="font-family:monospace;"> <span style="color: #666666; font-style: italic;">//date actuelle</span>
<span style="color: #000088;">$date</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/gmdate"><span style="color: #990000;">gmdate</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'D, d M Y H:i:s'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<a href="http://www.php.net/header"><span style="color: #990000;">header</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Content-Type: text/xml&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//Ici par exemple c'est pour un fichier XML, a changer en fonction du type mime du fichier voulu.</span>
<a href="http://www.php.net/header"><span style="color: #990000;">header</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Content-Disposition: attachment; filename=NOM_FICHIER.xml'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<a href="http://www.php.net/header"><span style="color: #990000;">header</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Last-Modified: '</span><span style="color: #339933;">.</span> <span style="color: #000088;">$date</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">' GMT'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<a href="http://www.php.net/header"><span style="color: #990000;">header</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Expires: '</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$date</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">//header specifique IE :s parce que sinon il aime pas</span>
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><a href="http://www.php.net/preg_match"><span style="color: #990000;">preg_match</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'/msie|(microsoft internet explorer)/i'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'HTTP_USER_AGENT'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
  <a href="http://www.php.net/header"><span style="color: #990000;">header</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Cache-Control: must-revalidate, post-check=0, pre-check=0'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <a href="http://www.php.net/header"><span style="color: #990000;">header</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Pragma: public'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #b1b100;">else</span><span style="color: #009900;">&#123;</span>
  <a href="http://www.php.net/header"><span style="color: #990000;">header</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Pragma: no-cache'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #b1b100;">echo</span> <span style="color: #000088;">$CONTENU_DE_NOTRE_FICHIER</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// ou readfile('CHEMIN_FICHIER'); En fonction du type de fichier.</span></pre></td></tr></table></div>

<p>Le type Mime doit être celui du fichier qu'on veut pouvoir télécharger (<a href="http://www.c-p-f.org/divers-Liste_des_types_MIME-a15.html" target="_blank">liste des types mime disponibles</a>). En voici quelques exemples :</p>

<div class="wp_codebox"><table><tr id="p5026"><td class="code" id="p50code26"><pre class="bash" style="font-family:monospace;">image GIF : image<span style="color: #000000; font-weight: bold;">/</span>gif
fichier XML : text<span style="color: #000000; font-weight: bold;">/</span>xml
fichier rtf : application<span style="color: #000000; font-weight: bold;">/</span>rtf
fichier avi : video<span style="color: #000000; font-weight: bold;">/</span>msvideo</pre></td></tr></table></div>

<p>Maintenant à vos fichiers dl.php ;-)</p>
]]></content:encoded>
			<wfw:commentRss>http://naeh.net/forcer-le-telechargement-dun-fichier-avec-php/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Extraire le contenu d&#8217;un zip directement sur son FTP chez free</title>
		<link>http://naeh.net/extraire-le-contenu-dun-zip-directement-sur-son-ftp-chez-free/</link>
		<comments>http://naeh.net/extraire-le-contenu-dun-zip-directement-sur-son-ftp-chez-free/#comments</comments>
		<pubDate>Sun, 16 Mar 2008 17:13:21 +0000</pubDate>
		<dc:creator>Naeh</dc:creator>
				<category><![CDATA[PHP / MySQL]]></category>
		<category><![CDATA[Programmation]]></category>
		<category><![CDATA[documentation]]></category>
		<category><![CDATA[extension]]></category>
		<category><![CDATA[extraire]]></category>
		<category><![CDATA[hébergement]]></category>
		<category><![CDATA[librairie]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[Serveur]]></category>
		<category><![CDATA[zip]]></category>

		<guid isPermaLink="false">http://naeh.net/extraire-le-contenu-dun-zip-directement-sur-son-ftp-chez-free/</guid>
		<description><![CDATA[Dans cette article nous allons voir comment procéder pour dézippé le contenu d'une archive directement sur son FTP free. Ceci peut être très intéressant si on a plusieurs (beaucoup) fichiers à envoyer sur le ftp, parfois ce genre d'upload peut s'avérer très difficile en fonction de la connexion, du logicile client FTP, mais aussi de [...]]]></description>
			<content:encoded><![CDATA[<p>Dans cette article nous allons voir comment procéder pour dézippé le contenu d'une archive directement sur son FTP free. Ceci peut être très intéressant si on a plusieurs (beaucoup) fichiers à envoyer sur le ftp, parfois ce genre d'upload peut s'avérer très difficile en fonction de la connexion, du logicile client FTP, mais aussi de l'humeur du serveur FTP de chez free. On peut se retrouver avec un certain nombre de fichiers qui ne seront pas envoyé (perdus en route ?!).</p>
<p>L'astuce consiste à mettre tous ses fichiers dans ZIP, uploader le zip sur le FTP et l'extraire sur place avec script PHP. Parce que envoyer UN SEUL fichier quelque soit sa taille, est toujours plus simple que d'en envoyer 36 000.</p>
<p>Pour commencer il faut savoir que Free ne propose aucune librairie PHP pour gérer les archives, donc nous utiliserons une classe de substitution, pour l'exemple, on va utiliser <a href="http://www.phpconcept.net/pclzip/index.php" target="_blank"><font color="#206033" face="Comic Sans MS">pclzip</font></a>.</p>
<p>Maintenant, il faut créer un fichier ZIP (test.zip pour l'exemple) dans lequel on mettra tous nos fichiers à uploader sur le FTP.</p>
<p>Ensuite, il faut créer un fichier php (extract.php pour l'exemple) dans lequel on mettra le code suivant (à adapter selon votre cas) :</p>

<div class="wp_codebox"><table><tr id="p4928"><td class="code" id="p49code28"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">//Extrait de la documentation de la class.</span>
<span style="color: #b1b100;">require_once</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'pclzip.lib.php'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$archive</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> PclZip<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'test.zip'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//METTRE LE VRAI NOM DU ZIP ;)</span>
<span style="color: #666666; font-style: italic;">//Extrait dans le repertoire courant.</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$archive</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">extract</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      <a href="http://www.php.net/die"><span style="color: #990000;">die</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Error : &quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$archive</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">errorInfo</span><span style="color: #009900;">&#40;</span><span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>maintenant on se retrouve avec 3 fichiers :</p>
<ol>
<li>extract.php</li>
<li> pclzip.lib.php</li>
<li>test.zip</li>
</ol>
<p>On peut maintenant envoyer nos 3 fichiers dans le répertoire sensé accueillir les fichiers finaux (contenus dans le zip) sur le FTP.</p>
<p>maintenant prendre son navigateur et aller à l'url http://adresse_du_site.free.fr/repertoire/extract.php</p>
<p>et le tour est joué :-)</p>
<p>N.B. Cette procédure et valable pour tout hébergement mutualisé (ou pas) ne proposant pas les extensions PHP Zlib ou équivalent.</p>
]]></content:encoded>
			<wfw:commentRss>http://naeh.net/extraire-le-contenu-dun-zip-directement-sur-son-ftp-chez-free/feed/</wfw:commentRss>
		<slash:comments>26</slash:comments>
		</item>
		<item>
		<title>Protéger un répertoire par htaccess</title>
		<link>http://naeh.net/proteger-un-repertoire-par-un-htaccess/</link>
		<comments>http://naeh.net/proteger-un-repertoire-par-un-htaccess/#comments</comments>
		<pubDate>Mon, 10 Mar 2008 23:18:34 +0000</pubDate>
		<dc:creator>Naeh</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programmation]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[htaccess]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[Serveur]]></category>
		<category><![CDATA[vhost]]></category>

		<guid isPermaLink="false">http://naeh.net/proteger-un-repertoire-par-un-htaccess/</guid>
		<description><![CDATA[Le but de cet article est montrer comment protéger un répertoire par un htaccess.
pour cela il faut d'abord créer un fichier .htaccess à la racine du répertoire, ce fichier doit contenir  les lignes suivantes (a adapter selon la configuration/ besoins) :

AuthName &#34;Page protégée&#34;
AuthType Basic
AuthUserFile &#34;/CHEMIN/VERS/LE/FICHIER/.htpasswd&#34;
Require valid-user

en suite il faut créer un fichier .htpasswd qui [...]]]></description>
			<content:encoded><![CDATA[<p>Le but de cet article est montrer comment protéger un répertoire par un <strong>htaccess</strong>.</p>
<p>pour cela il faut d'abord créer un fichier <em>.htaccess</em> à la racine du répertoire, ce fichier doit contenir  les lignes suivantes (a adapter selon la configuration/ besoins) :</p>

<div class="wp_codebox"><table><tr id="p4832"><td class="code" id="p48code32"><pre class="bash" style="font-family:monospace;">AuthName <span style="color: #ff0000;">&quot;Page protégée&quot;</span>
AuthType Basic
AuthUserFile <span style="color: #ff0000;">&quot;/CHEMIN/VERS/LE/FICHIER/.htpasswd&quot;</span>
Require valid-user</pre></td></tr></table></div>

<p>en suite il faut créer un fichier <em>.htpasswd</em> qui lui contiendra les couples login/mot de passe qui auront accès au répertoire protégé.<br />
pour cela exécutez la commande suivante :</p>

<div class="wp_codebox"><table><tr id="p4833"><td class="code" id="p48code33"><pre class="bash" style="font-family:monospace;">htpasswd <span style="color: #660033;">-c</span> <span style="color: #000000; font-weight: bold;">/</span>CHEMIN<span style="color: #000000; font-weight: bold;">/</span>VERS<span style="color: #000000; font-weight: bold;">/</span>LE<span style="color: #000000; font-weight: bold;">/</span>FICHIER<span style="color: #000000; font-weight: bold;">/</span>.htpasswd LOGIN</pre></td></tr></table></div>

<p>-c pour créer un nouveau fichier <em>.htpasswd</em> (a ne pas utiliser si vous ajouter un utilisateur à un fichier existant).<br />
il vous sera ensuite demandé d'entrer le mot de passe 2 fois, faites le, et le tour est joué.</p>
<p>pour plus de renseignement sur la commande <strong>htpasswd</strong>, voici l'écran d'aide de ladite commande :</p>

<div class="wp_codebox"><table><tr id="p4834"><td class="code" id="p48code34"><pre class="bash" style="font-family:monospace;">$ htpasswd
Usage:
        htpasswd <span style="color: #7a0874; font-weight: bold;">&#91;</span>-cmdpsD<span style="color: #7a0874; font-weight: bold;">&#93;</span> passwordfile username
        htpasswd -b<span style="color: #7a0874; font-weight: bold;">&#91;</span>cmdpsD<span style="color: #7a0874; font-weight: bold;">&#93;</span> passwordfile username password
        htpasswd -n<span style="color: #7a0874; font-weight: bold;">&#91;</span>mdps<span style="color: #7a0874; font-weight: bold;">&#93;</span> username
        htpasswd -nb<span style="color: #7a0874; font-weight: bold;">&#91;</span>mdps<span style="color: #7a0874; font-weight: bold;">&#93;</span> username password
&nbsp;
 <span style="color: #660033;">-c</span>  Create a new file.
 <span style="color: #660033;">-n</span>  Don<span style="color: #ff0000;">'t update file; display results on stdout.
 -m  Force MD5 encryption of the password.
 -d  Force CRYPT encryption of the password (default).
 -p  Do not encrypt the password (plaintext).
 -s  Force SHA encryption of the password.
 -b  Use the password from the command line rather than prompting for it.
 -D  Delete the specified user.
On Windows, NetWare and TPF systems the '</span><span style="color: #660033;">-m</span><span style="color: #ff0000;">' flag is used by default.
On all other systems, the '</span><span style="color: #660033;">-p</span><span style="color: #ff0000;">' flag will probably not work.</span></pre></td></tr></table></div>

<p>notez aussi que pour que cette protection fonctionne, il est obligatoire de ne pas avoir la directive apache <strong>AllowOverride</strong> a none, sinon le fichier <em>.htaccess</em> ne sera pas pris en compte, donc n'oubliez pas de la commenter ou l'enlever tout simplement si vous l'avez dans votre <strong>vhost</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://naeh.net/proteger-un-repertoire-par-un-htaccess/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installer PHPDoc et générer une documentation</title>
		<link>http://naeh.net/installation-phpdoc/</link>
		<comments>http://naeh.net/installation-phpdoc/#comments</comments>
		<pubDate>Tue, 04 Mar 2008 14:33:16 +0000</pubDate>
		<dc:creator>Naeh</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Linux - Logiciels]]></category>
		<category><![CDATA[PHP / MySQL]]></category>
		<category><![CDATA[Programmation]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[documentation]]></category>
		<category><![CDATA[pear]]></category>
		<category><![CDATA[php5]]></category>
		<category><![CDATA[phpdoc]]></category>
		<category><![CDATA[Serveur]]></category>

		<guid isPermaLink="false">http://naeh.net/installation-phpdoc/</guid>
		<description><![CDATA[Dans cet article nous allons voir comment à partir d'un code source bien commenté, générer une documentation comme on aimerait avoir pour tout projet ou application digne de son nom.
Pour cela nous allons utiliser PHPDocumentor. qui va nous permetre de générer une documentation à paritr des sources de notre projet.
Il faut d'abord l'installer avec la [...]]]></description>
			<content:encoded><![CDATA[<p>Dans cet article nous allons voir comment à partir d'un code source bien commenté, générer une documentation comme on aimerait avoir pour tout projet ou application digne de son nom.</p>
<p>Pour cela nous allons utiliser <a href="http://www.phpdoc.org/" target="_blank">PHPDocumentor</a>. qui va nous permetre de générer une documentation à paritr des sources de notre projet.</p>
<h2>Il faut d'abord l'installer avec la commande suivante :</h2>

<div class="wp_codebox"><table><tr id="p4738"><td class="code" id="p47code38"><pre class="bash" style="font-family:monospace;">pear <span style="color: #c20cb9; font-weight: bold;">install</span> phpdocumentor</pre></td></tr></table></div>

<p>(si pear n'est pas installé faites un <strong>apt-get install php-pear</strong><em>)</em></p>
<p><em>Si vous rencontrez un problème de dépassement  de mémoire alouée avec PHP, allez dans /etc/php5/cli/php.ini et augmenter cette limite (il s'agit du paramètre memory_limit).</em></p>
<h2>création d'un fichier de configuration pour le projet :</h2>
<p>pour générer la documentation d'un projet nous avons besoin d'un fichier de configuration par projet, en voici un exemple :<br />
fichier nom_du_projet.conf :</p>

<div class="wp_codebox"><table><tr id="p4739"><td class="code" id="p47code39"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>Parse Data<span style="color: #7a0874; font-weight: bold;">&#93;</span>
title = Titre de la documentation
hidden = <span style="color: #c20cb9; font-weight: bold;">false</span>
parseprivate = off
javadocdesc = off
defaultcategoryname = Documentation
defaultpackagename = Projet
target = <span style="color: #000000; font-weight: bold;">/</span>PATH<span style="color: #000000; font-weight: bold;">/</span>OU<span style="color: #000000; font-weight: bold;">/</span>SERA<span style="color: #000000; font-weight: bold;">/</span>ENREGISTRE<span style="color: #000000; font-weight: bold;">/</span>LA<span style="color: #000000; font-weight: bold;">/</span>DOCUMENTATION
readmeinstallchangelog = README, INSTALL, FAQ, LICENSE
directory =   <span style="color: #000000; font-weight: bold;">/</span>PATH<span style="color: #000000; font-weight: bold;">/</span>VERS<span style="color: #000000; font-weight: bold;">/</span>LE<span style="color: #000000; font-weight: bold;">/</span>PROJET
ignore = templates<span style="color: #000000; font-weight: bold;">/</span>,<span style="color: #7a0874; font-weight: bold;">test</span><span style="color: #000000; font-weight: bold;">*</span>.php
sourcecode = on
<span style="color: #007800;">output</span>=HTML:frames:earthli</pre></td></tr></table></div>

<p>et pour tester exécutez la commande suivante (après avoir créé le répertoire cible de la documentation)</p>

<div class="wp_codebox"><table><tr id="p4740"><td class="code" id="p47code40"><pre class="bash" style="font-family:monospace;">phpdoc <span style="color: #660033;">-c</span> nom_du_projet.conf</pre></td></tr></table></div>

<p>et voilà, la génération prend un peu de temps, en fonction de la machine et de la taille du projet.</p>
]]></content:encoded>
			<wfw:commentRss>http://naeh.net/installation-phpdoc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>La bourse de New York adopte le pingouin</title>
		<link>http://naeh.net/la-bourse-de-new-york-adopte-le-pingouin/</link>
		<comments>http://naeh.net/la-bourse-de-new-york-adopte-le-pingouin/#comments</comments>
		<pubDate>Fri, 14 Dec 2007 22:46:58 +0000</pubDate>
		<dc:creator>Naeh</dc:creator>
				<category><![CDATA[Divers]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[bourse]]></category>
		<category><![CDATA[HP]]></category>
		<category><![CDATA[new york]]></category>
		<category><![CDATA[Ordinateur]]></category>
		<category><![CDATA[pingouin]]></category>
		<category><![CDATA[Serveur]]></category>

		<guid isPermaLink="false">http://naeh.net/index.php/la-bourse-de-new-york-adopte-le-pingouin/</guid>
		<description><![CDATA[La bourse de New York avait commencé l'année dernière un plan d'expansion, qui se poursuit, mais cette fois, par une bonne surprise, en effet, ce sont pas loin de 600 machines HP avec (400 quadri processeurs) qui se veront installé un pingouin aux commandes, c'est aussi le cas de nombreux serveurs.
Un choix étonnant de la [...]]]></description>
			<content:encoded><![CDATA[<p>La bourse de New York avait commencé l'année dernière un plan d'expansion, qui se poursuit, mais cette fois, par une bonne surprise, en effet, ce sont pas loin de 600 machines HP avec (400 quadri processeurs) qui se veront installé un pingouin aux commandes, c'est aussi le cas de nombreux serveurs.</p>
<p>Un choix étonnant de la part de la Bourse, qui a depuis toujours  fonctionné sous Unix, mais les responsables disent ne pas vouloir être dépendant d'un Unix propriétaire, d'où le choix du libre. Sans oublier l'économie réalisée en faisant ce choix. étonnant également que la bourse n'ait pas retenu le Système d'exploitation d'HP avec tout ce matériel HP.</p>
]]></content:encoded>
			<wfw:commentRss>http://naeh.net/la-bourse-de-new-york-adopte-le-pingouin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hyper-V en test plus tôt que prévu</title>
		<link>http://naeh.net/hyper-v-en-test-plutot-que-prevu/</link>
		<comments>http://naeh.net/hyper-v-en-test-plutot-que-prevu/#comments</comments>
		<pubDate>Fri, 14 Dec 2007 22:05:16 +0000</pubDate>
		<dc:creator>Naeh</dc:creator>
				<category><![CDATA[Windows - Logiciels]]></category>
		<category><![CDATA[Emulation]]></category>
		<category><![CDATA[Hyper-V]]></category>
		<category><![CDATA[logiciel]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Serveur]]></category>
		<category><![CDATA[VMware]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://naeh.net/index.php/hyper-v-en-test-plutot-que-prevu/</guid>
		<description><![CDATA[Le nouveau né de chez Microsoft est ouvert aux tests publics plutôt que prévu, en effet, la firme vient d'annoncer la nouvelle, plutôt encourageante quand on sait que la sortie était prévue pour le premier trimestre 2008.
Pour ceux qui ne le savent pas, Hyper-V est un logiciel de virtualisation, le plus connu dans ce domaine [...]]]></description>
			<content:encoded><![CDATA[<p>Le nouveau né de chez Microsoft est ouvert aux tests publics plutôt que prévu, en effet, la firme vient d'annoncer la nouvelle, plutôt encourageante quand on sait que la sortie était prévue pour le premier trimestre 2008.</p>
<p>Pour ceux qui ne le savent pas, Hyper-V est un logiciel de virtualisation, le plus connu dans ce domaine c'est VMware qui devrait se faire du soucis d'ailleurs, mais bon connaissant Miscrosoft, ils ne devraient pas trop quand même :-)</p>
<p>Cependant certaines sources affirment que le nouveau né de chez Miscrosoft serait 3 fois plus rapide que VMware, mais comme ne le savons tous, la vitesse ne fait pas tout, surtout s'il s'agit de faire cohabiter plusieurs serveurs virtuels entre eux.</p>
<p>Et pour finir un peut clin d'œil à l'environnement, car ne l'oublions pas, chaque serveur virtuel (émulé) évite l'utilisation d'un vrai serveur (machine) donc un ordinateur en moins, donc de l'énergie économisée.</p>
]]></content:encoded>
			<wfw:commentRss>http://naeh.net/hyper-v-en-test-plutot-que-prevu/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Mettre son serveur à l&#8217;heure</title>
		<link>http://naeh.net/mettre-son-serveur-a-lheure/</link>
		<comments>http://naeh.net/mettre-son-serveur-a-lheure/#comments</comments>
		<pubDate>Sun, 14 Jan 2007 21:43:41 +0000</pubDate>
		<dc:creator>Naeh</dc:creator>
				<category><![CDATA[Linux - OS]]></category>
		<category><![CDATA[heure]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[ntp]]></category>
		<category><![CDATA[Serveur]]></category>

		<guid isPermaLink="false">http://wp.naeh.info/?p=10</guid>
		<description><![CDATA[Pour mettre son serveur à l'heure, il y a différentes méthodes, l'une d'entre elles consiste à installer un programme et lui renseigner un serveur de temps, comme ça, il sera toujours à l'heure.
voici une liste de serveur ntp Français : http://www.cru.fr/NTP/serveurs_francais.html
tout d'abords il faut installer le programme, on peut prendre ntp-simple par exemple. L'installation diffère [...]]]></description>
			<content:encoded><![CDATA[<p>Pour mettre son serveur à l'heure, il y a différentes méthodes, l'une d'entre elles consiste à installer un programme et lui renseigner un serveur de temps, comme ça, il sera toujours à l'heure.</p>
<p>voici une liste de serveur ntp Français : <a href="http://www.cru.fr/NTP/serveurs_francais.html" target="_blank">http://www.cru.fr/NTP/serveurs_francais.html</a></p>
<p>tout d'abords il faut installer le programme, on peut prendre <strong>ntp-simple</strong> par exemple. <em>L'installation diffère selon la distribution</em><br />
Sous Debian par exemple :</p>
<pre>apt-get install ntp-simple</pre>
<p>ensuite il faut trouver le fichier de configuration du programme (<em>/etc/ntp.conf</em>) et ajouter un serveur de votre choix (possibilité d'en mettre plusieurs) :</p>
<pre>server UN SERVEUR NTP</pre>
<p>et voilà, votre serveur est désormais à l'heure.</p>
<p>Pour les commentaires c'est par ici : <a href="http://naeh.net/forum/index.php?topic=17.0" target="_blank">http://naeh.net/forum/index.php?topic=17.0</a></p>
]]></content:encoded>
			<wfw:commentRss>http://naeh.net/mettre-son-serveur-a-lheure/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sécuriser une Debian</title>
		<link>http://naeh.net/securiser-une-debian/</link>
		<comments>http://naeh.net/securiser-une-debian/#comments</comments>
		<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate>
		<dc:creator>Naeh</dc:creator>
				<category><![CDATA[Linux - OS]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[sécurité]]></category>
		<category><![CDATA[Serveur]]></category>

		<guid isPermaLink="false">http://wp.naeh.info/?p=11</guid>
		<description><![CDATA[Ici nous allons voir comment sécuriser un serveur tournant sous Debian :
Toutes ses commandes sont a exécuter en tant que root
Se protéger contre les Smurf Attack:
# echo "1" &#62; /proc/sys/net/ipv4/icmp_echo_ignore_broadcasts
Eviter le source routing:
# echo "0" &#62; /proc/sys/net/ipv4/conf/all/accept_source_route
Se protéger des attaques de type Syn Flood:
# echo "1" &#62; /proc/sys/net/ipv4/tcp_syncookies

# echo "1024" &#62; /proc/sys/net/ipv4/tcp_max_syn_backlog

# echo "1" &#62; [...]]]></description>
			<content:encoded><![CDATA[<p>Ici nous allons voir comment sécuriser un serveur tournant sous Debian :<br />
Toutes ses commandes sont a exécuter en tant que <em>root</em></p>
<p>Se protéger contre les Smurf Attack:</p>
<pre># echo "1" &gt; /proc/sys/net/ipv4/icmp_echo_ignore_broadcasts</pre>
<p>Eviter le source routing:</p>
<pre># echo "0" &gt; /proc/sys/net/ipv4/conf/all/accept_source_route</pre>
<p>Se protéger des attaques de type Syn Flood:</p>
<pre># echo "1" &gt; /proc/sys/net/ipv4/tcp_syncookies

# echo "1024" &gt; /proc/sys/net/ipv4/tcp_max_syn_backlog

# echo "1" &gt; /proc/sys/net/ipv4/conf/all/rp_filter</pre>
<p>Désactivez l'autorisation des redirections ICMP:</p>
<pre># echo "0" &gt; /proc/sys/net/ipv4/conf/all/accept_redirects

# echo "0" &gt; /proc/sys/net/ipv4/conf/all/secure_redirects</pre>
<p>Eviter le log des paquets icmp erroné:</p>
<pre># echo "1" &gt; /proc/sys/net/ipv4/icmp_ignore_bogus_error_responses</pre>
<p>Active le logging des packets aux adresses sources falficiées ou non routables:</p>
<pre># echo "1" &gt; /proc/sys/net/ipv4/conf/all/log_martians</pre>
<p>Source : <a href="http://www.dedibox-news.com/doku.php?id=distrib:debian:securiser_sa_debian" target="_blank">http://www.dedibox-news.com/doku.php?id=distrib:debian:securiser_sa_debian</a></p>
<p>Pour en discuter c'est par ici : <a href="http://naeh.net/forum/index.php?topic=14.0" target="_blank">http://naeh.net/forum/index.php?topic=14.0</a></p>
]]></content:encoded>
			<wfw:commentRss>http://naeh.net/securiser-une-debian/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
