{"id":254,"date":"2018-06-17T13:48:44","date_gmt":"2018-06-17T12:48:44","guid":{"rendered":"http:\/\/sizious.com\/fr\/?p=254"},"modified":"2018-07-02T21:36:12","modified_gmt":"2018-07-02T20:36:12","slug":"preparer-le-raspberry-pi-en-mode-serveur","status":"publish","type":"post","link":"https:\/\/sizious.com\/fr\/2018\/06\/17\/preparer-le-raspberry-pi-en-mode-serveur\/","title":{"rendered":"Pr\u00e9parer le Raspberry Pi en mode serveur"},"content":{"rendered":"<p><span id=\"result_box\" class=\"\" lang=\"fr\"><span title=\"As you already know, the Raspberry Pi is a wonderful nano-computer with a lot of features.\">Comme vous le savez certainement d\u00e9j\u00e0, le <strong>Raspberry Pi<\/strong> est un merveilleux nano-ordinateur avec beaucoup de fonctionnalit\u00e9s. <\/span><span title=\"By default, the Raspbian OS is configured to be used as a desktop computer.\">Par d\u00e9faut, le syst\u00e8me d&rsquo;exploitation <strong>Raspbian<\/strong> est configur\u00e9 pour \u00eatre utilis\u00e9 comme un ordinateur de bureau. <\/span><span title=\"But it's better used like a server!\">Mais il vaut mieux l&rsquo;utiliser comme un serveur ! <\/span><span title=\"To do that, we need to perform some cleanup (i.e. removing useless packages) and add some additional packages to convert our Pi into a real server! \">Pour ce faire, nous devons effectuer un nettoyage (c&rsquo;est-\u00e0-dire supprimer des paquets inutiles) et ajouter quelques paquets suppl\u00e9mentaires pour convertir notre <strong>Pi<\/strong> en un vrai serveur !<\/span><\/span><\/p>\n<h2><span id=\"result_box\" class=\"\" lang=\"fr\"><span title=\"Setting a static IP \">D\u00e9finition d&rsquo;une adresse IP statique<\/span><\/span><\/h2>\n<p><span id=\"result_box\" class=\"\" lang=\"fr\"><span title=\"Before starting, you should have set a local static IP.\">Avant de commencer, vous devez avoir d\u00e9fini une adresse IP statique locale. <\/span><span title=\"Click here to learn how. \"><a href=\"http:\/\/sizious.com\/fr\/2015\/08\/28\/configurer-une-ip-fixe-sur-le-raspberry-pi-avec-raspbian-20150505\/\">Cliquez ici pour apprendre comment<\/a>.<\/span><\/span><\/p>\n<p><span title=\"If you have a dynamic IP address from your ISP, you should use No-IP or something similar in order to access the Pi from anywhere.\">Si vous avez une adresse IP dynamique de votre FAI, vous devez utiliser <a href=\"http:\/\/www.noip.com\/\" target=\"_blank\" rel=\"noopener\">No-IP<\/a> ou quelque chose de similaire afin d&rsquo;acc\u00e9der au <strong>Pi<\/strong> \u00e0 partir de n&rsquo;importe o\u00f9. <\/span><span title=\"Click here to learn how. \"><a href=\"http:\/\/sizious.com\/fr\/2017\/04\/30\/comment-installer-no-ip-dynamic-update-client-duc-sous-raspbian\/\">Cliquez ici pour apprendre comment<\/a>.<\/span><\/p>\n<h2><span id=\"result_box\" class=\"\" lang=\"fr\"><span title=\"Removing useless packages \">Suppression des paquets inutiles<\/span><\/span><\/h2>\n<p><span id=\"result_box\" class=\"\" lang=\"fr\"><span title=\"The commands below removes all desktop useless packages. \">Les commandes ci-dessous suppriment tous les paquets inutiles.<\/span><\/span><\/p>\n<pre class=\"lang:sh decode:true\">sudo apt-get remove --purge bluej claws-mail claws-mail-i18n geany geany-common greenfoot idle idle3 libreoffice libreoffice-core libreoffice-common libreoffice-style-galaxy minecraft-pi nodered nuscratch python-minecraftpi scratch sense-emu-tools sense-hat sonic-pi wolfram-engine\r\nrm -rf ~\/python_games\r\nsudo apt-get autoremove\r\nsudo reboot<\/pre>\n<p><span title=\"After that, we have a more lighter Raspbian OS. \">Apr\u00e8s cela, nous avons un <strong>Raspbian OS<\/strong> plus l\u00e9ger.<\/span><\/p>\n<h2><span title=\"Updating the Pi \">Mise \u00e0 jour du Pi<\/span><\/h2>\n<p><span title=\"Now it's time to update your Pi, to be sure you use the latest packages. \">Maintenant, il est temps de mettre \u00e0 jour votre <strong>Pi<\/strong>, pour \u00eatre s\u00fbr que vous utilisez les derniers paquets.<\/span><\/p>\n<p><span title=\"Enter the following: \">Entrez les commandes suivantes :<\/span><\/p>\n<pre class=\"lang:sh decode:true\">sudo apt-get update\r\nsudo apt-get upgrade -y<\/pre>\n<p><span title=\"If you want, you can upgrade the distribution if you have installed your Pi long time ago: \">Si vous le souhaitez, vous pouvez mettre \u00e0 niveau la distribution si vous avez install\u00e9 votre <strong>Pi<\/strong> il y a longtemps :<\/span><\/p>\n<pre class=\"lang:sh decode:true \">sudo apt-get dist-upgrade -y<\/pre>\n<p><span title=\"Then, you can update the Pi firmware too: \">Ensuite, vous pouvez \u00e9galement mettre \u00e0 jour le firmware du <strong>Pi <\/strong>:<\/span><\/p>\n<pre class=\"lang:sh decode:true \">sudo rpi-update<\/pre>\n<p><span title=\"Then to finish the update, your reboot the Pi: \">Ensuite, pour terminer la mise \u00e0 jour, red\u00e9marrez le <strong>Pi<\/strong> :<\/span><\/p>\n<pre class=\"lang:sh decode:true \">sudo reboot<\/pre>\n<h2><span title=\"Creating an update script \">Cr\u00e9er un script de mise \u00e0 jour<\/span><\/h2>\n<p><span title=\"It's a good idea to create a shell script to execute these commands regularly: \">C&rsquo;est une bonne id\u00e9e de cr\u00e9er un script shell pour ex\u00e9cuter toutes ces commandes r\u00e9guli\u00e8rement :<\/span><\/p>\n<pre class=\"lang:sh decode:true\">sudo mkdir \/opt\/scripts\/\r\nsudo nano \/opt\/scripts\/upgrade-pi<\/pre>\n<p><span title=\"The copy the following in that script: \">Copiez le contenu suivant dans le fichier ainsi cr\u00e9\u00e9 :<br \/>\n<\/span><\/p>\n<pre class=\"lang:sh decode:true\">#!\/usr\/bin\/env bash\r\n\r\napt-get update\r\napt-get upgrade -y\r\napt-get dist-upgrade -y\r\napt-get autoremove -y\r\n\r\nrpi-update\r\nreboot<\/pre>\n<p><span title=\"Then hit CTRL + X and Y to save. \">Puis appuyez sur <span class=\"lang:default decode:true crayon-inline \">CTRL + X<\/span>\u00a0 et <span class=\"lang:default decode:true crayon-inline \">Y<\/span>\u00a0 pour sauvegarder.<\/span><\/p>\n<p><span title=\"Make it executable: \">Rendez-le ex\u00e9cutable :<\/span><\/p>\n<pre class=\"lang:sh decode:true\">sudo chmod +x \/opt\/scripts\/upgrade-pi<\/pre>\n<p><span title=\"And now, you can execute it by : \">Et maintenant, vous pouvez l&rsquo;ex\u00e9cuter via :<br \/>\n<\/span><\/p>\n<pre class=\"lang:sh decode:true\">sudo \/opt\/scripts\/upgrade-pi<\/pre>\n<p><span title=\"Or you can use cron to execute it regularly automatically if you want, but I dislike this since I want to check the compatibility before doing anything! \">Ou bien alors vous pouvez utiliser <a href=\"https:\/\/fr.wikipedia.org\/wiki\/Cron\" target=\"_blank\" rel=\"noopener\">cron<\/a> pour l&rsquo;ex\u00e9cuter r\u00e9guli\u00e8rement automatiquement si vous le souhaitez, mais je n&rsquo;aime pas cela car je v\u00e9rifie toujours la compatibilit\u00e9 avant de faire quoi que ce soit !<\/span><\/p>\n<h2><span title=\"Installing xRDP (Optional) \">Installation de xRDP (facultatif)<\/span><\/h2>\n<p><span title=\"xRDP is a great package to access the Raspberry Pi throught RDP, which is the Microsoft's technology to use a computer remotely.\"><a href=\"http:\/\/www.xrdp.org\/\" target=\"_blank\" rel=\"noopener\">xRDP<\/a> est un excellent paquet pour acc\u00e9der au <strong>Raspberry Pi<\/strong> via <a href=\"https:\/\/fr.wikipedia.org\/wiki\/Remote_Desktop_Protocol\" target=\"_blank\" rel=\"noopener\">RDP<\/a>, qui est la technologie de <strong>Microsoft <\/strong>pour utiliser un ordinateur \u00e0 distance. <\/span><span title=\"Of course this is useful if your daily computer is Windows-based!\">Bien s\u00fbr, cela est utile si votre ordinateur quotidien est bas\u00e9 sur <strong>Windows <\/strong>! <\/span><span title=\"In that case, you should run the mstsc executable.\">Dans ce cas, vous devez utiliser l&rsquo;ex\u00e9cutable <span class=\"lang:default decode:true crayon-inline\">mstsc<\/span>. <\/span><span title=\"If you have an Unix system like Ubuntu or MacOS X, you can use Remmina (which is a RDP client) or just stick with SSH (which is enabled by default in Raspbian)! \">Si vous avez un syst\u00e8me <strong>Unix<\/strong> comme <strong>Ubuntu<\/strong> ou <strong>MacOS X<\/strong>, vous pouvez utiliser <a href=\"https:\/\/www.remmina.org\/\" target=\"_blank\" rel=\"noopener\">Remmina<\/a> (qui est un client <strong>RDP<\/strong> libre) ou simplement rester sous <strong>SSH<\/strong> (qui est activ\u00e9 par d\u00e9faut dans <strong>Raspbian<\/strong>) !<\/span><\/p>\n<p><span title=\"To install it, follow this guide, or follow the steps summarized below. \">Pour l&rsquo;installer, suivez ce guide ou suivez les \u00e9tapes r\u00e9sum\u00e9es ci-dessous.<\/span><\/p>\n<p><span title=\"The first thing to do is to disable the RealVNC client that comes installed with the latest Raspbian image because it causes some problems to xRDP. \">La premi\u00e8re chose \u00e0 faire est de d\u00e9sactiver le client <strong>RealVNC<\/strong> install\u00e9 avec la derni\u00e8re image <strong>Raspbian<\/strong> car cela cause des probl\u00e8mes \u00e0 <strong>xRDP<\/strong>.<\/span><\/p>\n<p><span title=\"Enter the following command: \">Entrez la commande suivante:<\/span><\/p>\n<pre class=\"lang:sh decode:true \">sudo raspi-config<\/pre>\n<p><span title=\"Choose the 5 Interfacing Options option, then P3 VNC .\">Choisissez l&rsquo;option <span class=\"lang:default decode:true crayon-inline \">5 Interfacing Options<\/span>\u00a0, puis <span class=\"lang:default decode:true crayon-inline\">P3 VNC<\/span>. <\/span><span title=\"Disable it when asked.\">D\u00e9sactiver lorsque demand\u00e9. <\/span><span title=\"After that, install the xRDP package: \">Apr\u00e8s cela, installez le paquet <strong>xRDP<\/strong>:<\/span><\/p>\n<pre class=\"lang:sh decode:true  \">sudo apt-get update\r\nsudo apt-get install xrdp\r\nsudo apt-get install vnc4server<\/pre>\n<p><span title=\"Finalize by solving the 'X' cursor problem: \">Finalisez l&rsquo;installation en r\u00e9solvant le probl\u00e8me du curseur &lsquo;X&rsquo; (qui reste en &lsquo;croix&rsquo; au lieu d&rsquo;afficher la fl\u00e8che) :<br \/>\n<\/span><\/p>\n<pre class=\"lang:sh decode:true\">cd ~\r\necho \"xsetroot -cursor_name left_ptr&amp;\" &gt; .xsessionrc\r\nchmod +x .xsessionrc<\/pre>\n<p><span title=\"Now your Raspberry Pi can be accessed by xRDP. \">Maintenant, votre <strong>Raspberry Pi<\/strong> peut \u00eatre utilis\u00e9 via <strong>xRDP<\/strong>.<\/span><\/p>\n<h2><span title=\"Done! \">Termin\u00e9 !<\/span><\/h2>\n<p><span title=\"So now you have a clean and ready Pi to be used as a server!\">Alors maintenant vous avez un <strong>Pi<\/strong> tout propre et pr\u00eat \u00e0 \u00eatre utilis\u00e9 comme un serveur ! <\/span><span title=\":)\">\ud83d\ude42<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Comme vous le savez certainement d\u00e9j\u00e0, le Raspberry Pi est un merveilleux nano-ordinateur avec beaucoup de fonctionnalit\u00e9s. Par d\u00e9faut, le syst\u00e8me d&rsquo;exploitation Raspbian est configur\u00e9 pour \u00eatre utilis\u00e9 comme un ordinateur de bureau. Mais il vaut mieux l&rsquo;utiliser comme un serveur ! Pour ce faire, nous devons effectuer un nettoyage (c&rsquo;est-\u00e0-dire supprimer des paquets inutiles)\u2026 <span class=\"read-more\"><a href=\"https:\/\/sizious.com\/fr\/2018\/06\/17\/preparer-le-raspberry-pi-en-mode-serveur\/\">Lire la suite &raquo;<\/a><\/span><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[6],"tags":[],"class_list":["post-254","post","type-post","status-publish","format-standard","hentry","category-raspberry-pi"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/sizious.com\/fr\/wp-json\/wp\/v2\/posts\/254","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sizious.com\/fr\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sizious.com\/fr\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sizious.com\/fr\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sizious.com\/fr\/wp-json\/wp\/v2\/comments?post=254"}],"version-history":[{"count":8,"href":"https:\/\/sizious.com\/fr\/wp-json\/wp\/v2\/posts\/254\/revisions"}],"predecessor-version":[{"id":274,"href":"https:\/\/sizious.com\/fr\/wp-json\/wp\/v2\/posts\/254\/revisions\/274"}],"wp:attachment":[{"href":"https:\/\/sizious.com\/fr\/wp-json\/wp\/v2\/media?parent=254"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sizious.com\/fr\/wp-json\/wp\/v2\/categories?post=254"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sizious.com\/fr\/wp-json\/wp\/v2\/tags?post=254"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}