<?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>Void And Any &#187; plug computer</title>
	<atom:link href="http://voidandany.free.fr/index.php/category/informatique/plug-computer/feed/" rel="self" type="application/rss+xml" />
	<link>http://voidandany.free.fr</link>
	<description>mon bazar...</description>
	<lastBuildDate>Sat, 09 Dec 2017 09:24:06 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
		<item>
		<title>Mon Dockstar ne boot plus sous Debian</title>
		<link>http://voidandany.free.fr/index.php/mon-dockstar-ne-boot-plus-sous-debian/</link>
		<comments>http://voidandany.free.fr/index.php/mon-dockstar-ne-boot-plus-sous-debian/#comments</comments>
		<pubDate>Thu, 23 Jun 2011 08:34:12 +0000</pubDate>
		<dc:creator>voidAndAny</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[plug computer]]></category>
		<category><![CDATA[dockstar]]></category>

		<guid isPermaLink="false">http://voidandany.free.fr/?p=4176</guid>
		<description><![CDATA[Hier je bidouillais sur mon Dockstar et un programme que je testais s&#8217;est montré trop gourmand en ressource puis à crashé, mon système ne répondais plus du tout. Impatient j&#8217;ai rebooté électriquement mon Dockstar, erreur fatale, impossible après cela de &#8230; <a href="http://voidandany.free.fr/index.php/mon-dockstar-ne-boot-plus-sous-debian/">Continuer la lecture <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Hier je bidouillais sur mon <a title="Marques-pages : Un mini serveur le Seagate Dockstar" href="http://voidandany.free.fr/index.php/marques-pages-un-mini-serveur-le-seagate-dockstar/">Dockstar </a>et un programme que je testais s&#8217;est montré trop gourmand en ressource puis à crashé, mon système ne répondais plus du tout. Impatient j&#8217;ai rebooté électriquement mon Dockstar, erreur fatale, impossible après cela de me connecter en SSH sur <a title="Installer Debian sur le Seagate Dockstar" href="http://voidandany.free.fr/index.php/installer-debian-sur-le-seagate-dockstar/">Debian</a>.</p>
<p>Voici les symptômes au début du boot le système est pingable, la lumière du Dockstar clignote en vert, puis le système ne répond plus au ping et la lumière s’éteint&#8230;.</p>
<p>Voici les étapes suivi pour ramener le Dockstar à la vie.</p>
<h2>Booter sous pogoplug</h2>
<p>Tout d’abord je me suis assuré que le problème venait de Debian et pas du Dockstar lui-même, pour cela il suffit de débrancher tous les périphériques USB et de rebooter, au bout d&#8217;un certain temps le système devrait être accessible en SSH avec l&#8217;utilisateur root (comme lors de la <a title="Marques-pages : Un mini serveur le Seagate Dockstar" href="http://voidandany.free.fr/index.php/marques-pages-un-mini-serveur-le-seagate-dockstar/">toute première connexion au Dockstar sous Pogoplug</a>) :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">ssh</span> root<span style="color: #000000; font-weight: bold;">@</span><span style="color: #7a0874; font-weight: bold;">&#91;</span>Ip <span style="color: #c20cb9; font-weight: bold;">du</span> Dockstar<span style="color: #7a0874; font-weight: bold;">&#93;</span></pre></div></div>

<p>Avec le mot de passe stxadmin</p>
<p>Si ce n&#8217;est pas le cas il va vous falloir vous fabriquer un connecteur JTAG, heureusement pour moi je n&#8217;en ai pas eu besoin</p>
<h2>Installer le uBoot modifié</h2>
<p>Jeff Doozan (encore lui) à créé une version modifié du uBoot (Universal Bootloader) permettant d&#8217;interagir avec le dockstar lors du boot, nous allons l&#8217;installer (peut n&#8217;est ce pas nécessaire, je n&#8217;ai pas vérifié mais il semblerait que le uBoot modifié soit déjà installé dès lors que l&#8217;on à installé Debian avec le script de Jeff Doozan)</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>tmp
<span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>jeff.doozan.com<span style="color: #000000; font-weight: bold;">/</span>debian<span style="color: #000000; font-weight: bold;">/</span>uboot<span style="color: #000000; font-weight: bold;">/</span>install_uboot_mtd0.sh
<span style="color: #c20cb9; font-weight: bold;">chmod</span> +x install_uboot_mtd0.sh
.<span style="color: #000000; font-weight: bold;">/</span>install_uboot_mtd0.sh</pre></div></div>

<h2>Configurer netconsole<a href="http://linuxfr.org/news/netconsole-log-de-messages-noyaux-via-udp"></a></h2>
<p><a href="http://linuxfr.org/news/netconsole-log-de-messages-noyaux-via-udp">Netconsole permet de transmettre les messages du noyaux via UDP (réseau)</a>, il faut configurer netconsole (inclus dans le noyau 2.6 de Linux) pour qu&#8217;il emette les message de boot vers un autre PC via le réseau.</p>
<p>On réalise cette configuration avec l&#8217;utilitaire fw_setenv installé par le uBoot de Jeff Dozan, dans mon cas cet utilitaire est présent dans /usr/sbin qui n&#8217;est pas dans mon path d&#8217;où le chemin complet à chaque fois :</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>sbin<span style="color: #000000; font-weight: bold;">/</span>fw_setenv serverip <span style="color: #7a0874; font-weight: bold;">&#91;</span>adresse IP PC<span style="color: #7a0874; font-weight: bold;">&#93;</span>
<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>fw_setenv ipaddr <span style="color: #7a0874; font-weight: bold;">&#91;</span>adresse IP Dockstar<span style="color: #7a0874; font-weight: bold;">&#93;</span>
<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>fw_setenv if_netconsole <span style="color: #ff0000;">'ping $serverip'</span>
<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>fw_setenv start_netconsole <span style="color: #ff0000;">'setenv ncip $serverip; setenv bootdelay 10; setenv stdin nc; setenv stdout nc; setenv stderr nc; version;'</span>
<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>fw_setenv preboot <span style="color: #ff0000;">'run if_netconsole start_netconsole'</span></pre></div></div>

<h2>Diagnostiquer le boot du Dockstar</h2>
<p>Sur le PC qui recevra les messages netconsole lancer la commande :</p>
<p>nc -lu 6666</p>
<p>Pour Ubuntu (11.04) sur Debian il semblerait que ce soit nc -l -u -p 6666 ce qui m&#8217;a valu un peu de recherche&#8230;</p>
<p>Rebooter le Dockstar (shutdown -r now sur la console en SSH que vous devez avoir sous la main pour avoir fait les manip ci-dessus) et miracle sur votre autre console (celle avec le nc) les messages de boot s&#8217;affichent :</p>
<h3>Messages de boot sous pogoplug :</h3>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">U-Boot 2010.09 (Oct 23 2010 - 11:49:22)
 Marvell-Dockstar/Pogoplug by Jeff Doozan
 Hit any key to stop autoboot:  0
 (Re)start USB...
 USB:   Register 10011 NbrPorts 1
 USB EHCI 1.00
 scanning bus for devices... 2 USB Device(s) found
 scanning bus for storage devices... 0 Storage Device(s) found
 ** Block device usb 0 not supported
&nbsp;
** Invalid boot device **
 Creating 1 MTD partitions on &quot;nand0&quot;:
 0x000002500000-0x000010000000 : &quot;mtd=3&quot;
 UBI: attaching mtd1 to ubi0
 UBI: physical eraseblock size:   131072 bytes (128 KiB)
 UBI: logical eraseblock size:    129024 bytes
 UBI: smallest flash I/O unit:    2048
 UBI: sub-page size:              512
 UBI: VID header offset:          512 (aligned 512)
 UBI: data offset:                2048
 UBI: attached mtd1 to ubi0
 UBI: MTD device name:            &quot;mtd=3&quot;
 UBI: MTD device size:            219 MiB
 UBI: number of good PEBs:        1751
 UBI: number of bad PEBs:         1
 UBI: max. allowed volumes:       128
 UBI: wear-leveling threshold:    4096
 UBI: number of internal volumes: 1
 UBI: number of user volumes:     0
 UBI: available PEBs:             1730
 UBI: total number of reserved PEBs: 21
 UBI: number of PEBs reserved for bad PEB handling: 17
 UBI: max/mean erase counter: 1/1
 UBIFS error (pid 0): ubifs_get_sb: cannot open &quot;ubi:rootfs&quot;, error -19
 Error reading superblock on volume 'ubi:rootfs'!
 ** Block device usb 0 not supported
 ** Block device usb 1 not supported
 ** Block device usb 2 not supported
 ** Block device usb 3 not supported
 ** Block device usb 0 not supported
 ** Block device usb 0 not supported
 Wrong Image Format for bootm command
 ERROR: can't get kernel image!
 stopping USB..
 ### JFFS2 loading 'uboot-original-mtd0.kwb' to 0x800000
 Scanning JFFS2 FS: ........ done.
 ### JFFS2 load complete: 524288 bytes loaded to 0x800000
 ## Starting application at 0x00800200 ...</pre></div></div>

<p>J&#8217;ai ensuite rebranche ma clé USB qui contient mon système Debian et le disque dur qui contient divers point de montage et rebooté une autre fois le Dockstar</p>
<p>&nbsp;</p>
<h3>Messages de boot sous Debian :</h3>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">U-Boot <span style="color: #000000;">2010.09</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>Oct <span style="color: #000000;">23</span> <span style="color: #000000;">2010</span> - <span style="color: #000000;">11</span>:<span style="color: #000000;">49</span>:<span style="color: #000000;">22</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
 Marvell-Dockstar<span style="color: #000000; font-weight: bold;">/</span>Pogoplug by Jeff Doozan
 Hit any key to stop autoboot:  <span style="color: #000000;">0</span>
 <span style="color: #7a0874; font-weight: bold;">&#40;</span>Re<span style="color: #7a0874; font-weight: bold;">&#41;</span>start USB...
 USB:   Register <span style="color: #000000;">10011</span> NbrPorts <span style="color: #000000;">1</span>
 USB EHCI <span style="color: #000000;">1.00</span>
 scanning bus <span style="color: #000000; font-weight: bold;">for</span> devices... <span style="color: #000000;">4</span> USB Device<span style="color: #7a0874; font-weight: bold;">&#40;</span>s<span style="color: #7a0874; font-weight: bold;">&#41;</span> found
 scanning bus <span style="color: #000000; font-weight: bold;">for</span> storage devices... <span style="color: #000000;">2</span> Storage Device<span style="color: #7a0874; font-weight: bold;">&#40;</span>s<span style="color: #7a0874; font-weight: bold;">&#41;</span> found
 Loading <span style="color: #c20cb9; font-weight: bold;">file</span> <span style="color: #ff0000;">&quot;/rescueme&quot;</span> from usb device <span style="color: #000000;">0</span>:<span style="color: #000000;">1</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>usbda1<span style="color: #7a0874; font-weight: bold;">&#41;</span>
 <span style="color: #000000; font-weight: bold;">**</span> File not found <span style="color: #000000; font-weight: bold;">/</span>rescueme
 reading <span style="color: #000000; font-weight: bold;">/</span>rescueme.txt
&nbsp;
<span style="color: #000000; font-weight: bold;">**</span> Unable to <span style="color: #c20cb9; font-weight: bold;">read</span> <span style="color: #ff0000;">&quot;/rescueme.txt&quot;</span> from usb <span style="color: #000000;">0</span>:<span style="color: #000000;">1</span> <span style="color: #000000; font-weight: bold;">**</span>
 Creating <span style="color: #000000;">1</span> MTD partitions on <span style="color: #ff0000;">&quot;nand0&quot;</span>:
 0x000002500000-0x000010000000 : <span style="color: #ff0000;">&quot;mtd=3&quot;</span>
 UBI: attaching mtd1 to ubi0
 UBI: physical eraseblock <span style="color: #c20cb9; font-weight: bold;">size</span>:   <span style="color: #000000;">131072</span> bytes <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">128</span> KiB<span style="color: #7a0874; font-weight: bold;">&#41;</span>
 UBI: logical eraseblock <span style="color: #c20cb9; font-weight: bold;">size</span>:    <span style="color: #000000;">129024</span> bytes
 UBI: smallest flash I<span style="color: #000000; font-weight: bold;">/</span>O unit:    <span style="color: #000000;">2048</span>
 UBI: sub-page <span style="color: #c20cb9; font-weight: bold;">size</span>:              <span style="color: #000000;">512</span>
 UBI: VID header offset:          <span style="color: #000000;">512</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>aligned <span style="color: #000000;">512</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
 UBI: data offset:                <span style="color: #000000;">2048</span>
 UBI: attached mtd1 to ubi0
 UBI: MTD device name:            <span style="color: #ff0000;">&quot;mtd=3&quot;</span>
 UBI: MTD device <span style="color: #c20cb9; font-weight: bold;">size</span>:            <span style="color: #000000;">219</span> MiB
 UBI: number of good PEBs:        <span style="color: #000000;">1751</span>
 UBI: number of bad PEBs:         <span style="color: #000000;">1</span>
 UBI: max. allowed volumes:       <span style="color: #000000;">128</span>
 UBI: wear-leveling threshold:    <span style="color: #000000;">4096</span>
 UBI: number of internal volumes: <span style="color: #000000;">1</span>
 UBI: number of user volumes:     <span style="color: #000000;">0</span>
 UBI: available PEBs:             <span style="color: #000000;">1730</span>
 UBI: total number of reserved PEBs: <span style="color: #000000;">21</span>
 UBI: number of PEBs reserved <span style="color: #000000; font-weight: bold;">for</span> bad PEB handling: <span style="color: #000000;">17</span>
 UBI: max<span style="color: #000000; font-weight: bold;">/</span>mean erase counter: <span style="color: #000000;">1</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">1</span>
 UBIFS error <span style="color: #7a0874; font-weight: bold;">&#40;</span>pid <span style="color: #000000;">0</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>: ubifs_get_sb: cannot open <span style="color: #ff0000;">&quot;ubi:rootfs&quot;</span>, error <span style="color: #660033;">-19</span>
 Error reading superblock on volume <span style="color: #ff0000;">'ubi:rootfs'</span><span style="color: #000000; font-weight: bold;">!</span>
 Loading <span style="color: #c20cb9; font-weight: bold;">file</span> <span style="color: #ff0000;">&quot;/boot/uImage&quot;</span> from usb device <span style="color: #000000;">0</span>:<span style="color: #000000;">1</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>usbda1<span style="color: #7a0874; font-weight: bold;">&#41;</span>
 <span style="color: #000000;">1</span> bytes <span style="color: #c20cb9; font-weight: bold;">read</span>
 Found bootable drive on usb <span style="color: #000000;">0</span>:<span style="color: #000000;">1</span>
 Loading <span style="color: #c20cb9; font-weight: bold;">file</span> <span style="color: #ff0000;">&quot;/boot/uImage&quot;</span> from usb device <span style="color: #000000;">0</span>:<span style="color: #000000;">1</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>usbda1<span style="color: #7a0874; font-weight: bold;">&#41;</span>
 <span style="color: #000000;">1433640</span> bytes <span style="color: #c20cb9; font-weight: bold;">read</span>
 Loading <span style="color: #c20cb9; font-weight: bold;">file</span> <span style="color: #ff0000;">&quot;/boot/uInitrd&quot;</span> from usb device <span style="color: #000000;">0</span>:<span style="color: #000000;">1</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>usbda1<span style="color: #7a0874; font-weight: bold;">&#41;</span>
 <span style="color: #000000;">4887353</span> bytes <span style="color: #c20cb9; font-weight: bold;">read</span>
 <span style="color: #666666; font-style: italic;">## Booting kernel from Legacy Image at 00800000 ...</span>
 Image Name:   Debian kernel 2.6.32-<span style="color: #000000;">5</span>-kirkwood
 Image Type:   ARM Linux Kernel Image <span style="color: #7a0874; font-weight: bold;">&#40;</span>uncompressed<span style="color: #7a0874; font-weight: bold;">&#41;</span>
 Data Size:    <span style="color: #000000;">1433576</span> Bytes = <span style="color: #000000;">1.4</span> MiB
 Load Address: 00008000
 Entry Point:  00008000
 Verifying Checksum ... OK
 <span style="color: #666666; font-style: italic;">## Loading init Ramdisk from Legacy Image at 01100000 ...</span>
 Image Name:   Debian ramdisk 2.6.32-<span style="color: #000000;">5</span>-kirkwood
 Image Type:   ARM Linux RAMDisk Image <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">gzip</span> compressed<span style="color: #7a0874; font-weight: bold;">&#41;</span>
 Data Size:    <span style="color: #000000;">4887289</span> Bytes = <span style="color: #000000;">4.7</span> MiB
 Load Address: 00000000
 Entry Point:  00000000
 Verifying Checksum ... OK
 Loading Kernel Image ... OK
 OK
&nbsp;
Starting kernel ...</pre></div></div>

<p>On voit / confirme alors que le boot du Dockstar fonctionne parfaitement puisque le kernel Debian démarre. Le problème se situe donc au niveau de ce dernier&#8230;</p>
<p>&nbsp;</p>
<h2>Réparer Debian</h2>
<p>Après avoir éteint le Dockstar, j&#8217;ai branché la clé USB contenant Debian sur mon PC et commencé par faire une vérification du disque :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> fsck <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sdb1</pre></div></div>

<p>La clé contenait une erreur :</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">fsck de util-linux-ng 2.17.2
 e2fsck 1.41.14 (22-Dec-2010)
 /dev/sdb1 est monté.
&nbsp;
AVERTISSEMENT !!! Le système de fichiers est monté.   Si vous continuez
 vous ***ALLEZ*** causer des dommages ***SÉVÈRES*** au système de fichiers.
&nbsp;
Souhaitez-vous réellement continuer (o/n)? oui
&nbsp;
/dev/sdb1 contient un système de fichiers comportant des erreurs, vérification forcée.
 Passe 1 : vérification des i-noeuds, des blocs et des tailles
 Passe 2 : vérification de la structure des répertoires
 Passe 3 : vérification de la connectivité des répertoires
 Passe 4 : vérification des compteurs de référence
 I-noeud 8098 non attaché
 Connecter à /lost+found&lt;o&gt;? oui
&nbsp;
le compteur de référence de l'i-noeud 8098 est 2, devrait être 1. Corriger&lt;o&gt;? oui
&nbsp;
Passe 5 : vérification de l'information du sommaire de groupe
&nbsp;
/dev/sdb1: ***** LE SYSTÈME DE FICHIERS A ÉTÉ MODIFIÉ *****
 /dev/sdb1 : 28353/108864 fichiers (1.3% non contigus), 217045/435448 blocs</pre></div></div>

<p>J&#8217;ai ensuite re-généré l&#8217;image du kernel, pour cela on démarre le Dockstar sous pogoplug (sans clé USB) et on se connecte dessus en SSH (voir 1er paragraphe).</p>
<p>On connecte alors la clé USB contenant Debian, on la monte, on fait un chroot sur le point de montage et on régénère l&#8217;image du kernel :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">mount</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sda1 <span style="color: #000000; font-weight: bold;">/</span>mnt
<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">chroot</span> <span style="color: #000000; font-weight: bold;">/</span>mnt
<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>mkimage <span style="color: #660033;">-A</span> arm <span style="color: #660033;">-O</span> linux <span style="color: #660033;">-T</span> kernel  <span style="color: #660033;">-C</span> none <span style="color: #660033;">-a</span> 0x00008000 <span style="color: #660033;">-e</span> 0x00008000 <span style="color: #660033;">-n</span> Linux-2.6.32-<span style="color: #000000;">5</span> <span style="color: #660033;">-d</span> <span style="color: #000000; font-weight: bold;">/</span>boot<span style="color: #000000; font-weight: bold;">/</span>vmlinuz-2.6.32-<span style="color: #000000;">5</span>-kirkwood <span style="color: #000000; font-weight: bold;">/</span>boot<span style="color: #000000; font-weight: bold;">/</span>uImage</pre></div></div>

<p>Sortie de la commande :</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">Image Name:   Linux-2.6.32-5
 Created:      Tue Jun 21 23:58:21 2011
 Image Type:   ARM Linux Kernel Image (uncompressed)
 Data Size:    1433576 Bytes = 1399.98 kB = 1.37 MB
 Load Address: 0x00008000
 Entry Point:  0x00008000</pre></div></div>

<p>Puis</p>
<p>&nbsp;</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>bin<span style="color: #000000; font-weight: bold;">/</span>mkimage <span style="color: #660033;">-A</span> arm <span style="color: #660033;">-O</span> linux <span style="color: #660033;">-T</span> ramdisk <span style="color: #660033;">-C</span> <span style="color: #c20cb9; font-weight: bold;">gzip</span> <span style="color: #660033;">-a</span> 0x00000000 <span style="color: #660033;">-e</span> 0x00000000 <span style="color: #660033;">-n</span> initramfs <span style="color: #660033;">-d</span> <span style="color: #000000; font-weight: bold;">/</span>boot<span style="color: #000000; font-weight: bold;">/</span>initrd.img-2.6.32-<span style="color: #000000;">5</span>-kirkwood <span style="color: #000000; font-weight: bold;">/</span>boot<span style="color: #000000; font-weight: bold;">/</span>uInitrd</pre></div></div>

<p>&nbsp;</p>
<p>Sortie de la commande :</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">Image Name:   initramfs
 Created:      Tue Jun 21 23:58:25 2011
 Image Type:   ARM Linux RAMDisk Image (gzip compressed)
 Data Size:    4887289 Bytes = 4772.74 kB = 4.66 MB
 Load Address: 0x00000000
 Entry Point:  0x00000000</pre></div></div>

<p>&nbsp;</p>
<p>Laisser les périphériques branchés, sortir du chroot (exit) et rebooter et normalement miracle le Dockstar devrait démarrer sous Debian&#8230;</p>
<p>&nbsp;</p>
<p><span style="text-decoration: underline;"><em><strong>Sources :</strong></em></span></p>
<ul>
<li><a href="http://jeff.doozan.com/debian/uboot/">Update uBoot on your Dockstar, GoFlex, or Pogoplug NAS</a></li>
<li><a href="http://forum.doozan.com/read.php?3,14,14">Use netconsole to troubleshoot uBoot without a serial cable</a></li>
<li><a href="http://www.pluc.fr/2011/02/seagate-dockstar-installation-et-amelioration/">Seagate dockstar installation et amélioration</a></li>
<li><a href="http://blog.slucas.fr/en/tips/dockstar-update-uimage-uinitrd">Update a Dockstar uImage/uInitrd after a kernel update [Technology and me]</a></li>
<li><a href="http://forum.hardware.fr/hfr/OSAlternatifs/Hardware-2/seagate-dockstar-computer-sujet_71314_50.htm#t1275403">Forum Hardware.fr sur le Dockstar </a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://voidandany.free.fr/index.php/mon-dockstar-ne-boot-plus-sous-debian/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Installer un serveur web (nginx) sur le Seagate Dockstar</title>
		<link>http://voidandany.free.fr/index.php/installer-un-serveur-web-nginx-sur-le-seagate-dockstar/</link>
		<comments>http://voidandany.free.fr/index.php/installer-un-serveur-web-nginx-sur-le-seagate-dockstar/#comments</comments>
		<pubDate>Mon, 21 Mar 2011 17:16:07 +0000</pubDate>
		<dc:creator>voidAndAny</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[plug computer]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[dockstar]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://voidandany.free.fr/?p=3483</guid>
		<description><![CDATA[Après l&#8217;installation et la configuration de Debian sur le Seagate Dockstar, voici venu l&#8217;installation de ce qu&#8217;il faut pour qu&#8217;il remplisse son premier rôle : Serveur Web. J&#8217;ai déjà fait un article sur l&#8217;installation d&#8217;un serveur Web Cherokee et Lighttpd, &#8230; <a href="http://voidandany.free.fr/index.php/installer-un-serveur-web-nginx-sur-le-seagate-dockstar/">Continuer la lecture <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://voidandany.free.fr/wp-content/uploads/Nginx-Logo.png"><img class="alignleft size-medium wp-image-3541" title="Nginx" src="http://voidandany.free.fr/wp-content/uploads/Nginx-Logo-300x83.png" alt="" width="300" height="83" /></a>Après l&#8217;<a title="Installer Debian sur le Seagate Dockstar" href="http://voidandany.free.fr/index.php/installer-debian-sur-le-seagate-dockstar/">installation</a> et la <a title="Configuration de « base » du Dockstar" href="http://voidandany.free.fr/index.php/configuration-de-base-du-dockstar/">configuration</a> de Debian sur le Seagate Dockstar, voici venu l&#8217;installation de ce qu&#8217;il faut pour qu&#8217;il remplisse son premier rôle : <strong>Serveur Web</strong>.</p>
<p>J&#8217;ai déjà fait un article sur l&#8217;installation d&#8217;un serveur Web <a title="Installation d’un serveur Web avec Cherokee" href="http://voidandany.free.fr/index.php/installation-dun-serveur-web-avec-cherokee/">Cherokee</a> et <a title="Installation d’un serveur Web avec Lighttpd" href="http://voidandany.free.fr/index.php/installation-dun-serveur-web-avec-lighttpd/">Lighttpd</a>, mais ces 2 serveurs web sont soit trop gourmand en ressource soit trop gros.</p>
<p>Il reste un autre challenger à Apache, il s&#8217;agit de<strong> <a href="http://nginx.org/en/"><em>nginx</em></a> </strong>(se prononce engine X).</p>
<p>Ce serveur web en plus d&#8217;être incroyablement <strong>performant </strong>est incroyablement <strong>sobre en ressources</strong>, il est quasiment systématiquement installé sur les machines de faible puissance que sont les plug computer.</p>
<p>Contrairement aux articles précédemment cités sur l&#8217;installation de Cherokee et Lihttpd je ne détaillerais pas l&#8217;installation de MySQL ici, pour la simple et bonne raison que je ne l&#8217;ai pas installé sur mon Dockstar (cf. <a title="Installer et configurer Mysql sur le Dockstar" href="http://voidandany.free.fr/index.php/installer-et-configurer-mysql-sur-le-dockstar/">Installer et configurer Mysql sur le Dockstar</a>)</p>
<p>&nbsp;</p>
<h2>Installation de nginx</h2>
<p>L&#8217;installation peut se faire simplement avec aptitude/apt-get car il existe un paquet nginx mais ce dernier est en version 0.7.x dans les dépôt Debian Squeeze, c&#8217;est à dire la version &laquo;&nbsp;legacy&nbsp;&raquo; (que l&#8217;on peut traduire par dépassé).</p>
<p>Un paquet de la version 0.8.54 est disponible sur <a href="http://www.dotdeb.org/2011/03/12/nginx-now-on-dotdeb/">dotdeb</a> mais ce dernier est disponible que pour les <a href="http://packages.dotdeb.org/dists/squeeze/nginx/">architectures i386 et amd64</a> mais pas pour l&#8217;architecture <a href="http://fr.wikipedia.org/wiki/Architecture_ARM">ARM</a></p>
<p>On va donc <strong>installer </strong>la <strong>version 0.8.54 à partir des sources</strong>, ce qui est tout de même un peu &laquo;&nbsp;touchy&nbsp;&raquo;.</p>
<p>Heureusement pour nous / moi <a href="http://blog.nicolargo.com/2011/01/installation-automatique-de-nginx-php-fpm-memcached-sous-debian.html">Nicolargo a publié un <strong>script</strong></a><strong> automatisant le process</strong>. Ce script installe nginx depuis les sources, le configure et installe php 5.x en mode <a href="http://php-fpm.org/">FPM</a> depuis les dépôts dotdeb, il faut donc l&#8217;adapter pour supprimer toute la partie installation de php-fpm qui n&#8217;est pas disponible non plus sur dotdeb pour les machines ARM.</p>
<p>Voici le script modifié :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
<span style="color: #666666; font-style: italic;"># Mon script d'installation automatique de NGinx (depuis les sources)</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># Nicolargo - 01/2011</span>
<span style="color: #666666; font-style: italic;"># Modifié VoidAndAny - 03/2011</span>
<span style="color: #666666; font-style: italic;"># GPL</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># Syntaxe: # su - -c &quot;./nginxautoinstall.sh&quot;</span>
<span style="color: #666666; font-style: italic;"># Syntaxe: or # sudo ./nginxautoinstall.sh</span>
<span style="color: #007800;">VERSION</span>=<span style="color: #ff0000;">&quot;2.0&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">##############################</span>
<span style="color: #666666; font-style: italic;"># Version de NGinx a installer</span>
&nbsp;
<span style="color: #007800;">NGINX_VERSION</span>=<span style="color: #ff0000;">&quot;0.8.54&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">##############################</span>
<span style="color: #666666; font-style: italic;"># Debut de l'installation</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Test que le script est lance en root</span>
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$EUID</span> <span style="color: #660033;">-ne</span> <span style="color: #000000;">0</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Le script doit être lancé en root: # sudo $0&quot;</span> <span style="color: #000000;">1</span><span style="color: #000000; font-weight: bold;">&gt;&amp;</span><span style="color: #000000;">2</span>
<span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">1</span>
<span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Pre-requis</span>
<span style="color: #c20cb9; font-weight: bold;">aptitude</span> <span style="color: #c20cb9; font-weight: bold;">install</span> build-essential libpcre3-dev libssl-dev zlib1g-dev
&nbsp;
<span style="color: #666666; font-style: italic;"># Telechargement des fichiers</span>
<span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>sysoev.ru<span style="color: #000000; font-weight: bold;">/</span>nginx<span style="color: #000000; font-weight: bold;">/</span>nginx-<span style="color: #007800;">$NGINX_VERSION</span>.tar.gz
&nbsp;
<span style="color: #666666; font-style: italic;"># Extract</span>
<span style="color: #c20cb9; font-weight: bold;">tar</span> zxvf nginx-<span style="color: #007800;">$NGINX_VERSION</span>.tar.gz
&nbsp;
<span style="color: #666666; font-style: italic;"># Configure</span>
<span style="color: #7a0874; font-weight: bold;">cd</span> nginx-<span style="color: #007800;">$NGINX_VERSION</span>
.<span style="color: #000000; font-weight: bold;">/</span>configure   <span style="color: #660033;">--conf-path</span>=<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>nginx<span style="color: #000000; font-weight: bold;">/</span>nginx.conf   <span style="color: #660033;">--error-log-path</span>=<span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>log<span style="color: #000000; font-weight: bold;">/</span>nginx<span style="color: #000000; font-weight: bold;">/</span>error.log   <span style="color: #660033;">--pid-path</span>=<span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>run<span style="color: #000000; font-weight: bold;">/</span>nginx.pid   <span style="color: #660033;">--lock-path</span>=<span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>lock<span style="color: #000000; font-weight: bold;">/</span>nginx.lock   <span style="color: #660033;">--http-log-path</span>=<span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>log<span style="color: #000000; font-weight: bold;">/</span>nginx<span style="color: #000000; font-weight: bold;">/</span>access.log   --with-http_dav_module   <span style="color: #660033;">--http-client-body-temp-path</span>=<span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>nginx<span style="color: #000000; font-weight: bold;">/</span>body   --with-http_ssl_module   <span style="color: #660033;">--http-proxy-temp-path</span>=<span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>nginx<span style="color: #000000; font-weight: bold;">/</span>proxy   --with-http_stub_status_module   <span style="color: #660033;">--http-fastcgi-temp-path</span>=<span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>nginx<span style="color: #000000; font-weight: bold;">/</span>fastcgi   <span style="color: #660033;">--with-debug</span>   --with-http_flv_module
&nbsp;
<span style="color: #666666; font-style: italic;"># Compile</span>
<span style="color: #c20cb9; font-weight: bold;">make</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Install</span>
<span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Post installation</span>
<span style="color: #7a0874; font-weight: bold;">cd</span> ..
<span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>nginx
<span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>nginx<span style="color: #000000; font-weight: bold;">/</span>conf.d
<span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>nginx<span style="color: #000000; font-weight: bold;">/</span>sites-enabled
<span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www
<span style="color: #c20cb9; font-weight: bold;">chown</span> <span style="color: #660033;">-R</span> www-data:www-data <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www
&nbsp;
<span style="color: #666666; font-style: italic;"># Download the init script</span>
<span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>svn.nicolargo.com<span style="color: #000000; font-weight: bold;">/</span>debianpostinstall<span style="color: #000000; font-weight: bold;">/</span>trunk<span style="color: #000000; font-weight: bold;">/</span>nginx
<span style="color: #c20cb9; font-weight: bold;">mv</span> nginx <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>
<span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #000000;">755</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>nginx
<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>update-rc.d <span style="color: #660033;">-f</span> nginx defaults
&nbsp;
<span style="color: #666666; font-style: italic;"># Download the default configuration file</span>
<span style="color: #666666; font-style: italic;"># Nginx + default site</span>
<span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>svn.nicolargo.com<span style="color: #000000; font-weight: bold;">/</span>debianpostinstall<span style="color: #000000; font-weight: bold;">/</span>trunk<span style="color: #000000; font-weight: bold;">/</span>nginx.conf
<span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>svn.nicolargo.com<span style="color: #000000; font-weight: bold;">/</span>debianpostinstall<span style="color: #000000; font-weight: bold;">/</span>trunk<span style="color: #000000; font-weight: bold;">/</span>default-site
<span style="color: #c20cb9; font-weight: bold;">mv</span> nginx.conf <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>nginx<span style="color: #000000; font-weight: bold;">/</span>
<span style="color: #c20cb9; font-weight: bold;">mv</span> default-site <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>nginx<span style="color: #000000; font-weight: bold;">/</span>sites-enabled<span style="color: #000000; font-weight: bold;">/</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Start NGinx</span>
<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>nginx start
&nbsp;
<span style="color: #666666; font-style: italic;"># Summary</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;--------------------------------------&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;NGinx installation finished&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;--------------------------------------&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;NGinx configuration folder:       /etc/nginx&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;NGinx default site configuration: /etc/nginx/sites-enabled/default-site&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;NGinx default HTML root:          /var/www&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;If you use IpTables add the following rules:&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;iptables -A INPUT -i lo -s localhost -d localhost -j ACCEPT&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;iptables -A OUTPUT -o lo -s localhost -d localhost -j ACCEPT&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;iptables -A OUTPUT -m state --state RELATED,ESTABLISHED -j ACCEPT&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;iptables -A INPUT  -p tcp --dport http -j ACCEPT&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;--------------------------------------&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Fin du script</span></pre></div></div>

<p>&nbsp;</p>
<p>A l&#8217;issu de ce script si on va à l&#8217;adresse IP du Dockstar avec un navigateur web, on doit avoir la page suivante qui s&#8217;affiche :</p>
<p><a href="http://voidandany.free.fr/wp-content/uploads/Sélection_0078.png"><img class="aligncenter size-medium wp-image-3484" title="Nginx" src="http://voidandany.free.fr/wp-content/uploads/Sélection_0078-300x111.png" alt="" width="300" height="111" /></a></p>
<p>Pour être sûr que nginx peut nous restituer une page HTML on peut lancer les commandes suivante (sur la Dockstar)</p>
<p lang="bash">&nbsp;</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;test&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;</span> index.html
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">chown</span> www-data:www-data index.html
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">mv</span> index.html <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www</pre></div></div>

<p>&nbsp;</p>
<p>En allant sur l&#8217;adresse IP du Dockstar, on devrait désormais avoir test qui s&#8217;affiche.</p>
<p>&nbsp;</p>
<h2>Installation de PHP</h2>
<p>Il existe de plusieurs façon pour un serveur web d&#8217;interagir avec le &laquo;&nbsp;moteur&nbsp;&raquo; d&#8217;interprétation de php  :</p>
<ul>
<li>module  : php est interprété directement par le serveur Web (<a href="http://php.net/manual/en/security.apache.php">avec apache par exemple</a>)</li>
<li><a href="http://fr.wikipedia.org/wiki/Common_Gateway_Interface">CGI</a> : le serveur Web laisse l&#8217;interprétation de php au module cgi php</li>
<li> <a href="http://www.fastcgi.com/drupal/node/2">fastCGI</a> : évolution de CGI pour le rendre plus performant </li>
<li><a href="http://redmine.lighttpd.net/projects/spawn-fcgi">spawn-fcgi</a> : une implémentation de fastCGI initialement faite pour le serveur web lighttpd</li>
<li><a href="http://php-fpm.org/">FPM</a> : implémentation de fastCGI remplaçant de spawn-fcgi <a href="http://vpsbible.com/php/php-benchmarking-phpfpm-fastcgi-spawnfcgi/">plus rapide et stable</a></li>
</ul>
<p>Malheureusement il n&#8217;existe pas de paquet Debian de l&#8217;implémentation FPM de fastCGI (php-fpm) pour l&#8217;architecture ARM, donc à moins de vouloir le compiler depuis les sources on <strong>utilisera l&#8217;implémentation spawn-fcgi de php</strong>.</p>
<p>Pour l&#8217;installation on fera :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">aptitude</span> <span style="color: #c20cb9; font-weight: bold;">install</span> php5-cgi spawn-fcgi</pre></div></div>

<p>(20,3 Mo utilisés)</p>
<p>&nbsp;</p>
<p>Il faut ensuite faire un script init.d (/etc/init.d/php5-fcgi) pour que le serveur php démarre :</p>
<p>&nbsp;</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/sh</span>
&nbsp;
<span style="color: #666666; font-style: italic;">### BEGIN INIT INFO</span>
<span style="color: #666666; font-style: italic;"># Provides:       php5-fcgi</span>
<span style="color: #666666; font-style: italic;"># Required-Start: $remote_fs $syslog</span>
<span style="color: #666666; font-style: italic;"># Required-Stop:  $remote_fs $syslog</span>
<span style="color: #666666; font-style: italic;"># Default-Start:  2 3 4 5</span>
<span style="color: #666666; font-style: italic;"># Default-Stop:   0 1 6</span>
<span style="color: #666666; font-style: italic;"># Short-Description: PHP5 FastCgi Spawned processes</span>
<span style="color: #666666; font-style: italic;">### END INIT INFO</span>
&nbsp;
<span style="color: #007800;">COMMAND</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>spawn-fcgi
<span style="color: #007800;">ADDRESS</span>=127.0.0.1
<span style="color: #007800;">PORT</span>=<span style="color: #000000;">9000</span>
<span style="color: #007800;">USER</span>=www-data
<span style="color: #007800;">GROUP</span>=www-data
<span style="color: #007800;">PHPCGI</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>php5-cgi
<span style="color: #007800;">PIDFILE</span>=<span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>run<span style="color: #000000; font-weight: bold;">/</span>fastcgi-php.pid
<span style="color: #007800;">RETVAL</span>=<span style="color: #000000;">0</span>
&nbsp;
<span style="color: #007800;">PHP_FCGI_MAX_REQUESTS</span>=<span style="color: #000000;">500</span>
<span style="color: #007800;">PHP_FCGI_CHILDREN</span>=<span style="color: #000000;">2</span>
&nbsp;
start<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
 <span style="color: #7a0874; font-weight: bold;">export</span> PHP_FCGI_MAX_REQUESTS PHP_FCGI_CHILDREN
 <span style="color: #007800;">$COMMAND</span> <span style="color: #660033;">-a</span> <span style="color: #007800;">$ADDRESS</span> <span style="color: #660033;">-p</span> <span style="color: #007800;">$PORT</span> <span style="color: #660033;">-u</span> <span style="color: #007800;">$USER</span> <span style="color: #660033;">-g</span> <span style="color: #007800;">$GROUP</span> <span style="color: #660033;">-f</span> <span style="color: #007800;">$PHPCGI</span> <span style="color: #660033;">-P</span> <span style="color: #007800;">$PIDFILE</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
stop<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
 <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">killall</span> <span style="color: #660033;">-9</span> php5-cgi
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">case</span> <span style="color: #ff0000;">&quot;$1&quot;</span> <span style="color: #000000; font-weight: bold;">in</span>
 start<span style="color: #7a0874; font-weight: bold;">&#41;</span>
 start
 <span style="color: #007800;">RETVAL</span>=<span style="color: #007800;">$?</span>
 <span style="color: #000000; font-weight: bold;">;;</span>
 stop<span style="color: #7a0874; font-weight: bold;">&#41;</span>
 stop
 <span style="color: #007800;">RETVAL</span>=<span style="color: #007800;">$?</span>
 <span style="color: #000000; font-weight: bold;">;;</span>
 restart<span style="color: #000000; font-weight: bold;">|</span>reload<span style="color: #7a0874; font-weight: bold;">&#41;</span>
 stop
 start
 <span style="color: #007800;">RETVAL</span>=<span style="color: #007800;">$?</span>
 <span style="color: #000000; font-weight: bold;">;;</span>
 <span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
 <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Usage: fastcgi {start|stop|restart}&quot;</span>
 <span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">1</span>
 <span style="color: #000000; font-weight: bold;">;;</span>
<span style="color: #000000; font-weight: bold;">esac</span>
<span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #007800;">$RETVAL</span></pre></div></div>

<p>&nbsp;</p>
<p>Et on le démarre :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>php5-fcgi start</pre></div></div>

<p>Il faut ensuite en théorie indiquer à nginx comment interpréter les fichiers php en ajouter ce genre de directives dans le fichier /etc/nginx/sites-enabled/default-site</p>
<p>&nbsp;</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">location ~ \.php$ {
 include /etc/nginx/fastcgi_params;
 fastcgi_param   SCRIPT_FILENAME  $document_root$fastcgi_script_name;
 fastcgi_pass    127.0.0.1:9000;
 }</pre></div></div>

<p>&nbsp;</p>
<p>J&#8217;ai marqué en théorie car l&#8217;installation de nginx faite par le script de Nicolargo créé un fichier default-site qui contient déjà cette directive.</p>
<p>&nbsp;</p>
<p>Pour tester php, on crée un fichier php contenant la directive phpinfo :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;&lt;?php phpinfo(); ?&gt;&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;</span> phpinfo.php
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">chown</span> www-data:www-data phpinfo.php
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">mv</span> phpinfo.php <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www</pre></div></div>

<p>&nbsp;</p>
<p>Et en allant sur l&#8217;adresse IP du Dockstar, sur la page phpinfo.php on doit voir cette page s&#8217;afficher :</p>
<p><a href="http://voidandany.free.fr/wp-content/uploads/Sélection_0089.png"><img class="aligncenter" title="Sélection_008" src="http://voidandany.free.fr/wp-content/uploads/Sélection_0089-263x300.png" alt="" width="263" height="300" /></a></p>
<p>&nbsp;</p>
<p><span style="text-decoration: underline;"><strong>PS :</strong></span> Quelques information concernant l&#8217;espace disque utilisé par les différents serveur web (sur une Debian de base)</p>
<ul>
<li>nginx : 1.6 MB</li>
<li>apache2 : 44.4 MB </li>
<li>lighttpd : 35.8 MB</li>
</ul>
<p>&nbsp;</p>
<p><span style="text-decoration: underline;"><em><strong>Sources : </strong></em></span></p>
<p><a title="Installation automatique de NGinx, PHP-FPM, MemCached sous Debian" href="http://blog.nicolargo.com/2011/01/installation-automatique-de-nginx-php-fpm-memcached-sous-debian.html">Nicolargo : Installation automatique de NGinx, PHP-FPM, MemCached sous Debian</a></p>
<p><a href="http://www.it-wars.com/article176/seagate-dockstar-un-plug-computer-green">IT Wars : Seagate DockStar un plug computer green</a></p>
<p><a title="blog:nginx-php-install" href="http://blog.slucas.fr/blog/nginx-php-install">Blog slucas : Installation de nginx sous Debian</a></p>
<p><a href="http://neokraft.net/2010/03/20/serveur-web-nginx-php-mysql">Ici &amp; Ailleurs : Un serveur web avec Nginx, PHP et MySQL</a></p>
<p><a href="http://library.linode.com/web-servers/nginx/php-fastcgi/debian-5-lenny">Linode library : Nginx and PHP-FastCGI on Debian 5 (Lenny)</a></p>
<p><a href="http://library.linode.com/web-servers/nginx/configuration/basic">Linode library : Basic Nginx Configuration</a></p>
<p><a href="http://library.linode.com/web-servers/nginx/configuration/">Linode Library : Nginx Configuration</a></p>
<p><a title="Permanent Link to Optimiser son serveur Web avec Nginx" rel="bookmark" href="http://www.papygeek.com/software/optimiser-son-serveur-web-avec-nginx/">Papy Geek : Optimiser son serveur Web avec Nginx</a></p>
]]></content:encoded>
			<wfw:commentRss>http://voidandany.free.fr/index.php/installer-un-serveur-web-nginx-sur-le-seagate-dockstar/feed/</wfw:commentRss>
		<slash:comments>31</slash:comments>
		</item>
		<item>
		<title>Configuration de &#171;&#160;base&#160;&#187; du Dockstar</title>
		<link>http://voidandany.free.fr/index.php/configuration-de-base-du-dockstar/</link>
		<comments>http://voidandany.free.fr/index.php/configuration-de-base-du-dockstar/#comments</comments>
		<pubDate>Wed, 16 Mar 2011 18:57:26 +0000</pubDate>
		<dc:creator>voidAndAny</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[plug computer]]></category>
		<category><![CDATA[configuration]]></category>
		<category><![CDATA[dockstar]]></category>

		<guid isPermaLink="false">http://voidandany.free.fr/?p=3453</guid>
		<description><![CDATA[Après avoir Installé Debian sur mon Dockstar j&#8217;entreprends d&#8217;installer divers outils et de faire un peu de paramétrage du système. On se connecte sur le Dockstar en ssh avec l&#8217;utilisateur root. &#160; Mise à jour du système Cela commence par &#8230; <a href="http://voidandany.free.fr/index.php/configuration-de-base-du-dockstar/">Continuer la lecture <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://voidandany.free.fr/wp-content/uploads/9909_04_1898-Old-tools-and-spanners_web.jpg"><img class="alignleft size-medium wp-image-3475" title="Old tools and spanners" src="http://voidandany.free.fr/wp-content/uploads/9909_04_1898-Old-tools-and-spanners_web-300x201.jpg" alt="" width="300" height="201" /></a>Après avoir <a title="Lien permanent vers Installer Debian sur le Seagate Dockstar" rel="bookmark" href="../index.php/installer-debian-sur-le-seagate-dockstar/">Installé Debian </a>sur mon<a title="Lien permanent vers Marques-pages : Un mini serveur le Seagate Dockstar" rel="bookmark" href="../index.php/marques-pages-un-mini-serveur-le-seagate-dockstar/"> Dockstar</a> j&#8217;entreprends d&#8217;installer divers outils et de faire un peu de paramétrage du système.</p>
<p>On se connecte sur le Dockstar en ssh avec l&#8217;utilisateur root.</p>
<p>&nbsp;</p>
<h2>Mise à jour du système</h2>
<p>Cela commence par la mise à jour des dépôt utilisé en éditant le fichier <strong>/etc/apt/sources.list</strong> (avec vi seul éditeur disponible sur la Debian fraichement installée du Dockstar).</p>
<p>J&#8217;ai donc ajouté les lignes suivantes :</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">## squeeze
deb http://ftp.fr.debian.org/debian/ squeeze main contrib non-free
deb-src http://ftp.fr.debian.org/debian/ squeeze main contrib non-free</pre></div></div>

<p>Sur certaines sources, les dépôts suivants sont aussi ajoutés, mais je n&#8217;en ai pas eu besoin pour l&#8217;instant.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">## squeeze multimedia
 deb http://www.debian-multimedia.org squeeze main non-free
 deb-src http://mirror.home-dn.net/debian-multimedia squeeze main
# squeeze security
 deb http://security.debian.org/ squeeze/updates main contrib non-free
 deb-src http://security.debian.org/ squeeze/updates main contrib non-free
# squeeze update
 deb http://ftp.fr.debian.org/debian/ squeeze-updates main contrib non-free
 deb-src http://ftp.fr.debian.org/debian/ squeeze-updates main contrib non-free</pre></div></div>

<p>Puis on lance la mise à 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
<span style="color: #c20cb9; font-weight: bold;">apt-get</span> upgrade</pre></div></div>

<p>Dans mon cas aucun paquet n&#8217;a été mis à jours</p>
<p>&nbsp;</p>
<h2>Changement du nom de la machine</h2>
<p>Par défaut suite à l&#8217;installation de Debian sur le Dockstar avec le script de Jeff Doozan, le nom du Dockstar est debian, pour le changer il faut modifier 2 fichiers :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>Nom<span style="color: #7a0874; font-weight: bold;">&#93;</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><span style="color: #c20cb9; font-weight: bold;">hostname</span>
<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>hostname.sh start</pre></div></div>

<p>Puis ajouter ce nom au fichier /etc/hosts (à éditer avec vi)</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">127.0.0.1       localhost
127.0.1.1       [Nom]</pre></div></div>

<p>Si vous ne faites pas cette dernière manipulation vous aurez le message d&#8217;erreur suivant dès que vous utiliserez sudo (que l&#8217;on va installer plus tard)</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">sudo: unable to resolve host [Nom]</pre></div></div>

<p>&nbsp;</p>
<h2>Ajout d&#8217;un utilisateur, installation de sudo et désactivation de root</h2>
<p>Étant un habitué d&#8217;Ubuntu j&#8217;ai souhaité reproduire la stratégie de ce dernier en terme d&#8217;utilisateur.</p>
<p>C&#8217;est à dire que l&#8217;utilisateur root est désactivé et que l&#8217;on réalise les taches d&#8217;administration avec un utilisateur classique en utilisant sudo.</p>
<p>Si on ne souhaite pas appliquer cette stratégie il est tout de même souhaitable de créer un nouvel utilisateur (non root) et de prendre l&#8217;habitude d&#8217;utiliser ce dernier le plus souvent possible (et de passer en root avec su que pour les taches le nécessitant).</p>
<h3>Ajout d&#8217;un utilisateur :</h3>
<p>Utilisation de la commande adduser :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">adduser <span style="color: #7a0874; font-weight: bold;">&#91;</span>utilisateur<span style="color: #7a0874; font-weight: bold;">&#93;</span></pre></div></div>

<p>On répond aux questions :</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">Adding user `[utilisateur]' ...
 Adding new group `[utilisateur]' (1000) ...
 Adding new user `[utilisateur]' (1000) with group `[utilisateur]' ...
 Creating home directory `/home/[utilisateur]' ...
 Copying files from `/etc/skel' ...
 Enter new UNIX password:
 Retype new UNIX password:
 passwd: password updated successfully
 Changing the user information for [utilisateur]
 Enter the new value, or press ENTER for the default
 Full Name []: [utilisateur]
 Room Number []:
 Work Phone []:
 Home Phone []:
 Other []:
 Is the information correct? [Y/n] Y</pre></div></div>

<h3>Installation et configuration de sudo</h3>

<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> <span style="color: #c20cb9; font-weight: bold;">sudo</span></pre></div></div>

<p>(1 seul paquet installé, 946Ko)</p>
<p>On configure ensuite l&#8217;utilisateur créé pour qu&#8217;il ait l&#8217;autorisation d&#8217;utiliser sudo :</p>

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

<p>On ajoute la ligne :</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">[utilisateur] ALL=(ALL) ALL</pre></div></div>

<h3>Test de l&#8217;utilisateur</h3>
<p>On va ensuite tester l&#8217;utilisateur créé (connexion SSH et sudo), on se déconnecte donc de SSH en root (commande exit) puis on se re-connecte avec l&#8217;utilisateur créé ([utilisateur]@[IP du Dockstar]).</p>
<p>Ensuite on essai de faire :</p>

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

<p>Ce qui devrait afficher :</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">We trust you have received the usual lecture from the local System
 Administrator. It usually boils down to these three things:
&nbsp;
#1) Respect the privacy of others.
#2) Think before you type.
#3) With great power comes great responsibility.
&nbsp;
[sudo] password for [utilisateur]:</pre></div></div>

<h3>Désactivation de root</h3>
<p>Cela se fait avec un simple :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">passwd</span> <span style="color: #660033;">-l</span> root</pre></div></div>

<p>Ce qui affiche :</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">passwd: password expiry information changed.</pre></div></div>

<p>&nbsp;</p>
<h2>Personnalisation du bash</h2>
<p>Cela se fait en modifiant le fichier .bashrc des utilisateurs, j&#8217;ai commencé une série d&#8217;<a href="http://voidandany.free.fr/index.php/tag/bashrc/">articles sur le bashrc</a> et je me rends compte que je ne l&#8217;ai jamais terminé (à faire), toujours est il que voici mon <a href="http://voidandany.free.fr/wp-content/uploads/bashrc.zip">bashrc</a> que j&#8217;ai légèrement adapté pour le Dockstar.</p>
<p>&nbsp;</p>
<h2>Installations complémentaires</h2>
<h3>Installation d&#8217;aptitude</h3>
<p>Depuis mon arrivé dans le monde Linux j&#8217;ai pris l&#8217;habitude d&#8217;utiliser aptitude plutôt que apt-get, je l&#8217;ai donc installé :</p>

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

<p>Rque : J&#8217;ai longtemps hésité avant de l&#8217;installer parcequ&#8217;il prend tout de même 16Mo</p>
<p>Rque 2 : sans rapport avec le Dockstar mais toujours bon à savoir, on peut mixer sans problème l&#8217;utilisation de apt-get et aptitude :</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">Since apt-get and aptitude share auto-installed package status
(see  Section 2.5.5, &quot;The package state for APT&quot;) after lenny,
you can mix  these tools without major troubles (see &lt;a href=&quot;http://bugs.debian.org/594490&quot;&gt;Bug #594490&lt;/a&gt;)</pre></div></div>

<p><a href="http://www.debian.org/doc/manuals/reference/ch02.en.html#_basic_package_management_operations">Source</a> paragraphe 2.2.2</p>
<h3>Outils divers</h3>

<div class="wp_syntax"><div class="code"><pre class="avisynth" style="font-family:monospace;">sudo aptitude install vim htop cron apt<span style="color:#006600; font-weight:bold;">-</span>utils dialog logrotate parted byobu unzip rsyslog man most  ncdu</pre></div></div>

<p><strong>vim :</strong> vim-tiny est installé par défaut mais il n&#8217;a pas la coloration syntaxique, on installe donc vim complet (27.6 Mo)</p>
<p>Activation de la coloration syntaxique en dé-commentant la ligne &laquo;&nbsp;syntax on&nbsp;&raquo; dans /etc/vim/vimrc</p>
<p><strong><a href="http://htop.sourceforge.net/">htop</a> : </strong>version semi-graphique de l&#8217;utilitaire top (197 ko)</p>
<p><strong>cron :</strong> planificateur de taches (344 ko)</p>
<p><strong>rsyslog </strong>: démon de logs, sans cela vous n&#8217;aurez pas tous les fichiers de log habituels sous /var/log (par exemple auth.log)</p>
<p><strong>logrotate </strong>: permet d&#8217;archiver et purger les fichiers de logs (﻿688 ko)</p>
<p><strong>parted </strong>: permet de prendre en compte les changement de partition sans rebooter (voir : <a title="Lien permanent vers Appliquer les changements de partition sans reboot" rel="bookmark" href="../index.php/appliquer-les-changements-de-partition-sans-reboot/">Appliquer les changements de partition sans reboot)</a></p>
<p><strong><a href="http://doc.ubuntu-fr.org/byobu">byobu</a></strong> : multiplexeur de terminaux, comme screen mais en mieux</p>
<p><strong>unzip</strong> : pour décompresser des archive zip</p>
<p><strong>ncdu</strong> : outil ncurse pour voir l&#8217;occupation disque (pratique pour savoir où sont partis les Gigas)</p>
<p><strong>man</strong> et <strong>most</strong> : pour avoir les pages d&#8217;aides</p>
<p><strong>apt-utils </strong>et<strong> dialog :</strong> permet de configurer les paquets lors de leur installation en mode semi-graphique (2.1Mo)</p>
<table border="0">
<tbody>
<tr>
<td>Sans</td>
<td>Avec</td>
</tr>
<tr>
<td><a href="http://voidandany.free.fr/wp-content/uploads/Terminal_008.png"><img title="Sans apt-utils" src="http://voidandany.free.fr/wp-content/uploads/Terminal_008-300x167.png" alt="" width="261" height="144" /></a></td>
<td><a href="http://voidandany.free.fr/wp-content/uploads/Terminal_007.png"><img title="Avec apt-utils" src="http://voidandany.free.fr/wp-content/uploads/Terminal_007-300x179.png" alt="" width="249" height="148" /></a></td>
</tr>
</tbody>
</table>
<p>Si on installe pas apt-utils à chaque installation (via aptitude ou apt-get) on a le message suivant :</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">debconf: la configuration des paquets est différée, car apt-utils n'est pas installé</pre></div></div>

<p>Et si on installe que apt-utils sans dialog on a le message :</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">debconf: Impossible d'initialiser l'interface : Dialog
debconf: (Aucun programme de type dialog n'est installé, l'interface  basée sur dialog ne peut donc pas être utilisée. at  /usr/share/perl5/Debconf/FrontEnd/Dialog.pm line 75, &amp;lt;&amp;gt; line 11.)
debconf: Utilisation de l'interface Readline en remplacement</pre></div></div>

<p>&nbsp;</p>
<h2>Configuration date/heure</h2>
<p>Par défaut suite à l&#8217;installation de Debian le dockstar est à l&#8217;heure UTC, on peut changer cela pour mettre à l&#8217;heure française :</p>
<p>Avant la configuration la commande date renvoi :</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">Sun Mar 13 21:30:46 UTC 2011</pre></div></div>

<p>On la reconfigure avec :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> dpkg-reconfigure tzdata</pre></div></div>

<p>Qui nous demande choisir notre zone (choix 8 puis 34 pour la France)</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">Configuring tzdata
 ------------------
&nbsp;
Please select the geographic area in which you live. Subsequent  configuration questions will narrow this down by presenting a list of
 cities, representing the time zones in which they are located.
&nbsp;
1. Africa   3. Antarctica  5. Arctic  7. Atlantic  9. Indian    11. SystemV  13. Etc
 2. America  4. Australia   6. Asia    8. Europe    10. Pacific  12. US
&nbsp;
Geographic area: 8
&nbsp;
Please select the city or region corresponding to your time zone.
&nbsp;
1. Amsterdam   9. Bucharest    17. Isle of Man  25. Luxembourg  33. Oslo        41. Sarajevo    49. Uzhgorod   57. Zaporozhye
 2. Andorra     10. Budapest    18. Istanbul     26. Madrid      34. Paris       42. Simferopol  50. Vaduz      58. Zurich
 3. Athens      11. Chisinau    19. Jersey       27. Malta       35. Podgorica   43. Skopje      51. Vatican
 4. Belfast     12. Copenhagen  20. Kaliningrad  28. Mariehamn   36. Prague      44. Sofia       52. Vienna
 5. Belgrade    13. Dublin      21. Kiev         29. Minsk       37. Riga        45. Stockholm   53. Vilnius
 6. Berlin      14. Gibraltar   22. Lisbon       30. Monaco      38. Rome        46. Tallinn     54. Volgograd
 7. Bratislava  15. Guernsey    23. Ljubljana    31. Moscow      39. Samara      47. Tirane      55. Warsaw
 8. Brussels    16. Helsinki    24. London       32. Nicosia     40. San Marino  48. Tiraspol    56. Zagreb
&nbsp;
Time zone: 34
&nbsp;
Current default time zone: 'Europe/Paris'
 Local time is now:      Sun Mar 13 22:38:40 CET 2011.
 Universal Time is now:  Sun Mar 13 21:38:40 UTC 2011.</pre></div></div>

<p>(configuration faite sans apt-utils/dialog)</p>
<p>La commande date renvoi alors :</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">Sun Mar 13 22:38:48 CET 2011</pre></div></div>

<p>&nbsp;</p>
<p>Autre configuration pour la date/heure la synchronisation avec un serveur de temps.</p>
<p>En effet le Dockstar ne contient pas de RTC (real Time Clock), c&#8217;est à dire un petit composant et une pile qui permettent que l&#8217;horloge garde l&#8217;heure même quand l&#8217;alimentation est coupée.</p>
<p>Pour les plus courageux (et surtout ceux qui ont une âme d&#8217;électroniciens) il est possible d&#8217;ajouter de circuit (voir <a href="http://www.pluc.fr/2011/02/seagate-dockstar-installation-et-amelioration/">Seagate dockstar installation et amélioration</a>).</p>
<p>Pour les autres le plus simple est d&#8217;installer un client NTP (<em>Network Time Protocol</em>) permettant de synchroniser le Dockstar avec un serveur de temps.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">aptitude</span> <span style="color: #c20cb9; font-weight: bold;">install</span> ntp</pre></div></div>

<p>(1311 ko)</p>
<p>Le configuration se fait ensuite dans le fichier /etc/ntp.conf en y ajoutant une ligne du type :</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># You do need to talk to an NTP server or two (or three).
 server 192.168.1.254</pre></div></div>

<p>Où 192.168.1.254 est un serveur de temps, chez moi c&#8217;est l&#8217;adresse de ma Freebox v6 qui fait serveur de temps.</p>
<p>&nbsp;</p>
<h2>Configuration des locales</h2>
<p>Les &#8216;locales&#8217; sont des fichiers qui vont modifier le comportement de certains programmes pour qu&#8217;ils s&#8217;adaptent aux &laquo;&nbsp;spécificités culturelles du pays&nbsp;&raquo; (ex : affichage de la date, affichage des symboles monétaires, etc)</p>
<p>Ces fonctions permettent, pour un caractère donné de dire si c&#8217;est une lettre, un chiffre, un blanc (espace, etc), un signe de ponctuation, une majuscule ou une minuscule&#8230;</p>
<p>(<a href="http://www.linux-france.org/article/sys/inslocal.html">source</a> définition)</p>
<p>Par défaut les locales sont initialisées à C (POSIX ?) et donc pour le système on est pas sur un système Français, on peut s&#8217;en assurer avec la commande locale :</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"> LANG=C
 LC_CTYPE=&quot;C&quot;
 LC_NUMERIC=&quot;C&quot;
 LC_TIME=&quot;C&quot;
 LC_COLLATE=&quot;C&quot;
 LC_MONETARY=&quot;C&quot;
 LC_MESSAGES=&quot;C&quot;
 LC_PAPER=&quot;C&quot;
 LC_NAME=&quot;C&quot;
 LC_ADDRESS=&quot;C&quot;
 LC_TELEPHONE=&quot;C&quot;
 LC_MEASUREMENT=&quot;C&quot;
 LC_IDENTIFICATION=&quot;C&quot;
 LC_ALL=</pre></div></div>

<p>Il faut tout d&#8217;abord installer le paquet fournissant les locales pour différents pays :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">aptitude</span> <span style="color: #c20cb9; font-weight: bold;">install</span> language-env</pre></div></div>

<p>(45.3 Mo)</p>
<p>Puis configurer les locales :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> dpkg-reconfigure locales</pre></div></div>

<p>Qui bous propose de choisir parmi une liste (réponses 208 et 2) :</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">Configuring locales
 -------------------
&nbsp;
Locales are a framework to switch between multiple languages and  allow users to use their language, country, characters, collation order,
 etc.
&nbsp;
Please choose which locales to generate. UTF-8 locales should be  chosen by default, particularly for new installations. Other character  sets
 may be useful for backwards compatibility with older systems and software.
&nbsp;
1. All locales                  109. en_AU ISO-8859-1               217. ga_IE.UTF-8 UTF-8          325. om_KE.UTF-8 UTF-8
 2. aa_DJ ISO-8859-1             110. en_AU.UTF-8 UTF-8              218. ga_IE@euro ISO-8859-15     326. or_IN UTF-8
 3. aa_DJ.UTF-8 UTF-8            111. en_BW ISO-8859-1               219. gd_GB ISO-8859-15          327. pa_IN UTF-8
&nbsp;
...
&nbsp;
(Enter the items you want to select, separated by spaces.)
&nbsp;
Locales to be generated: 208
&nbsp;
Many packages in Debian use locales to display text in the correct  language for the user. You can choose a default locale for the system
 from the generated locales.
&nbsp;
This will select the default language for the entire system. If this  system is a multi-user system where not all users are able to speak the
 default language, they will experience difficulties.
&nbsp;
1. None  2. fr_FR.UTF-8
&nbsp;
Default locale for the system environment: 2
&nbsp;
Generating locales (this might take a while)...
 fr_FR.UTF-8... done
 Generation complete.</pre></div></div>

<p>(configuration faite sans apt-utils/dialog)</p>
<p>Pour prendre en compte il suffit de déconnecter et se reconnecter et on vérifie avec la commande locale :</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"> LANG=fr_FR.UTF-8
 LC_CTYPE=&quot;fr_FR.UTF-8&quot;
 LC_NUMERIC=&quot;fr_FR.UTF-8&quot;
 LC_TIME=&quot;fr_FR.UTF-8&quot;
 LC_COLLATE=&quot;fr_FR.UTF-8&quot;
 LC_MONETARY=&quot;fr_FR.UTF-8&quot;
 LC_MESSAGES=&quot;fr_FR.UTF-8&quot;
 LC_PAPER=&quot;fr_FR.UTF-8&quot;
 LC_NAME=&quot;fr_FR.UTF-8&quot;
 LC_ADDRESS=&quot;fr_FR.UTF-8&quot;
 LC_TELEPHONE=&quot;fr_FR.UTF-8&quot;
 LC_MEASUREMENT=&quot;fr_FR.UTF-8&quot;
 LC_IDENTIFICATION=&quot;fr_FR.UTF-8&quot;
 LC_ALL=</pre></div></div>

<p>Et si on affiche la date, on est bien en France : date</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"> dimanche 13 mars 2011, 22:59:42 (UTC+0100)</pre></div></div>

<p>&nbsp;</p>
<h2>Désactivation IP v6</h2>
<p>A priori IP v6 est consommateur de ressource, or sur le Dockstar la RAM et la CPU sont précieuse&#8230;.</p>
<p>Pour s&#8217;assurer qu&#8217;IP v6 est activé :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #000000; font-weight: bold;">/</span>proc<span style="color: #000000; font-weight: bold;">/</span>net<span style="color: #000000; font-weight: bold;">/</span>if_inet6</pre></div></div>

<p>Donne quelque chose du genre :</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">00000000000000000000000000000001 01 80 10 80       lo
 fe80000000000000021075fffe1ad58c 02 40 20 80     eth0</pre></div></div>

<p>On le désactivera en ajoutant les ligne suivantes dans /etc/sysctl.conf :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># désactivation du support pour les interfaces actuelles</span>
 net.ipv6.conf.all.disable_ipv6 = <span style="color: #000000;">1</span>
 <span style="color: #666666; font-style: italic;"># désactivation du support de l’autoconfiguration</span>
 net.ipv6.conf.all.autoconf = <span style="color: #000000;">0</span>
 <span style="color: #666666; font-style: italic;"># désactivation du support par défaut pour les nouvelles interfaces</span>
 net.ipv6.conf.default.disable_ipv6 = <span style="color: #000000;">1</span>
 <span style="color: #666666; font-style: italic;"># et de l'autoconfiguration</span>
 net.ipv6.conf.default.autoconf = <span style="color: #000000;">0</span></pre></div></div>

<p>Prise en compte des changements :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> sysctl <span style="color: #660033;">-p</span>
 net.ipv6.conf.all.disable_ipv6 = <span style="color: #000000;">1</span>
 net.ipv6.conf.all.autoconf = <span style="color: #000000;">0</span>
 net.ipv6.conf.default.disable_ipv6 = <span style="color: #000000;">1</span>
 net.ipv6.conf.default.autoconf = <span style="color: #000000;">0</span></pre></div></div>

<p>La commande cat /proc/net/if_inet6 ne renvoi plus rien&#8230;</p>
<p>&nbsp;</p>
<p>Rque : après tout cela on se retrouve avec un système Debian fonctionnel prenant 600Mo</p>
<p><span style="text-decoration: underline;"><em><strong>Sources : </strong></em></span></p>
<div id="locationline">
<div id="interwiki"><a rel="nofollow" href="http://www.rudiswiki.de/wiki/FrontPage">rudiswiki8</a> &#8211; <a title="Cliquez ici pour faire une recherche de ce titre dans les pages" rel="nofollow" href="http://www.rudiswiki.de/wiki/DockStarDebian?action=fullsearch&amp;context=180&amp;value=linkto%3A%22DockStarDebian%22">DockStarDebian</a></div>
<ul id="pagelocation">
</ul>
</div>
<p><a href="http://mehl.co/archives/2011/02/18/new_article_posted_-_debian_on_the_pogoplug/index.html">This is a blog : Debian on the PogoPlug</a></p>
<p><a title="Permanent Link to Désactiver l’IPV6" rel="bookmark" href="http://www.admin-linux.fr/?p=3674">Désactiver l’IPV6</a></p>
]]></content:encoded>
			<wfw:commentRss>http://voidandany.free.fr/index.php/configuration-de-base-du-dockstar/feed/</wfw:commentRss>
		<slash:comments>29</slash:comments>
		</item>
		<item>
		<title>Installer et configurer Mysql sur le Dockstar</title>
		<link>http://voidandany.free.fr/index.php/installer-et-configurer-mysql-sur-le-dockstar/</link>
		<comments>http://voidandany.free.fr/index.php/installer-et-configurer-mysql-sur-le-dockstar/#comments</comments>
		<pubDate>Wed, 16 Mar 2011 17:41:35 +0000</pubDate>
		<dc:creator>voidAndAny</dc:creator>
				<category><![CDATA[Brèves]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[plug computer]]></category>
		<category><![CDATA[dockstar]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://voidandany.free.fr/?p=3468</guid>
		<description><![CDATA[Un des usages de mon Seagate Dockstar est de monter un serveur Web afin de mettre en ligne une galerie photo. La galerie photo que j&#8217;avais sélectionné était Zenphoto qui nécessite une base de données MySQL or j&#8217;ai trouvé un &#8230; <a href="http://voidandany.free.fr/index.php/installer-et-configurer-mysql-sur-le-dockstar/">Continuer la lecture <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Un des usages de mon <a title="Lien permanent vers Marques-pages : Un mini serveur le Seagate Dockstar" rel="bookmark" href="../index.php/marques-pages-un-mini-serveur-le-seagate-dockstar/">Seagate Dockstar</a> est de monter un serveur Web afin de mettre en ligne une galerie photo.</p>
<p>La galerie photo que j&#8217;avais sélectionné était <a href="http://www.zenphoto.org/"><em><em>Zenphoto</em></em></a> qui nécessite une base de données MySQL or j&#8217;ai trouvé un <a href="http://projets.kd2.org/p/fotoo-gallery/">nouveau script de galerie photo</a> plus léger / simple et qui ne nécessite &laquo;&nbsp;que&nbsp;&raquo; SQLite (beaucoup plus léger que MySQL).</p>
<p>Voici donc brièvement mes <strong>notes d&#8217;installation et de configuration de MySQL</strong> (pour ne pas les perdre)</p>
<p>J&#8217;ai déjà traité cette installation <a href="http://voidandany.free.fr/index.php/installation-dun-serveur-web-avec-lighttpd/">ici</a> et <a href="http://voidandany.free.fr/index.php/installation-dun-serveur-web-avec-cherokee/">ici</a> (pas sur le Dockstar)</p>
<p>&nbsp;</p>
<p>L&#8217;installation est simplissime :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">aptitude</span> <span style="color: #c20cb9; font-weight: bold;">install</span> mysql-server mysql-client</pre></div></div>

<p>Cela installe les paquets suivants :</p>
<p>libdbd-mysql-perl{a} libdbi-perl{a} libmysqlclient16{a} libnet-daemon-perl{a} libplrpc-perl{a} mysql-client mysql-client-5.1{a} mysql-common{a} mysql-server mysql-server-5.1{a} mysql-server-core-5.1{a} psmisc{a}</p>
<p>(54Mo sur le disque)</p>
<p>Lors de l&#8217;installation le mot de passe root est demandé :</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">Configuration de mysql-server-5.1
---------------------------------
Il est très fortement recommandé d'établir un mot de passe pour le compte d'administration de MySQL (« root »).
Si ce champ est laissé vide, le mot de passe ne sera pas changé.
Nouveau mot de passe du superutilisateur de MySQL :
Confirmation du mot de passe du superutilisateur de MySQL :</pre></div></div>

<p>&nbsp;</p>
<p>En l&#8217;état MySQL prend <strong>14.5% de la mémoire du Dockstar</strong> (pas léger l&#8217;animal), on trouvera <a href="http://chrisjohnston.org/2008/configuring-a-lightweight-apache-mysql-install-on-debian-ubuntu">ici</a> et <a href="http://brian.moonspot.net/2008/05/06/example-mycnf-files/">là</a> des <strong>optimisations </strong>pour MySQL, mais le plus simple est encore de prendre le fichier de configuration fournis par MySQL pour les petites machines :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">cp</span>  <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>mysql<span style="color: #000000; font-weight: bold;">/</span>my.cnf <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>mysql<span style="color: #000000; font-weight: bold;">/</span>my.cnf.orig
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">cp</span>  <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>doc<span style="color: #000000; font-weight: bold;">/</span>mysql-server-<span style="color: #000000;">5.1</span><span style="color: #000000; font-weight: bold;">/</span>examples<span style="color: #000000; font-weight: bold;">/</span>my-small.cnf <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>mysql<span style="color: #000000; font-weight: bold;">/</span>my.cnf
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>mysql restart</pre></div></div>

<p>&nbsp;</p>
<p>Avec cette configuration MySQL prend toujours <strong>12.8% de la mémoire</strong>, d&#8217;où mon exploration pour trouver une alternative à zenphoto pour ne pas avoir à installer ce glouton de MySQL</p>
]]></content:encoded>
			<wfw:commentRss>http://voidandany.free.fr/index.php/installer-et-configurer-mysql-sur-le-dockstar/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
