<?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>Phollow.me &#187; serveur</title>
	<atom:link href="http://phollow.fr/category/linux/serveur/feed/" rel="self" type="application/rss+xml" />
	<link>http://phollow.fr</link>
	<description>Un blog sur les nouvelles technologies, des tutoriaux, des comparaisons que ca soit sur le web, la programmation ou linux.</description>
	<lastBuildDate>Sun, 05 Feb 2012 10:26:15 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Serveur web léger Lighttpd et FreeBSD</title>
		<link>http://phollow.fr/2010/06/serveur-web-leger-lighttpd-et-freebsd/</link>
		<comments>http://phollow.fr/2010/06/serveur-web-leger-lighttpd-et-freebsd/#comments</comments>
		<pubDate>Thu, 10 Jun 2010 22:16:31 +0000</pubDate>
		<dc:creator>Jérôme M.</dc:creator>
				<category><![CDATA[serveur]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[freeBSD]]></category>
		<category><![CDATA[lighttpd]]></category>

		<guid isPermaLink="false">http://phollow.fr/?p=2351</guid>
		<description><![CDATA[Dans cet article je vais vous parler de la configuration actuelle de ce serveur, celui qui permet d'afficher ces pages. J'en avais un peu parlé dans un billet précédent, ce serveur tourne sous FreeBSD 8.0. Pourquoi FreeBSD ? Parce qu'avant tout je voulais apprendre un système que je connaissais pas du tout, et l'arbre des [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">Dans cet article je vais vous parler de la configuration actuelle de ce serveur, celui qui permet d'afficher ces pages. J'en avais un peu parlé dans un billet précédent, ce serveur tourne sous FreeBSD 8.0. Pourquoi FreeBSD ? Parce qu'avant tout je voulais apprendre un système que je connaissais pas du tout, et l'arbre des ports permet de compiler mes logiciels facilement, tout en ayant une liberté maximale sur les options de compîlation.</p>
<p style="text-align: justify;">Je vais traité ici l'installation d'un serveur PHP (en l'occurence lighty). Il y a en gros deux parties distinctes : premièrement l'installation de PHP à proprement parlé, puis ensuite du serveur et sa configuration. Je ne parlerai pas de l'installation d'un serveur de base de données, sauf si ça vous branche :)</p>
<p style="text-align: justify;">Personnellement je n'installe mes logiciels que par compilation (ce n'est pas obligatoire sous FreeBSD). J'utilise pour cela des utilitaires tels que <strong>portmaster</strong> et <strong>portsnap</strong>. Si vous n'avez jamais utilisé les ports sur FreeBSD vous devez commencer par un petit :</p>

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

<p style="text-align: justify;">Cette commande va tout simplement télécharger les ports et les extraire dans /usr/ports. À faire une fois seulement, après ce n'est plus nécessaire.</p>
<h1>PHP 5.3</h1>
<p style="text-align: justify;">On commence par mettre nos ports à jour :</p>

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

<p style="text-align: justify;">Et ensuite c'est partie pour compiler le coeur de PHP :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">portmaster lang<span style="color: #000000; font-weight: bold;">/</span>php5</pre></div></div>

<p style="text-align: justify;">On vous proposera surement des choix pour la configuration de PHP, sélectionnez seulement ce qui vous est nécessaire. Le but de la compilation étant de pouvoir optimiser :)</p>
<p style="text-align: justify;">Ensuite on va pouvoir construire les extensions de PHP. Comme par exemple curl ou gd pour les images. Idem, il y a forcément des extensions que vous n'utiliserai pas, donc ne cochez pas tout comme des bourrins (lol). Pensez à sélectionner celle de votre base de données (mysql, mysqli, postgre...)</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">portmaster lang<span style="color: #000000; font-weight: bold;">/</span>php5-extensions</pre></div></div>

<p>Et hop c'est terminé. Vous pouvez vérifier que PHP est bien installé, en lançant un petit <em>php --version</em> dans le shell.</p>
<h1>Lighttpd</h1>
<p style="text-align: justify;">Lighttpd ou Lighty est un serveur web très léger et assez flexible. Optimisé pour être soumis à de fortes demandes, il est de nature plus scalable qu'Apache. Il en a d'ailleurs rien à envier, et il est capable de pas mal de choses (FastCGI, CGI, Http Auth, Compression, Url rewriting...).</p>
<p style="text-align: justify;">Donc installons le :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">portmaster www<span style="color: #000000; font-weight: bold;">/</span>lighttpd</pre></div></div>

<p style="text-align: justify;">Maintenant on va dire à FreeBSD de le démarrer après le boot, pour cela on édite donc /etc/rc.conf : en ajoutant cette ligne :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #007800;">lighttpd_enable</span>=<span style="color: #ff0000;">&quot;YES&quot;</span></pre></div></div>

<p style="text-align: justify;">Et pour le démarrer/redémarrer/stoper :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>rc.d<span style="color: #000000; font-weight: bold;">/</span>lighttpd start<span style="color: #000000; font-weight: bold;">|</span>restart<span style="color: #000000; font-weight: bold;">|</span>stop</pre></div></div>

<h3>Fichiers de configurations de Lighttpd:</h3>
<ul>
<li>Par défaut le webroot se trouve dans <strong>/usr/local/www/data</strong></li>
<li>L'utilisateur par défaut du serveur est <strong>www</strong></li>
<li>Et la configuration se fait dans ce fichier : <strong>/usr/local/etc/lighttpd.conf</strong></li>
</ul>
<p style="text-align: justify;">Nous allons configurer un virtual host, avec un nom de domaine et son propre répertoire dans le webroot. Nous allons aussi compresser les pages pour économiser de la bande passante et activer l'url rewriting pour faire fonctionner wordpress. Ouvrez le fichier de configuration. Nous allons modifier certaines lignes pour notre configuration.</p>
<p style="text-align: justify;">Commençons par les modules à charger, pour ma part j'ai besoin de :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">server.modules              = <span style="color: #7a0874; font-weight: bold;">&#40;</span>
                               <span style="color: #ff0000;">&quot;mod_rewrite&quot;</span>,
                               <span style="color: #ff0000;">&quot;mod_redirect&quot;</span>,
                               <span style="color: #ff0000;">&quot;mod_alias&quot;</span>,
                               <span style="color: #ff0000;">&quot;mod_access&quot;</span>,
                               <span style="color: #ff0000;">&quot;mod_auth&quot;</span>,
                               <span style="color: #ff0000;">&quot;mod_fastcgi&quot;</span>,
                               <span style="color: #ff0000;">&quot;mod_simple_vhost&quot;</span>,
                               <span style="color: #ff0000;">&quot;mod_compress&quot;</span>,
                               <span style="color: #ff0000;">&quot;mod_expire&quot;</span>,
                               <span style="color: #ff0000;">&quot;mod_accesslog&quot;</span>,
			       <span style="color: #ff0000;">&quot;mod_magnet&quot;</span>
<span style="color: #7a0874; font-weight: bold;">&#41;</span></pre></div></div>

<p style="text-align: justify;">On vérifie le webroot :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">server.document-root        = <span style="color: #ff0000;">&quot;/usr/local/www/data/&quot;</span></pre></div></div>

<p style="text-align: justify;">On active la compression :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">compress.cache-dir         = <span style="color: #ff0000;">&quot;/var/cache/lighttpd/compress/&quot;</span>
compress.filetype          = <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #ff0000;">&quot;text/plain&quot;</span>, <span style="color: #ff0000;">&quot;text/html&quot;</span>, <span style="color: #ff0000;">&quot;text/css&quot;</span>, <span style="color: #ff0000;">&quot;text/xml&quot;</span>, <span style="color: #ff0000;">&quot;text/javascript&quot;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span></pre></div></div>

<p style="text-align: justify;">www doit pouvoir écrire et lire dans ce répertoire bien sur.</p>
<p style="text-align: justify;">Maintenant il faut dire à Lighty comment on veut qu'il gère les scripts PHP. Donc nous allons utiliser du FastCGI :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">fastcgi.server             = <span style="color: #7a0874; font-weight: bold;">&#40;</span> <span style="color: #ff0000;">&quot;.php&quot;</span> =<span style="color: #000000; font-weight: bold;">&gt;</span>
                               <span style="color: #7a0874; font-weight: bold;">&#40;</span> <span style="color: #ff0000;">&quot;localhost&quot;</span> =<span style="color: #000000; font-weight: bold;">&gt;</span>
                                 <span style="color: #7a0874; font-weight: bold;">&#40;</span>
                                   <span style="color: #ff0000;">&quot;socket&quot;</span> =<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #ff0000;">&quot;/tmp/php-fastcgi.socket&quot;</span>,
                                   <span style="color: #ff0000;">&quot;bin-path&quot;</span> =<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #ff0000;">&quot;/usr/local/bin/php-cgi&quot;</span>,
				                           <span style="color: #ff0000;">&quot;max-procs&quot;</span> =<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000;">6</span>,
				                           <span style="color: #ff0000;">&quot;bin-environment&quot;</span> =<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>
				   	                         <span style="color: #ff0000;">&quot;PHP_FCGI_CHILDREN&quot;</span> =<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #ff0000;">&quot;5&quot;</span>,
				   	                         <span style="color: #ff0000;">&quot;PHP_FCGI_MAX_REQUESTS&quot;</span> =<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #ff0000;">&quot;1000&quot;</span>
			                               <span style="color: #7a0874; font-weight: bold;">&#41;</span>,
				                             <span style="color: #ff0000;">&quot;bin-copy-environment&quot;</span> =<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>
					                             <span style="color: #ff0000;">&quot;PATH&quot;</span>, <span style="color: #ff0000;">&quot;SHELL&quot;</span>, <span style="color: #ff0000;">&quot;USER&quot;</span>
 				                               <span style="color: #7a0874; font-weight: bold;">&#41;</span>,
				                           <span style="color: #ff0000;">&quot;broken-scriptfilename&quot;</span> =<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #ff0000;">&quot;enable&quot;</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></pre></div></div>

<p style="text-align: justify;">Et pour finir le virtual host :</p>

<div class="wp_syntax"><div class="code"><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;host&quot;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> == <span style="color: #ff0000;">&quot;phollow.fr&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
  server.document-root = <span style="color: #ff0000;">&quot;/usr/local/www/data/phollow.fr&quot;</span>
  compress.cache-dir = <span style="color: #ff0000;">&quot;/tmp/phollow.fr/&quot;</span>
  url.rewrite = <span style="color: #7a0874; font-weight: bold;">&#40;</span>
        <span style="color: #ff0000;">&quot;^/(wp-.+).*/?&quot;</span> =<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #ff0000;">&quot;$0&quot;</span>,
        <span style="color: #ff0000;">&quot;^/(sitemap.xml)&quot;</span> =<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #ff0000;">&quot;$0&quot;</span>,
        <span style="color: #ff0000;">&quot;^/(xmlrpc.php)&quot;</span> =<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #ff0000;">&quot;$0&quot;</span>,
        <span style="color: #ff0000;">&quot;^/(.+)/?$&quot;</span> =<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #ff0000;">&quot;/index.php/$1&quot;</span>
  <span style="color: #7a0874; font-weight: bold;">&#41;</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">&#125;</span></pre></div></div>

<p style="text-align: justify;">Et voilà ça devrait suffire à faire tourner votre site web. Si vous avez des questions n'hésitez pas et surtout allez faire un tour sur la documentation officielle de <a href="http://redmine.lighttpd.net/wiki/1">lighttpd</a>.</p>
<div id="crp_related"><h3>Articles similaires</h3><ul><li><a href="http://phollow.fr/2009/07/serveur-debian-lenny-apache-mysql-php/" rel="bookmark" class="crp_title">Serveur Debian Lenny - Apache, MySQL &amp; PHP</a><span class="crp_excerpt"> Je commence une toute nouvelle série de billets, sur l'installation ...</span></li><li><a href="http://phollow.fr/2009/08/serveur-debian-lenny-les-dns/" rel="bookmark" class="crp_title">Serveur Debian Lenny - Les DNS</a><span class="crp_excerpt"> Ce guide a pour but de vous montrer comment configurer ...</span></li><li><a href="http://phollow.fr/2010/02/quand-le-serveur-fait-boom-la-suite/" rel="bookmark" class="crp_title">Quand le serveur fait boom, la suite</a><span class="crp_excerpt"> Et oui encore des déboires avec mon petit RPS. Bon ...</span></li><li><a href="http://phollow.fr/2009/11/je-plonge-dans-freebsd/" rel="bookmark" class="crp_title">Je plonge dans FreeBSD</a><span class="crp_excerpt"> Je ne sais pas trop ce qui m'a poussé à ...</span></li><li><a href="http://phollow.fr/2010/02/dwm/" rel="bookmark" class="crp_title">Dwm</a><span class="crp_excerpt"> Dwm est le Dynamic Window Manager pour X. Il s'occupe ...</span></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://phollow.fr/2010/06/serveur-web-leger-lighttpd-et-freebsd/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Je plonge dans FreeBSD</title>
		<link>http://phollow.fr/2009/11/je-plonge-dans-freebsd/</link>
		<comments>http://phollow.fr/2009/11/je-plonge-dans-freebsd/#comments</comments>
		<pubDate>Sun, 29 Nov 2009 00:31:24 +0000</pubDate>
		<dc:creator>Jérôme M.</dc:creator>
				<category><![CDATA[libre]]></category>
		<category><![CDATA[serveur]]></category>
		<category><![CDATA[freeBSD]]></category>

		<guid isPermaLink="false">http://phollow.fr/?p=1778</guid>
		<description><![CDATA[Je ne sais pas trop ce qui m'a poussé à tester FreeBSD. Surement un mélange d'ennui, de curiosité et une envie de changement. FreeBSD est un autre OS libre, qui est, je trouve, encore assez méconnu. Pourtant les qualités ne manquent pas. FreeBSD et ses cousins (openBSD, netBSD ...) sont des alternatives intéressantes à GNU/Linux. [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">Je ne sais pas trop ce qui m'a poussé à tester FreeBSD. Surement un mélange d'ennui, de curiosité et une envie de changement. FreeBSD est un autre OS libre, qui est, je trouve, encore assez méconnu. Pourtant les qualités ne manquent pas. FreeBSD et ses cousins (openBSD, netBSD ...) sont des alternatives intéressantes à GNU/Linux.</p>
<p style="text-align: justify;">FreeBSD est un système d'exploitation basé sur <em>Berkeley Software Distribution </em>qui est une modification de l'UNIX propriétaire d'AT&amp;T. Le kernel, les drivers, et tous les outils sont développé par FreeBSD. Alors que sous GNU/Linux tous ces composants sont développés séparément et rassemblés sous la forme de distributions.</p>
<p style="text-align: justify;">GNU/Linux a été crée à partir de zéro pour ressembler à un système UNIX. FreeBSD est quant à lui l'évolution d'un système UNIX existant.</p>
<p style="text-align: justify;"><a href="http://phollow.fr/wp-content/uploads/2009/11/sexy-bsd1.jpg"><img class="aligncenter size-medium wp-image-1855" title="sexy-bsd" src="http://phollow.fr/wp-content/uploads/2009/11/sexy-bsd1-595x476.jpg" alt="sexy-bsd" width="595" height="476" /></a></p>
<h1>Différences et similarités</h1>
<h4>Kernel</h4>
<p style="text-align: justify;">Les deux kernels possèdent des similarités : On peut par exemple charger un nouveau module dans le noyau sans avoir besoin de redémarrer ou de le recompiler. Sur linux on peut charger un module avec la commande <em>modprobe</em>. Voir la liste des modules chargés en mémoire avec <em>lsmod</em> et en déchargé un avec <em>rmmod</em>. Sur FreeBSD ces commandes sont remplacées par <em>kldload</em>, <em>kldstat</em> et <em>kldunload</em>.</p>
<p style="text-align: justify;">Il est facile comme sous Linux de recompiler son propre kernel pour l'optimiser etc.</p>
<h4>Installation de logiciels</h4>
<p style="text-align: justify;">Les logiciels tiers sont installés soit avec des binaires ou alors à partir des sources. Sous GNU/Linux les distributions possèdent leurs propres système de paquets pré-compilés le plus souvent (ou pas cf. Gentoo). Par exemple Debian utilise des paquets .<em>deb</em> et des outils comme <em>apt</em> ou <em>dpkg</em> pour ordonner tout ça et gérer les dépendances.</p>
<p style="text-align: justify;">FreeBSD offre deux perspectives pour l'installation de logiciels :</p>
<p style="text-align: justify;"><em><strong>Paquets</strong></em></p>
<p style="text-align: justify;">Ce sont des archives contenant le logiciel pré-compilé, à la manière d'un .deb ou .rpm. On utilise les outils <strong>pkg_add</strong>, <strong>pkg_delete</strong> et <strong>pkg_info</strong> pour travailler avec. Par exemple pour installer Gimp il suffit d'un :</p>

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

<p><strong><em>Ports</em></strong></p>
<p style="text-align: justify;">Un port est un ensemble de fichier qui automatise la compilation et l'installation d'un logiciel. Cette méthode d'installation est intéressante pour avoir un contrôle complet de la configuration et de l'installation d'un logiciel. Par exemple on peut compiler Apache seulement avec les modules que l'ont choisit.</p>
<p style="text-align: justify;">Arch Linux a adopté la même philosophie avec des binaires (pacman) et des PKGBUILD.</p>
<p style="text-align: justify;">Les ports sont tous le temps à jour.</p>
<h4>Shell</h4>
<p style="text-align: justify;">Le shell par défaut sous GNU/Linux est bash. Sous FreeBSD c'est csh. Mais il est possible d'installer bash, ou même zsh qui est beaucoup mieux :)</p>
<h4>Configuration</h4>
<p style="text-align: justify;">FreeBSD possède un fichier de configuration global rc.conf ou l'ont choisit les démons qui seront lancés au démarrage, les modules à charger etc. On a pas à chercher dans 36 fichiers différents. Arch Linux a aussi adopté l'utilisation du rc.conf.</p>
<h4>Conclusion</h4>
<p style="text-align: justify;">J'utilise freeBSD sur un serveur dédié sur lequel je vais migrer le blog dans peu de temps. Je suis vraiment impressionné par la simplicité d'utilisation. Recompiler son kernel en ajoutant deux lignes dans un fichier de .conf et une commande c'est le bonheur. La documentation est tout simplement énorme. Je vais aussi l'installer sur mon netbook et jouer un peu en mode graphique avec lui.</p>
<p style="text-align: justify;">Je conseille à tous les curieux de l'essayer, en plus la version 8.0-RELEASE vient de sortir. Plus d'infos sur <a href="http://www.freebsd.org/">le site officiel</a>.</p>
<div id="crp_related"><h3>Articles similaires</h3><ul><li><a href="http://phollow.fr/2010/06/serveur-web-leger-lighttpd-et-freebsd/" rel="bookmark" class="crp_title">Serveur web léger Lighttpd et FreeBSD</a><span class="crp_excerpt"> Dans cet article je vais vous parler de la configuration ...</span></li><li><a href="http://phollow.fr/2010/02/quand-le-serveur-fait-boom-la-suite/" rel="bookmark" class="crp_title">Quand le serveur fait boom, la suite</a><span class="crp_excerpt"> Et oui encore des déboires avec mon petit RPS. Bon ...</span></li><li><a href="http://phollow.fr/2009/08/les-macports/" rel="bookmark" class="crp_title">Les macports</a><span class="crp_excerpt"> Les macports sont aux Macs ce que AUR est à ...</span></li><li><a href="http://phollow.fr/2010/02/le-wrapper-pacman-et-aur-parfait-sur-arch-linux/" rel="bookmark" class="crp_title">Le wrapper pacman et AUR parfait sur Arch Linux</a><span class="crp_excerpt"> Arch Linux possède en gros deux sortes de dépôts pour ...</span></li><li><a href="http://phollow.fr/2010/02/dwm/" rel="bookmark" class="crp_title">Dwm</a><span class="crp_excerpt"> Dwm est le Dynamic Window Manager pour X. Il s'occupe ...</span></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://phollow.fr/2009/11/je-plonge-dans-freebsd/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Serveur Debian Lenny - Les DNS</title>
		<link>http://phollow.fr/2009/08/serveur-debian-lenny-les-dns/</link>
		<comments>http://phollow.fr/2009/08/serveur-debian-lenny-les-dns/#comments</comments>
		<pubDate>Sun, 30 Aug 2009 12:04:01 +0000</pubDate>
		<dc:creator>Jérôme M.</dc:creator>
				<category><![CDATA[featured articles]]></category>
		<category><![CDATA[serveur]]></category>
		<category><![CDATA[tutoriel]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[dns]]></category>
		<category><![CDATA[lenny]]></category>

		<guid isPermaLink="false">http://phollow.fr/?p=1408</guid>
		<description><![CDATA[Ce guide a pour but de vous montrer comment configurer vos noms de domaines sur votre dédié. On utilisera donc Bind 9 sur une Debian Lenny. Vous avez, bien sur, besoin d'un nom de domaine. Vous pouvez en enregistrer un sur Gandi par exemple. On commence par installer bind9 et les outils nécessaires : apt-get [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">Ce guide a pour but de vous montrer comment configurer vos noms de domaines sur votre dédié. On utilisera donc <strong>Bind</strong> <strong>9</strong> sur une <strong>Debian Lenny</strong>. Vous avez, bien sur, besoin d'un nom de domaine. Vous pouvez en enregistrer un sur <a href="http://www.gandi.net/" target="_blank">Gandi</a> par exemple.</p>
<p style="text-align: justify;">On commence par installer <strong>bind9</strong> et les outils nécessaires :</p>

<div class="wp_syntax"><div class="code"><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> bind9 dnsutils</pre></div></div>

<p style="text-align: justify;">Ensuite on commence par éditer le fichier <em>/etc/bind/named.conf.options</em> :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">options <span style="color: #7a0874; font-weight: bold;">&#123;</span>
        directory <span style="color: #ff0000;">&quot;/var/cache/bind&quot;</span>;
&nbsp;
        forwarders <span style="color: #7a0874; font-weight: bold;">&#123;</span>
                213.251.188.140;  <span style="color: #666666; font-style: italic;"># Serveur DNS d'OVH, notre serveur secondaire (sdns1.ovh.net)</span>
        <span style="color: #7a0874; font-weight: bold;">&#125;</span>;
&nbsp;
        auth-nxdomain no;    <span style="color: #666666; font-style: italic;"># conform to RFC1035</span>
        listen-on-v6 <span style="color: #7a0874; font-weight: bold;">&#123;</span> ::<span style="color: #000000;">1</span>; <span style="color: #7a0874; font-weight: bold;">&#125;</span>;
        listen-on <span style="color: #7a0874; font-weight: bold;">&#123;</span> any; <span style="color: #7a0874; font-weight: bold;">&#125;</span>;
        allow-recursion <span style="color: #7a0874; font-weight: bold;">&#123;</span> 127.0.0.1; 213.251.188.140;<span style="color: #7a0874; font-weight: bold;">&#125;</span>;
        notify <span style="color: #c20cb9; font-weight: bold;">yes</span>;
<span style="color: #7a0874; font-weight: bold;">&#125;</span>;</pre></div></div>

<p style="text-align: justify;">On rajoute ensuite une nouvelle zone, dans ce tuto je vais prendre l'exemple de mon nom de domaine. Il faut créer le fichier <em>/etc/bind/db.phollow.fr</em> :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #007800;">$ttl</span> <span style="color: #000000;">86400</span>
phollow.fr.     IN      SOA     r24041.ovh.net. votre.adresse.mail.com. <span style="color: #7a0874; font-weight: bold;">&#40;</span>
                                <span style="color: #000000;">2009052218</span>    <span style="color: #666666; font-style: italic;">#un id unique qu'il faut changer après chaque modif du fichier, généralement la date</span>
                                <span style="color: #000000;">21600</span>
                                <span style="color: #000000;">3600</span>
                                <span style="color: #000000;">604800</span>
                                <span style="color: #000000;">86400</span> <span style="color: #7a0874; font-weight: bold;">&#41;</span>
phollow.fr.     IN      NS      r24041.ovh.net.    <span style="color: #666666; font-style: italic;"># Mon serveur (qui fera le DNS primaire)</span>
phollow.fr.     IN      NS      sdns1.ovh.net.      <span style="color: #666666; font-style: italic;"># DNS secondaire</span>
phollow.fr.     IN      A       87.98.162.48        <span style="color: #666666; font-style: italic;"># l'IP de mon serveur en tant qu'alias</span>
www             IN      CNAME   r24041.ovh.net.  <span style="color: #666666; font-style: italic;"># pour www.phollow.fr</span>
mail            IN      CNAME   r24041.ovh.net. <span style="color: #666666; font-style: italic;"># pour mail.phollow.fr etc.</span></pre></div></div>

<p style="text-align: justify;">Noter bien les points après chaque nom de domaine, ils sont importants.</p>
<p style="text-align: justify;">Ensuite il faut rajouter cette zone dans le <em>/etc/bind/named.conf</em> :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">include <span style="color: #ff0000;">&quot;/etc/bind/named.conf.options&quot;</span>;
&nbsp;
<span style="color: #000000; font-weight: bold;">//</span> prime the server with knowledge of the root servers
zone <span style="color: #ff0000;">&quot;.&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
        <span style="color: #7a0874; font-weight: bold;">type</span> hint;
        <span style="color: #c20cb9; font-weight: bold;">file</span> <span style="color: #ff0000;">&quot;/etc/bind/db.root&quot;</span>;
<span style="color: #7a0874; font-weight: bold;">&#125;</span>;
&nbsp;
<span style="color: #000000; font-weight: bold;">//</span> be authoritative <span style="color: #000000; font-weight: bold;">for</span> the localhost forward and reverse zones, and <span style="color: #000000; font-weight: bold;">for</span>
<span style="color: #000000; font-weight: bold;">//</span> broadcast zones <span style="color: #c20cb9; font-weight: bold;">as</span> per RFC <span style="color: #000000;">1912</span>
&nbsp;
zone <span style="color: #ff0000;">&quot;localhost&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
        <span style="color: #7a0874; font-weight: bold;">type</span> master;
        <span style="color: #c20cb9; font-weight: bold;">file</span> <span style="color: #ff0000;">&quot;/etc/bind/db.local&quot;</span>;
<span style="color: #7a0874; font-weight: bold;">&#125;</span>;
&nbsp;
zone <span style="color: #ff0000;">&quot;127.in-addr.arpa&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
        <span style="color: #7a0874; font-weight: bold;">type</span> master;
        <span style="color: #c20cb9; font-weight: bold;">file</span> <span style="color: #ff0000;">&quot;/etc/bind/db.127&quot;</span>;
<span style="color: #7a0874; font-weight: bold;">&#125;</span>;
&nbsp;
zone <span style="color: #ff0000;">&quot;0.in-addr.arpa&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
        <span style="color: #7a0874; font-weight: bold;">type</span> master;
        <span style="color: #c20cb9; font-weight: bold;">file</span> <span style="color: #ff0000;">&quot;/etc/bind/db.0&quot;</span>;
<span style="color: #7a0874; font-weight: bold;">&#125;</span>;
&nbsp;
zone <span style="color: #ff0000;">&quot;255.in-addr.arpa&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
        <span style="color: #7a0874; font-weight: bold;">type</span> master;
        <span style="color: #c20cb9; font-weight: bold;">file</span> <span style="color: #ff0000;">&quot;/etc/bind/db.255&quot;</span>;
<span style="color: #7a0874; font-weight: bold;">&#125;</span>;
&nbsp;
zone <span style="color: #ff0000;">&quot;phollow.fr&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
        <span style="color: #7a0874; font-weight: bold;">type</span> master;
        <span style="color: #c20cb9; font-weight: bold;">file</span> <span style="color: #ff0000;">&quot;/etc/bind/db.phollow.fr&quot;</span>;
<span style="color: #7a0874; font-weight: bold;">&#125;</span>;</pre></div></div>

<p style="text-align: justify;">Après ça devrait être bon, vous pouvez vérifier la syntaxe de vos fichiers de configuration avec la commande :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">named-checkconf <span style="color: #660033;">-z</span></pre></div></div>

<p style="text-align: justify;">Si il n'y a pas d'erreur, alors on redémarre le démon <strong>bind</strong> :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>ect<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>bind9 restart</pre></div></div>

<p style="text-align: justify;">Ensuite il reste seulement à indiquer à votre fournisseur de noms de domaine que les DNS primaires et secondaires sont respectivement <strong>r24041.ovh.net</strong> et <strong>sdns1.ovh.net</strong> (dans mon cas).</p>
<div id="crp_related"><h3>Articles similaires</h3><ul><li><a href="http://phollow.fr/2009/07/serveur-debian-lenny-apache-mysql-php/" rel="bookmark" class="crp_title">Serveur Debian Lenny - Apache, MySQL &amp; PHP</a><span class="crp_excerpt"> Je commence une toute nouvelle série de billets, sur l'installation ...</span></li><li><a href="http://phollow.fr/2010/06/serveur-web-leger-lighttpd-et-freebsd/" rel="bookmark" class="crp_title">Serveur web léger Lighttpd et FreeBSD</a><span class="crp_excerpt"> Dans cet article je vais vous parler de la configuration ...</span></li><li><a href="http://phollow.fr/2008/11/un-exemple-dutilisation-de-chroot-reinstaller-grub/" rel="bookmark" class="crp_title">Un exemple d'utilisation de chroot : réinstaller GRUB</a><span class="crp_excerpt"> GRUB est une application permettant de choisir sous quel OS ...</span></li><li><a href="http://phollow.fr/2009/05/nouveau-serveur-debian-lenny/" rel="bookmark" class="crp_title">Nouveau serveur : Debian Lenny</a><span class="crp_excerpt"> J'ai enfin décidé de migrer mon site web d'un hébergeur ...</span></li><li><a href="http://phollow.fr/2008/10/une-introduction-a-cakephp/" rel="bookmark" class="crp_title">Une introduction à CakePHP</a><span class="crp_excerpt"> CakePHP est un framework PHP open-source qui a pour but ...</span></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://phollow.fr/2009/08/serveur-debian-lenny-les-dns/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Serveur Debian Lenny - Apache, MySQL &amp; PHP</title>
		<link>http://phollow.fr/2009/07/serveur-debian-lenny-apache-mysql-php/</link>
		<comments>http://phollow.fr/2009/07/serveur-debian-lenny-apache-mysql-php/#comments</comments>
		<pubDate>Sun, 05 Jul 2009 23:12:36 +0000</pubDate>
		<dc:creator>Jérôme M.</dc:creator>
				<category><![CDATA[featured articles]]></category>
		<category><![CDATA[serveur]]></category>
		<category><![CDATA[tutoriel]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[lenny]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://phollow.fr/?p=987</guid>
		<description><![CDATA[Je commence une toute nouvelle série de billets, sur l'installation et la configuration des serveurs dédiés. Étant donné que j'ai bougé ce blog sur une Debian Lenny il y peu de temps, Dhoko et d'autres personnes m'ont fait remarqué que ça pourrait être sympa d'en faire des billets. Donc c'est parti Aujourd'hui nous allons attaquer [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">Je commence une toute nouvelle série de billets, sur l'installation et la configuration des serveurs dédiés. Étant donné que j'ai bougé ce blog sur une <strong>Debian Lenny</strong> il y peu de temps, <a href="http://colibri.servhome.org/" target="_blank">Dhoko</a> et d'autres personnes m'ont fait remarqué que ça pourrait être sympa d'en faire des billets. Donc c'est parti</p>
<p style="text-align: justify;">Aujourd'hui nous allons attaquer l'installation d'un environnement <strong>LAMP</strong>, c'est à dire avec <strong>Apache</strong>, <strong>MySQL</strong> et <strong>PHP</strong>. Ces explications pourront egalement s'appliquer à une Ubuntu, il ne devrais pas y avoir trop de changement.</p>
<h2 style="text-align: justify;">Apache</h2>
<p style="text-align: justify;">Il y a deux modèles pour utiliser PHP au sein d'Apache. La méthode classique consiste à l'embarquer à l'intérieur d'Apache en tant que <strong>module</strong>, c'est cette méthode que nous verrons dans ce billet. Ou alors on peut utiliser <strong>FastCGI</strong> dans lequel PHP et Apache sont deux processus distincts, j'héberge ce blog de cette façon mais cette méthode est plus compliquée et plus longue à mettre en place, j'en parlerai donc dans un autre billet en présentant les avantages de cette autre méthode.</p>
<p style="text-align: justify;">Logguez vous sur votre beau serveur tout neuf en root, on va mettre la base de données des paquets à jour :</p>

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

<p style="text-align: justify;">Et ensuite on va mettre à jour les paquets installés :</p>

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

<p style="text-align: justify;">Histoire de bien partir. Maintenant nous allons pouvoir installer <strong>Apache 2 </strong>et <strong>PHP5</strong> :</p>

<div class="wp_syntax"><div class="code"><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> apache2 php5 libapache2-mod-php5</pre></div></div>

<p style="text-align: justify;">Apache se lancera automatiquement après l'installation, on peut tout de suite tester si PHP fonctionne, en créant un fichier dans <em>/var/www/phpinfo.php</em> avec comme contenu :</p>
<p>Ouvrez le navigateur et pointez l'url sur <em>http://ip.de.votre.serveur/phpinfo.php</em> pour vérifier que PHP est interprété.</p>
<h2>MySQL</h2>
<p style="text-align: justify;"><strong>MySQL 5</strong> s'installe facilement aussi :</p>

<div class="wp_syntax"><div class="code"><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> mysql-server mysql-client php5-mysql</pre></div></div>

<p style="text-align: justify;">La création du mot de passe root (le root de mysql) vous sera demandée lors de l'installation. Nous allons maintenant vérifier que notre base de données fonctionne bien avec <strong>phpmyadmin</strong>.</p>
<h2 style="text-align: justify;">Phpmyadmin</h2>

<div class="wp_syntax"><div class="code"><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> phpmyadmin</pre></div></div>

<p style="text-align: justify;">Il vous demandera quel serveur vous voulez automatiquement configurer, nous devons répondre dans notre cas <strong>apache2</strong>.</p>
<p style="text-align: justify;">On peut maintenant aller sur <em>http://ip.de.votre.serveur/phpmyadmin</em> et se logguer avec les identifiants crées lors de l'installation de Mysql. Une fois à l'intérieur de phpmyadmin, on peut rajouter des bases de données et des utilisateurs.</p>
<h2 style="text-align: justify;">Ah suivre..</h2>
<p style="text-align: justify;">L'installation de votre nom de domaine et de votre serveur DNS. Ensuite viendront l'installation d'un serveur FTP, l'installation des VirtualHosts et bien d'autres choses.</p>
<p style="text-align: justify;">Stay tuned !</p>
<p style="text-align: justify;">Ps: Si vous avez des remarques pouvant améliorer cette partie, n'hésitez surtout pas ;)</p>
<div id="crp_related"><h3>Articles similaires</h3><ul><li><a href="http://phollow.fr/2010/06/serveur-web-leger-lighttpd-et-freebsd/" rel="bookmark" class="crp_title">Serveur web léger Lighttpd et FreeBSD</a><span class="crp_excerpt"> Dans cet article je vais vous parler de la configuration ...</span></li><li><a href="http://phollow.fr/2009/05/nouveau-serveur-debian-lenny/" rel="bookmark" class="crp_title">Nouveau serveur : Debian Lenny</a><span class="crp_excerpt"> J'ai enfin décidé de migrer mon site web d'un hébergeur ...</span></li><li><a href="http://phollow.fr/2009/08/serveur-debian-lenny-les-dns/" rel="bookmark" class="crp_title">Serveur Debian Lenny - Les DNS</a><span class="crp_excerpt"> Ce guide a pour but de vous montrer comment configurer ...</span></li><li><a href="http://phollow.fr/2008/10/une-introduction-a-cakephp/" rel="bookmark" class="crp_title">Une introduction à CakePHP</a><span class="crp_excerpt"> CakePHP est un framework PHP open-source qui a pour but ...</span></li><li><a href="http://phollow.fr/2010/02/dwm/" rel="bookmark" class="crp_title">Dwm</a><span class="crp_excerpt"> Dwm est le Dynamic Window Manager pour X. Il s'occupe ...</span></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://phollow.fr/2009/07/serveur-debian-lenny-apache-mysql-php/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using disk: enhanced (User agent is rejected)
Object Caching 1120/1194 objects using apc

Served from: phollow.fr @ 2012-02-07 23:10:20 -->
