nethserver_201_cahier_07_flectra
Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
nethserver_201_cahier_07_flectra [2019-09-23 02:26] – michelandre | nethserver_201_cahier_07_flectra [2025-01-12 19:30] (Version actuelle) – modification externe 127.0.0.1 | ||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
+ | \\ | ||
+ | [[cours_nethserver_101|{{ Images_Cahier-201-07-000.png? | ||
+ | \\ | ||
+ | |||
+ | ====== Description générale ====== | ||
+ | ===== Introduction ===== | ||
+ | |||
+ | Ce document décrit l' | ||
+ | |||
+ | ===== Connexion sécuritaire ===== | ||
+ | |||
+ | Ce document décrit aussi la marche à suivre pour une connexion sécuritaire // | ||
+ | |||
+ | ===== Le logiciel Flectra ===== | ||
+ | |||
+ | // | ||
+ | |||
+ | //Flectra// est un logiciel de gestion d' | ||
+ | |||
+ | Avec // | ||
+ | |||
+ | ==== Aperçu des avantages de Flectra ==== | ||
+ | |||
+ | Suite LIBRE d' | ||
+ | |||
+ | Les développeurs surveillent en permanence le logiciel pour vérifier si les modifications qu’ils ont apportées améliorent réellement les performances de celui-ci. Ceci signifie que //Flectra// est constamment sous surveillance | ||
+ | |||
+ | De la gestion du contenu du site Web à la gestion des campagnes marketing en passant par l’organisation des informations client, la gestion des commandes, la réalisation d’acquisitions commerciales, | ||
+ | |||
+ | ===== Étapes ===== | ||
+ | |||
+ | - Préparation de l' | ||
+ | - Installation du serveur de bases de données // | ||
+ | - Installation de la // | ||
+ | - Installation des prérequis pour // | ||
+ | - Téléchargement du code //Flectra// et installation. | ||
+ | - Redirection sécurisée. | ||
+ | - Post-scriptum // | ||
+ | - Sauvegarde/ | ||
+ | - Programmer un script de sauvegarde de la base de données // | ||
+ | - Sauvegarde quotidienne // | ||
+ | - Mises à jour de: // | ||
+ | |||
+ | {{Images_icone-201-003_Note.png? | ||
+ | |||
+ | ===== But de ce cahier ===== | ||
+ | |||
+ | Installer et configurer //Flectra// sur un //Serveur NethServer-7.6.1810// | ||
+ | |||
+ | {{ Images_Cahier-201-07-002.png? | ||
+ | |||
+ | ===== Cours NethServer-101 ===== | ||
+ | |||
+ | Le //Cours NethServer-101//, | ||
+ | |||
+ | - [[nethserver_101_cahier_01_linux|Cahier-01]]: | ||
+ | - [[nethserver_101_cahier_02_installations_configurations_logiciels_prerequis|Cahier-02]]: | ||
+ | - [[nethserver_101_cahier_03_creation_un_serveur_virtuel|Cahier-03]]: | ||
+ | - [[nethserver_101_cahier_04_local_certificat_let_encrypt|Cahier-04]]: | ||
+ | - [[nethserver_101_cahier_05_vdsl_fqdn_internet_et_nethserver|Cahier-05]]: | ||
+ | // | ||
+ | - [[nethserver_101_cahier_06_nethserver_wordPress|Cahier-06]]: | ||
+ | - [[nethserver_101_cahier_07_nethserver_wordPress_wordfence|Cahier-07]]: | ||
+ | - [[nethserver_101_cahier_08_woocommerce_paypal_stripe|Cahier-08]]: | ||
+ | - [[nethserver_101_cahier_09_duplicator_migration|Cahier-09]]: | ||
+ | - [[nethserver_101_cahier_10_mandataire_inverse|Cahier-10]]: | ||
+ | - [[nethserver_101_cahier_11_nethserver_backuppc|Cahier-11]]: | ||
+ | |||
+ | ==== Cours NethServer-201 ==== | ||
+ | |||
+ | Le //Cours NethServer-201// | ||
+ | |||
+ | - [[nethserver_201_cahier_01_nethserver_et_dolibarr|Cahier-201-01]]: | ||
+ | - [[nethserver_201_cahier_02_odoo_12|Cahier-201-02]]: | ||
+ | - [[nethserver_201_cahier_03_mediawiki|Cahier-201-03]]: | ||
+ | - [[nethserver_201_cahier_04_dokuwiki|Cahier-201-04]]: | ||
+ | - [[nethserver_201_cahier_05_moodle|Cahier-201-05]]: | ||
+ | - [[nethserver_201_cahier_06_proxmox|Cahier-201-06]]: | ||
+ | - [[nethserver_201_cahier_07_flectra|Cahier-201-07]]: | ||
+ | |||
+ | ==== Logiciels ==== | ||
+ | |||
+ | Tous les logiciels nécessaires sont du domaine public ou LIBRE sous licence //GPL//; ils ne coûtent pas un sou. Le seul achat nécessaire est l' | ||
+ | |||
+ | ==== But final ==== | ||
+ | |||
+ | Après avoir suivi le //Cours NethServer-101//, | ||
+ | |||
+ | {{ NS-101_001_Diagramme.png? | ||
+ | |||
+ | ===== Particularités de ce document ===== | ||
+ | |||
+ | ==== Notes au lecteur ==== | ||
+ | |||
+ | < | ||
+ | < | ||
+ | < | ||
+ | |||
+ | ==== Conventions ==== | ||
+ | |||
+ | {{Images_icone-201-001_doigt.png? | ||
+ | {{Images_icone-201-002_Lumiere.png? | ||
+ | {{Images_icone-201-003_Note.png? | ||
+ | {{Images_icone-201-004_Triangle.png? | ||
+ | {{Images_icone-201-005_Non-termine.png? | ||
+ | {{Images_icone-201-006_Securite.png? | ||
+ | |||
+ | Toutes les commandes à la console ou à travers //PuTTY// sont précédées d'une invite qui est toujours présente. | ||
+ | |||
+ | < | ||
+ | [root@dorgee ~]# ping 10.10.10.75 -c1 | ||
+ | |||
+ | PING 10.10.10.75 (10.10.10.75) 56(84) bytes of data. | ||
+ | 64 bytes from 10.10.10.75: | ||
+ | |||
+ | --- 10.10.10.75 ping statistics --- | ||
+ | 1 packets transmitted, | ||
+ | rtt min/ | ||
+ | [root@dorgee ~]# | ||
+ | </ | ||
+ | |||
+ | <WRAP box round> | ||
+ | < | ||
+ | Commande à exécuter si ce n'est déjà fait. | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | <WRAP box> | ||
+ | < | ||
+ | Commande indiquée à titre d' | ||
+ | </ | ||
+ | </ | ||
+ | \\ | ||
+ | |||
+ | ====== À savoir ====== | ||
+ | |||
+ | ===== Diagramme réseau ===== | ||
+ | |||
+ | {{ Images_Cahier-201-07-002.png? | ||
+ | |||
+ | ===== Serveur NethServer-7.6.1810 ===== | ||
+ | |||
+ | Le //Serveur NethServer-7.6.1810// | ||
+ | |||
+ | ==== dorgee.micronator.org ==== | ||
+ | |||
+ | Serveur // | ||
+ | Serveur //DHCP// pour tout le réseau LOCAL. | ||
+ | |||
+ | ==== tchana.micronator-dev.org ==== | ||
+ | |||
+ | Serveur virtuel sous // | ||
+ | |||
+ | ==== Répertoire d' | ||
+ | |||
+ | Nous installerons //Flectra// dans le répertoire ''/ | ||
+ | |||
+ | ===== Poste de travail ===== | ||
+ | |||
+ | // | ||
+ | |||
+ | ===== Éditeur de texte ===== | ||
+ | |||
+ | Ne modifiez pas les fichiers avec des éditeurs de documents tels // | ||
+ | |||
+ | ==== Notepad++ ==== | ||
+ | |||
+ | Voir le [[nethserver_101_cahier_02_installations_configurations_logiciels_prerequis|Cahier-02]]: | ||
+ | |||
+ | ==== Description ==== | ||
+ | |||
+ | // | ||
+ | // | ||
+ | |||
+ | //Site de téléchargement:// | ||
+ | |||
+ | ==== Documentation ==== | ||
+ | |||
+ | //Guide pratique// //(1er août 2013)//: [[http:// | ||
+ | // | ||
+ | |||
+ | ====== Préparation de l' | ||
+ | |||
+ | ===== Configuration du poste de travail ===== | ||
+ | |||
+ | Voir la section //À savoir// du | ||
+ | [[nethserver_101_cahier_03_creation_un_serveur_virtuel# | ||
+ | : //Création d'un Serveur NethServer virtuel// du "Cours NethServer-101" | ||
+ | |||
+ | <WRAP column 61%> | ||
+ | ==== Vérification ==== | ||
+ | |||
+ | **Centre Réseau et partage -> Modifier les paramètres de la carte ->** clac //(clic droit)// sur la carte Éthernet **-> Statut -> Détails**. | ||
+ | |||
+ | ● Nos deux adresses //IP// et nos deux passerelles son présentes. | ||
+ | |||
+ | ● **Fermer** toutes les fenêtre. | ||
+ | </ | ||
+ | <WRAP column 31%> | ||
+ | |{{ Images_Cahier-201-02-007.png? | ||
+ | </ | ||
+ | <WRAP clear></ | ||
+ | |||
+ | <WRAP column 46%> | ||
+ | '' | ||
+ | |||
+ | Les //CNAME// de notre //Serveur NethServer// | ||
+ | </ | ||
+ | <WRAP column 46%> | ||
+ | |{{ Images_Cahier-201-02-008.png? | ||
+ | </ | ||
+ | <WRAP clear></ | ||
+ | |||
+ | ===== Installation d'un Serveur NethServer ===== | ||
+ | |||
+ | Voir le [[nethserver_101_cahier_03_creation_un_serveur_virtuel|Cahier-03]]: | ||
+ | |||
+ | Pour un serveur virtuel de test, prendre un minimum de //8 Go// dynamiquement alloué __pour le disque principal__. | ||
+ | |||
+ | ==== Mise à jour du Serveur ==== | ||
+ | |||
+ | Avant de commencer quoi que ce soit, il est toujours préférable de mettre à jour le //Serveur NethServer// | ||
+ | |||
+ | ==== Fail2ban & ClamAV ==== | ||
+ | |||
+ | Il est fortement recommandé d' | ||
+ | |||
+ | ===== interface Web NethServer ===== | ||
+ | |||
+ | {{Images_icone-201-004_Triangle.png? | ||
+ | Depuis le poste de travail, sur le réseau LOCAL // | ||
+ | |||
+ | ==== Login ==== | ||
+ | |||
+ | Lorsque vous parvenez à l'// | ||
+ | |||
+ | {{Images_icone-201-004_Triangle.png? | ||
+ | |||
+ | <WRAP column 20%> | ||
+ | |{{ Images_Cahier-201-02-009.png? | ||
+ | </ | ||
+ | <WRAP column 72%> | ||
+ | |{{ Images_Cahier-201-02-010.png? | ||
+ | </ | ||
+ | <WRAP clear></ | ||
+ | |||
+ | Si vous avez de la difficulté à vous connecter, vidanger le cache //DNS// du poste de travail et celui du navigateur // | ||
+ | |||
+ | <WRAP column 55%> | ||
+ | < | ||
+ | < | ||
+ | |{{ Images_Cahier-201-02-011.png? | ||
+ | </ | ||
+ | <WRAP column 37%> | ||
+ | **Historique -> Supprimer l' | ||
+ | |{{ Images_Cahier-201-02-012.png? | ||
+ | </ | ||
+ | <WRAP clear></ | ||
+ | \\ | ||
+ | |||
+ | {{ Images_Cahier-201-02-013.png? | ||
+ | ==== Fournisseur des comptes ==== | ||
+ | |||
+ | **Configuration -> Fournisseur des comptes**. | ||
+ | |||
+ | **//LDAP local//** est notre fournisseur de comptes. | ||
+ | <WRAP clear></ | ||
+ | \\ | ||
+ | |||
+ | {{ Images_Cahier-201-07-004.png? | ||
+ | ==== FQDN du serveur ==== | ||
+ | |||
+ | **Configuration -> DNS ->** onglet **Hôtes**. | ||
+ | |||
+ | Le //FQDN// du serveur: // | ||
+ | \\ | ||
+ | \\ | ||
+ | |||
+ | {{ Images_Cahier-201-02-015.png? | ||
+ | ==== Nom du serveur ==== | ||
+ | |||
+ | **Configuration -> Nom du serveur**. | ||
+ | <WRAP clear></ | ||
+ | \\ | ||
+ | |||
+ | {{ Images_Cahier-201-02-016.png? | ||
+ | ==== Paramètres d' | ||
+ | |||
+ | **Sécurité -> SSH**. | ||
+ | <WRAP clear></ | ||
+ | \\ | ||
+ | |||
+ | {{ Images_Cahier-201-02-017.png? | ||
+ | ==== FTP ==== | ||
+ | |||
+ | **Configuration -> FTP ->** onglet **Configurer**. | ||
+ | |||
+ | {{Images_icone-201-001_doigt.png? | ||
+ | <WRAP clear></ | ||
+ | |||
+ | {{ Images_Cahier-201-02-018.png? | ||
+ | ==== Serveurs DNS ==== | ||
+ | |||
+ | **Configuration -> Réseau ->** onglet **Serveur DNS**. | ||
+ | |||
+ | Le serveur //DNS// secondaire peut être //8.8.8.8// ou // | ||
+ | <WRAP clear></ | ||
+ | \\ | ||
+ | |||
+ | ===== Ouverture d'une session PuTTY ===== | ||
+ | |||
+ | Les paramètres du serveur sont définis correctement et on peut utiliser //PuTTY// pour s'y loguer. | ||
+ | |||
+ | Voir //PuTTY// dans le | ||
+ | [[nethserver_101_cahier_02_installations_configurations_logiciels_prerequis# | ||
+ | : // | ||
+ | |||
+ | On se logue en tant que l' | ||
+ | |||
+ | < | ||
+ | login as: root | ||
+ | root@10.10.10.75' | ||
+ | Last login: Thu May 16 09:58:33 2019 from 10.10.10.81 | ||
+ | |||
+ | ************ Welcome to NethServer ************ | ||
+ | |||
+ | This is a NethServer installation. | ||
+ | |||
+ | Before editing configuration files, be aware | ||
+ | of the automatic events and templates system. | ||
+ | |||
+ | |||
+ | http:// | ||
+ | |||
+ | *********************************************** | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | ==== Adresse IP ==== | ||
+ | |||
+ | On vérifie les adresses //IP// du serveur. | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# ifconfig | ||
+ | |||
+ | enp0s3: flags=4163< | ||
+ | inet 10.10.10.75 | ||
+ | inet6 fe80:: | ||
+ | ether 08: | ||
+ | RX packets 680 bytes 63712 (62.2 KiB) | ||
+ | RX errors 0 dropped 0 overruns 0 frame 0 | ||
+ | TX packets 634 bytes 260579 (254.4 KiB) | ||
+ | TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 | ||
+ | |||
+ | enp0s8: flags=4163< | ||
+ | inet 192.168.1.75 | ||
+ | inet6 fe80:: | ||
+ | ether 08: | ||
+ | RX packets 27919 bytes 26181152 (24.9 MiB) | ||
+ | RX errors 0 dropped 0 overruns 0 frame 0 | ||
+ | TX packets 20591 bytes 5112156 (4.8 MiB) | ||
+ | TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 | ||
+ | |||
+ | lo: flags=73< | ||
+ | inet 127.0.0.1 | ||
+ | inet6 ::1 prefixlen 128 scopeid 0x10< | ||
+ | loop txqueuelen 1000 (Local Loopback) | ||
+ | RX packets 2534 bytes 309622 (302.3 KiB) | ||
+ | RX errors 0 dropped 0 overruns 0 frame 0 | ||
+ | TX packets 2534 bytes 309622 (302.3 KiB) | ||
+ | TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 | ||
+ | |||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | ==== Fail2ban ==== | ||
+ | |||
+ | On vérifie que le pare-feu // | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# rpm -qa | grep -i fail2ban | ||
+ | |||
+ | fail2ban-firewalld-0.9.7-1.el7.noarch | ||
+ | fail2ban-server-0.9.7-1.el7.noarch | ||
+ | fail2ban-0.9.7-1.el7.noarch | ||
+ | fail2ban-sendmail-0.9.7-1.el7.noarch | ||
+ | nethserver-fail2ban-1.1.6-1.ns7.noarch | ||
+ | fail2ban-shorewall-0.9.7-1.el7.noarch | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | On vérifie que // | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# ps aux | grep -i fail2ban | ||
+ | |||
+ | root 4586 1.2 0.5 1746708 22656 ? | ||
+ | root 7161 0.0 0.0 112728 | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | ==== ClamAV ==== | ||
+ | |||
+ | Par défaut //ClamAV// est installé, mais partiellement, | ||
+ | |||
+ | Dans le | ||
+ | [[nethserver_101_cahier_03_creation_un_serveur_virtuel# | ||
+ | : //Création d'un Serveur NethServer virtuel// du "Cours NethServer-101", | ||
+ | |||
+ | On vérifie que l' | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# rpm -qa | grep -i clamav | ||
+ | |||
+ | clamav-scanner-systemd-0.101.2-1.el7.x86_64 | ||
+ | clamav-lib-0.101.2-1.el7.x86_64 | ||
+ | clamav-server-systemd-0.101.2-1.el7.x86_64 | ||
+ | clamav-unofficial-sigs-5.6.2-7.el7.noarch | ||
+ | clamav-update-0.101.2-1.el7.x86_64 | ||
+ | clamav-0.101.2-1.el7.x86_64 | ||
+ | clamav-filesystem-0.101.2-1.el7.noarch | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | {{ Images_Cahier-201-02-019.png? | ||
+ | **Configuration -> Scanner Antivirus ->** onglet **Clamscan**. | ||
+ | |||
+ | //ClamAV// lancera un balayage complet du système à **// | ||
+ | <WRAP clear></ | ||
+ | \\ | ||
+ | |||
+ | ===== Utilisateurs ===== | ||
+ | |||
+ | {{ Images_Cahier-201-02-020.png? | ||
+ | ==== Utilisateur michelandre ==== | ||
+ | |||
+ | **Gestion -> Utilisateurs et groupes ->** onglet **Utilisateurs**. | ||
+ | |||
+ | L' | ||
+ | [[nethserver_101_cahier_03_creation_un_serveur_virtuel# | ||
+ | : //Création d'un Serveur NethServer virtuel// du "Cours NethServer-101" | ||
+ | \\ | ||
+ | \\ | ||
+ | |||
+ | ===== Collection PHP ===== | ||
+ | |||
+ | Version //PHP// actuelle pour notre //Serveur NethServer-7.6-1810// | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# php --version | ||
+ | |||
+ | PHP 5.4.16 (cli) (built: Oct 30 2018 19:30:51) | ||
+ | Copyright (c) 1997-2013 The PHP Group | ||
+ | Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | Comme on le voit, notre version //5.4.16// de //PHP// est légèrement vieillotte. | ||
+ | |||
+ | {{Images_icone-201-003_Note.png? | ||
+ | |||
+ | ==== Collections de logiciels ==== | ||
+ | |||
+ | {{Images_icone-201-001_doigt.png? | ||
+ | |||
+ | Tous les //RPM// des // | ||
+ | |||
+ | === PHP === | ||
+ | Le but de la // | ||
+ | |||
+ | ==== Prérequis pour l' | ||
+ | |||
+ | // | ||
+ | Il faut installer les référentiels //stephdl// et //remi// pour pouvoir installer la // | ||
+ | |||
+ | === Référentiel stephdl === | ||
+ | |||
+ | // | ||
+ | |||
+ | On vérifie si le référentiel //stephdl// est déjà installé. | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# rpm -qa | grep nethserver-stephdl | ||
+ | |||
+ | nethserver-stephdl-1.0.7-1.ns7.sdl.noarch | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | Si ce n'est déjà fait, on installe ce référentiel. | ||
+ | |||
+ | <WRAP box round> | ||
+ | < | ||
+ | [root@tchana ~]# yum install -y http:// | ||
+ | |||
+ | ... | ||
+ | Transaction Summary | ||
+ | ============================================================================================ | ||
+ | Install | ||
+ | |||
+ | Total size: 40 k | ||
+ | Installed size: 40 k | ||
+ | ... | ||
+ | Installed: | ||
+ | nethserver-stephdl.noarch 0: | ||
+ | |||
+ | Complete! | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | Vérification. | ||
+ | |||
+ | <WRAP box round> | ||
+ | < | ||
+ | [root@tchana ~]# rpm -qa | grep stephdl | ||
+ | |||
+ | nethserver-stephdl-1.0.7-1.ns7.sdl.noarch | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | === Référentiel remi === | ||
+ | |||
+ | On vérifie si le référentiel //remi// est déjà installé. | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# rpm -qa | grep remi | ||
+ | |||
+ | remi-release-7.6-2.el7.remi.noarch | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | Si ce n'est déjà fait, on installe ce référentiel. | ||
+ | |||
+ | <WRAP box round> | ||
+ | < | ||
+ | [root@tchana ~]# yum install -y http:// | ||
+ | |||
+ | ... | ||
+ | Transaction Summary | ||
+ | ============================================================================================ | ||
+ | Install | ||
+ | |||
+ | Total size: 19 k | ||
+ | Installed size: 19 k | ||
+ | ... | ||
+ | Installed: | ||
+ | remi-release.noarch 0: | ||
+ | |||
+ | Complete! | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | On vérifie. | ||
+ | |||
+ | <WRAP box round> | ||
+ | < | ||
+ | [root@tchana ~]# rpm -qa | grep remi | ||
+ | |||
+ | remi-release-7.6-2.el7.remi.noarch | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | ==== Installation de la Collection PHP ==== | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# yum install -y nethserver-php-scl --enablerepo=stephdl | ||
+ | |||
+ | ... | ||
+ | Résumé de la transaction | ||
+ | ============================================================================================ | ||
+ | Installation | ||
+ | |||
+ | Taille totale des téléchargements : 47 M | ||
+ | Taille d' | ||
+ | ... | ||
+ | Installation : scl-utils-20130529-19.el7.x86_64 | ||
+ | ... | ||
+ | Installation : nethserver-php-scl-1.2.6-1.ns7.sdl.x86_64 | ||
+ | ... | ||
+ | Vérification : php72-php-xml-7.2.21-1.el7.remi.x86_64 | ||
+ | ... | ||
+ | Vérification : php73-php-json-7.3.8-1.el7.remi.x86_64 | ||
+ | |||
+ | Installé : | ||
+ | nethserver-php-scl.x86_64 0: | ||
+ | |||
+ | Dépendances installées : | ||
+ | enchant.x86_64 1: | ||
+ | ... | ||
+ | tcl.x86_64 1: | ||
+ | |||
+ | Terminé ! | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | ==== Usage ==== | ||
+ | |||
+ | Normalement, | ||
+ | |||
+ | Les réglages sont répartis à deux endroits. | ||
+ | |||
+ | - À la page **Gestion -> Hôtes virtuels**.\\ | ||
+ | Là, après avoir créé un hôte virtuel, vous pouvez choisir la version que vous utiliserez pour l'// | ||
+ | - À la page **Configuration -> Paramètres PHP**.\\ Là, vous pouvez choisir la version //PHP// que vous souhaitez utiliser __pour l’ensemble du serveur__.\\ - Lorsqu'// | ||
+ | \\ | ||
+ | |||
+ | ==== Répertoire d' | ||
+ | |||
+ | {{Images_icone-201-003_Note.png? | ||
+ | |||
+ | On vérifie la présence du référentiel // | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# yum repolist | grep remi | ||
+ | |||
+ | * remi-safe: mirror.team-cymru.com | ||
+ | remi-safe | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | On vérifie le répertoire ''/ | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# ls -ls /opt | ||
+ | |||
+ | total 0 | ||
+ | 0 drwxr-xr-x. 7 root root 81 Jan 4 09:16 puppetlabs | ||
+ | 0 drwxr-xr-x | ||
+ | 0 drwxr-xr-x | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | On affiche le répertoire ''/ | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# ls -ls /opt/remi | ||
+ | |||
+ | total 0 | ||
+ | 0 dr-xr-xr-x 3 root root 32 17 août 21:00 php56 | ||
+ | 0 dr-xr-xr-x 3 root root 32 17 août 21:00 php70 | ||
+ | 0 dr-xr-xr-x 3 root root 32 17 août 21:00 php71 | ||
+ | 0 dr-xr-xr-x 3 root root 32 17 août 21:00 php72 | ||
+ | 0 dr-xr-xr-x 3 root root 32 17 août 21:00 php73 | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | ==== PHP72 par défaut après une connexion à la ligne de commande ==== | ||
+ | |||
+ | // | ||
+ | |||
+ | On crée le fichier d' | ||
+ | {{Images_icone-201-004_Triangle.png? | ||
+ | |||
+ | < | ||
+ | cat > / | ||
+ | #!/bin/bash | ||
+ | source / | ||
+ | if [[ " | ||
+ | src=" | ||
+ | pkgs=(${src// | ||
+ | uniq=($(printf " | ||
+ | export X_SCLS=" | ||
+ | fi | ||
+ | EOT | ||
+ | |||
+ | |||
+ | </ | ||
+ | |||
+ | On rend le fichier exécutable. | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# chmod +x / | ||
+ | |||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | On vérifie. | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# ls -als / | ||
+ | |||
+ | 4 -rwxr-xr-x 1 root root 215 17 août 21:05 / | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | === Vérification si PHP72 est le défaut=== | ||
+ | |||
+ | {{Images_icone-201-004_Triangle.png? | ||
+ | |||
+ | On vérifie l' | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# rpm -qa | grep scl- | ||
+ | |||
+ | scl-utils-20130529-19.el7.x86_64 | ||
+ | nethserver-php-scl-1.2.6-1.ns7.sdl.x86_64 | ||
+ | centos-release-scl-rh-2-3.el7.centos.noarch | ||
+ | centos-release-scl-2-3.el7.centos.noarch | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | // | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# scl -l | ||
+ | |||
+ | php56 | ||
+ | php70 | ||
+ | php71 | ||
+ | php72 | ||
+ | php73 | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | Quel est le //PHP// par défaut? | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# which php | ||
+ | |||
+ | / | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | Quelle est sa version? | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# php --version | ||
+ | |||
+ | PHP 7.2.21 (cli) (built: Jul 30 2019 14:10:18) ( NTS ) | ||
+ | Copyright (c) 1997-2018 The PHP Group | ||
+ | Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies | ||
+ | with Zend OPcache v7.2.21, Copyright (c) 1999-2018, by Zend Technologies | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | Notre fichier '' | ||
+ | \\ | ||
+ | |||
+ | === Sauvegarde du fichier d' | ||
+ | |||
+ | On vérifie si le nom du fichier ''/ | ||
+ | |||
+ | {{Images_icone-201-004_Triangle.png? | ||
+ | |||
+ | < | ||
+ | NouvelleInclusion="/ | ||
+ | if grep -Fxq " | ||
+ | then | ||
+ | # L' | ||
+ | echo -e "\nLe fichier custom.include contient déjà l' | ||
+ | else | ||
+ | # L' | ||
+ | echo -e " | ||
+ | echo -e " | ||
+ | fi | ||
+ | |||
+ | |||
+ | </ | ||
+ | |||
+ | On vérifie. | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# cat / | ||
+ | |||
+ | / | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | Ci-dessus, il n'y a pas de ligne vide avant __/ | ||
+ | \\ | ||
+ | |||
+ | ==== Mise à jour de la Collection ==== | ||
+ | |||
+ | // | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# yum update -y nethserver-php-scl --enablerepo=stephdl | ||
+ | |||
+ | Loaded plugins: changelog, fastestmirror, | ||
+ | Loading mirror speeds from cached hostfile | ||
+ | * ce-base: it.centos.contactlab.it | ||
+ | * ce-extras: it.centos.contactlab.it | ||
+ | * ce-updates: it.centos.contactlab.it | ||
+ | * epel: epel.mirror.constant.com | ||
+ | * nethforge: mirror.nethserver.org | ||
+ | * nethserver-base: | ||
+ | * nethserver-updates: | ||
+ | * remi-safe: rpms.remirepo.net | ||
+ | No packages marked for update | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | {{Images_icone-201-004_Triangle.png? | ||
+ | {{Images_icone-201-003_Note.png? | ||
+ | \\ | ||
+ | |||
+ | ==== Ajustement des paramètres PHP ==== | ||
+ | |||
+ | Les valeurs de certains paramètres de //PHP// ne sont pas suffisants pour certains ajouts. Ces paramètres sont: **'' | ||
+ | |||
+ | Affichage des paramètres par défaut. | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# config show php72 | ||
+ | |||
+ | php72=configuration | ||
+ | AllowUrlFopen=On | ||
+ | ExposePhp=0 | ||
+ | MaxExecutionTime=30 | ||
+ | MaxFileUpload=20 | ||
+ | MaxInputTime=60 | ||
+ | MemoryLimit=128 | ||
+ | PostMaxSize=20 | ||
+ | UploadMaxFilesize=10 | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | {{Images_icone-201-001_doigt.png? | ||
+ | \\ | ||
+ | |||
+ | Ci-dessous, le caractère <wrap em>></ | ||
+ | {{Images_icone-201-004_Triangle.png? | ||
+ | \\ | ||
+ | |||
+ | === MemoryLimit === | ||
+ | |||
+ | Chaque fois qu'un client fait une requête au serveur Web, //PHP// génère un processus //PHP//. Le travail de ce processus est de générer du code HTML qu'il envoie au client. Le processus fournit un temps d' | ||
+ | |||
+ | === PostMaxSize === | ||
+ | |||
+ | Le paramètre '' | ||
+ | |||
+ | <WRAP column 30%> | ||
+ | === UploadMaxFilesize === | ||
+ | |||
+ | Pour certaines extensions telles qu' | ||
+ | La limite ci-contre, __est celle de WordPress__. | ||
+ | </ | ||
+ | <WRAP column 60%> | ||
+ | |{{ Images_Cahier-201-02-200.png? | ||
+ | </ | ||
+ | <WRAP clear></ | ||
+ | |||
+ | <WRAP column 30%> | ||
+ | |||
+ | === Version PHP par défaut === | ||
+ | |||
+ | On définit la version //PHP// par défaut pour //Apache//. | ||
+ | |||
+ | **Configuration -> Paramètres PHP ->** onglet **Version PHP Apache ->** cliquer | ||
+ | </ | ||
+ | <WRAP column 60%> | ||
+ | |{{ Images_Cahier-201-02-201.png? | ||
+ | </ | ||
+ | <WRAP clear></ | ||
+ | \\ | ||
+ | |||
+ | <WRAP column 30%> | ||
+ | === Ajustements des paramètres de la version PHP-7.2 === | ||
+ | |||
+ | Onglet **Php V7.2 SCL**\\ | ||
+ | Ajuster tel que ci-contre //(250M - 100M - 75M)// | ||
+ | **-> SOUMETTRE**. | ||
+ | |||
+ | {{Images_icone-201-006_Securite.png? | ||
+ | </ | ||
+ | <WRAP column 60%> | ||
+ | |{{ Images_Cahier-201-02-202.png? | ||
+ | </ | ||
+ | <WRAP clear></ | ||
+ | \\ | ||
+ | |||
+ | <WRAP column 30%> | ||
+ | Onglet **Version par défaut de PHP**\\ | ||
+ | Ajuster tel que ci-contre //(250M - 75M - 75M)// | ||
+ | **-> SOUMETTRE**.\\ | ||
+ | |||
+ | {{Images_icone-201-006_Securite.png? | ||
+ | </ | ||
+ | <WRAP column 60%> | ||
+ | |{{ Images_Cahier-201-02-203.png? | ||
+ | </ | ||
+ | <WRAP clear></ | ||
+ | |||
+ | === Vérifications à la ligne de commande === | ||
+ | |||
+ | == MemoryLimit == | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# cat / | ||
+ | |||
+ | memory_limit | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | == PostMaxSize == | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# cat / | ||
+ | |||
+ | post_max_size | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | == UploadMaxFilesize == | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# cat / | ||
+ | |||
+ | upload_max_filesize | ||
+ | </ | ||
+ | |||
+ | {{Images_icone-201-004_Triangle.png? | ||
+ | \\ | ||
+ | |||
+ | On vérifie la configuration de // | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# config show php72 | ||
+ | |||
+ | php72=configuration | ||
+ | AllowUrlFopen=Off | ||
+ | ExposePhp=0 | ||
+ | MaxExecutionTime=30 | ||
+ | MaxFileUpload=20 | ||
+ | MaxInputTime=60 | ||
+ | MemoryLimit=250 | ||
+ | PostMaxSize=100 | ||
+ | UploadMaxFilesize=75 | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | ===== Instantané VirtualBox ===== | ||
+ | |||
+ | {{Images_Cahier-101-03-004.png? | ||
+ | |||
+ | ====== PostgreSQL-11 - Installation ====== | ||
+ | |||
+ | ===== Invite de commandes NethServer ===== | ||
+ | |||
+ | {{Images_icone-201-003_Note.png? | ||
+ | |||
+ | Si nous ne sommes pas déjà logué, nous nous connectons en tant que **__root__** au //Serveur NethServer// | ||
+ | |||
+ | <WRAP box round> | ||
+ | < | ||
+ | login as: root | ||
+ | root@10.10.10.75' | ||
+ | Last login: Fri May 10 17:11:57 2019 from 10.10.10.81 | ||
+ | |||
+ | ************ Welcome to NethServer ************ | ||
+ | |||
+ | This is a NethServer installation. | ||
+ | |||
+ | Before editing configuration files, be aware | ||
+ | of the automatic events and templates system. | ||
+ | |||
+ | |||
+ | http:// | ||
+ | |||
+ | *********************************************** | ||
+ | [root@tchana ~] | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | On affiche les adresses //IP// du serveur. | ||
+ | |||
+ | < | ||
+ | [root@tchana html]# ifconfig | ||
+ | |||
+ | enp0s3: flags=4163< | ||
+ | inet 10.10.10.75 | ||
+ | inet6 fe80:: | ||
+ | ether 08: | ||
+ | RX packets 664 bytes 74068 (72.3 KiB) | ||
+ | RX errors 0 dropped 0 overruns 0 frame 0 | ||
+ | TX packets 615 bytes 289665 (282.8 KiB) | ||
+ | TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 | ||
+ | |||
+ | enp0s8: flags=4163< | ||
+ | inet 192.168.1.75 | ||
+ | inet6 fe80:: | ||
+ | ether 08: | ||
+ | RX packets 144384 | ||
+ | RX errors 0 dropped 0 overruns 0 frame 0 | ||
+ | TX packets 83977 bytes 7402753 (7.0 MiB) | ||
+ | TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 | ||
+ | |||
+ | lo: flags=73< | ||
+ | inet 127.0.0.1 | ||
+ | inet6 ::1 prefixlen 128 scopeid 0x10< | ||
+ | loop txqueuelen 1000 (Local Loopback) | ||
+ | RX packets 3178 bytes 378438 (369.5 KiB) | ||
+ | RX errors 0 dropped 0 overruns 0 frame 0 | ||
+ | TX packets 3178 bytes 378438 (369.5 KiB) | ||
+ | TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | ===== Référentiel pgdg11 ===== | ||
+ | |||
+ | ==== 32 ou 64 bits ==== | ||
+ | |||
+ | Il nous faut connaître le genre de //CPU// utilisé par notre serveur afin de choisir la bonne version de // | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# uname -p | ||
+ | |||
+ | x86_64 | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | ==== Version CentOS ==== | ||
+ | |||
+ | Pour connaître la version //CentOS// dont notre serveur est issu. | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# cat / | ||
+ | |||
+ | CentOS Linux release 7.6.1810 (Core) | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | <WRAP column 45%> | ||
+ | ==== Lien du référentiel PostgreSQL ==== | ||
+ | |||
+ | Pour connaître le lien //URL// du référentiel // | ||
+ | |||
+ | {{Images_icone-201-003_Note.png? | ||
+ | |||
+ | Notre //Serveur NethServer// | ||
+ | |||
+ | On claque sur **CentOS 7 - x86 64** et on copie l' | ||
+ | |||
+ | Le lien du référentiel // | ||
+ | https:// | ||
+ | </ | ||
+ | <WRAP column 45%> | ||
+ | |{{ Images_Cahier-201-02-025.png? | ||
+ | </ | ||
+ | <WRAP clear></ | ||
+ | |||
+ | ==== Installation du référentiel ==== | ||
+ | |||
+ | La commande pour installer le référentiel // | ||
+ | |||
+ | - '' | ||
+ | - l'URL du référentiel. | ||
+ | |||
+ | On installe le référentiel // | ||
+ | |||
+ | On entre '' | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# yum install -y https:// | ||
+ | |||
+ | Modules complémentaires chargés : changelog, fastestmirror, | ||
+ | pgdg-redhat-repo-latest.noarch.rpm | ||
+ | Examen de / | ||
+ | Sélection de / | ||
+ | Résolution des dépendances | ||
+ | --> Lancement de la transaction de test | ||
+ | ---> Le paquet pgdg-redhat-repo.noarch 0:42.0-4 sera installé | ||
+ | --> Résolution des dépendances terminée | ||
+ | |||
+ | Dépendances résolues | ||
+ | |||
+ | ============================================================================================ | ||
+ | | ||
+ | | ||
+ | ============================================================================================ | ||
+ | Installation : | ||
+ | | ||
+ | |||
+ | Résumé de la transaction | ||
+ | ============================================================================================ | ||
+ | Installation | ||
+ | |||
+ | Taille totale | ||
+ | Taille d' | ||
+ | Downloading packages: | ||
+ | Running transaction check | ||
+ | Running transaction test | ||
+ | Transaction test succeeded | ||
+ | Running transaction | ||
+ | Installation : pgdg-redhat-repo-42.0-4.noarch | ||
+ | Vérification : pgdg-redhat-repo-42.0-4.noarch | ||
+ | |||
+ | Installé : | ||
+ | pgdg-redhat-repo.noarch 0:42.0-4 | ||
+ | |||
+ | Terminé ! | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | Le référentiel // | ||
+ | |||
+ | ===== Installation ===== | ||
+ | |||
+ | Maintenant, on peut procéder à l' | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# yum install -y --enablerepo=pgdg11 | ||
+ | postgresql11 | ||
+ | postgresql11-server | ||
+ | postgresql11-devel | ||
+ | postgresql11-test | ||
+ | |||
+ | ... | ||
+ | Install | ||
+ | |||
+ | Total download size: 23 M | ||
+ | Installed size: 89 M | ||
+ | |||
+ | ... | ||
+ | Installed: | ||
+ | postgresql11.x86_64 0: | ||
+ | postgresql11-contrib.x86_64 0: | ||
+ | postgresql11-devel.x86_64 0: | ||
+ | postgresql11-docs.x86_64 0: | ||
+ | postgresql11-libs.x86_64 0: | ||
+ | postgresql11-server.x86_64 0: | ||
+ | postgresql11-test.x86_64 0: | ||
+ | |||
+ | Dependency Installed: | ||
+ | libicu-devel.x86_64 0: | ||
+ | |||
+ | Complete! | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | On vérifie l' | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# rpm -qi postgresql11-server | ||
+ | |||
+ | Name : postgresql11-server | ||
+ | Version | ||
+ | Release | ||
+ | Architecture: | ||
+ | Install Date: jeu. 16 mai 2019 17:27:20 EDT | ||
+ | Group : Applications/ | ||
+ | Size : 19562871 | ||
+ | License | ||
+ | Signature | ||
+ | Source RPM : postgresql11-11.3-1PGDG.rhel7.src.rpm | ||
+ | Build Date : mer. 08 mai 2019 05:37:39 EDT | ||
+ | Build Host : koji-centos7-x86-64-pgbuild | ||
+ | Relocations : (not relocatable) | ||
+ | Vendor | ||
+ | URL : https:// | ||
+ | Summary | ||
+ | Description : | ||
+ | PostgreSQL is an advanced Object-Relational database management system (DBMS). | ||
+ | The postgresql11-server package contains the programs needed to create | ||
+ | and run a PostgreSQL server, which will in turn allow you to create | ||
+ | and maintain PostgreSQL databases. | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | ===== Protection du référentiel ===== | ||
+ | |||
+ | // | ||
+ | // | ||
+ | |||
+ | Nous voulons protéger le référentiel **[pgdg11]** afin que ses paquets ne soient pas mis à jour par aucun autre référentiel. | ||
+ | |||
+ | On installe le paquet '' | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# yum install -y yum-plugin-protectbase | ||
+ | |||
+ | ... | ||
+ | Résumé de la transaction | ||
+ | ============================================================================================ | ||
+ | Installation | ||
+ | |||
+ | Taille totale des téléchargements : 27 k | ||
+ | Taille d' | ||
+ | ... | ||
+ | Installé : | ||
+ | yum-plugin-protectbase.noarch 0: | ||
+ | |||
+ | Terminé ! | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | On affiche les informations du paquet '' | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# rpm -qi yum-plugin-protectbase | ||
+ | |||
+ | Name : yum-plugin-protectbase | ||
+ | Version | ||
+ | Release | ||
+ | Architecture: | ||
+ | Install Date: jeu. 16 mai 2019 23:15:00 EDT | ||
+ | Group : System Environment/ | ||
+ | Size : 22696 | ||
+ | License | ||
+ | Signature | ||
+ | Source RPM : yum-utils-1.1.31-50.el7.src.rpm | ||
+ | Build Date : mar. 30 oct. 2018 18:58:13 EDT | ||
+ | Build Host : x86-01.bsys.centos.org | ||
+ | Relocations : (not relocatable) | ||
+ | Packager | ||
+ | Vendor | ||
+ | URL : http:// | ||
+ | Summary | ||
+ | Description : | ||
+ | This plugin allows certain repositories to be protected. Packages in the | ||
+ | protected repositories can't be overridden by packages in non-protected | ||
+ | repositories even if the non-protected repo has a later version. | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | On s' | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# cat / | ||
+ | |||
+ | [main] | ||
+ | enabled = 1 | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | ==== Protection de pgdg11 ==== | ||
+ | |||
+ | On protège le référentiel // | ||
+ | |||
+ | < | ||
+ | ... | ||
+ | [pgdg11] | ||
+ | name=PostgreSQL 11 $releasever - $basearch | ||
+ | baseurl=https:// | ||
+ | enabled=1 | ||
+ | gpgcheck=1 | ||
+ | gpgkey=file:/// | ||
+ | protect = 1 | ||
+ | |||
+ | ... | ||
+ | </ | ||
+ | |||
+ | {{Images_icone-201-003_Note.png? | ||
+ | On vérifie. | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# cat / | ||
+ | |||
+ | 10-[pgdg11] | ||
+ | 11-name=PostgreSQL 11 $releasever - $basearch | ||
+ | 12-baseurl=https:// | ||
+ | 13-enabled=1 | ||
+ | 14-gpgcheck=1 | ||
+ | 15-gpgkey=file:/// | ||
+ | 16:protect = 1 | ||
+ | 17- | ||
+ | 18-[pgdg10] | ||
+ | 19-name=PostgreSQL 10 $releasever - $basearch | ||
+ | 20-baseurl=https:// | ||
+ | 21-enabled=1 | ||
+ | 22-gpgcheck=1 | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | ===== Initialisation de la BD ===== | ||
+ | |||
+ | On initialise la // | ||
+ | {{Images_icone-201-004_Triangle.png? | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# / | ||
+ | |||
+ | Initializing database ... OK | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | ===== Activation du service PostgreSQL ===== | ||
+ | |||
+ | On active le service pour qu'il démarre avec l' | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# systemctl enable postgresql-11.service | ||
+ | |||
+ | Created symlink from / | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | On démarre le service // | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# systemctl start postgresql-11.service | ||
+ | |||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | On examine le statut du service // | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# systemctl status postgresql-11.service | ||
+ | |||
+ | ● postgresql-11.service - PostgreSQL 11 database server | ||
+ | | ||
+ | | ||
+ | Docs: https:// | ||
+ | Process: 5709 ExecStartPre=/ | ||
+ | Main PID: 5715 (postmaster) | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | mai 16 17:36:27 tchana.micronator-dev.org systemd[1]: Starting PostgreSQL 11 database se.... | ||
+ | mai 16 17:36:27 tchana.micronator-dev.org postmaster[5715]: | ||
+ | mai 16 17:36:27 tchana.micronator-dev.org postmaster[5715]: | ||
+ | mai 16 17:36:27 tchana.micronator-dev.org postmaster[5715]: | ||
+ | mai 16 17:36:27 tchana.micronator-dev.org postmaster[5715]: | ||
+ | mai 16 17:36:27 tchana.micronator-dev.org postmaster[5715]: | ||
+ | mai 16 17:36:27 tchana.micronator-dev.org systemd[1]: Started PostgreSQL 11 database server. | ||
+ | Hint: Some lines were ellipsized, use -l to show in full. | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | {{Images_icone-201-003_Note.png? | ||
+ | |||
+ | ====== PostgreSQL-11 - Premiers pas ====== | ||
+ | |||
+ | Cette section est inspirée de l' | ||
+ | |||
+ | ===== Connexion ===== | ||
+ | |||
+ | On se connecte au //Serveur NethServer// | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# su - postgres | ||
+ | |||
+ | -bash-4.2$ | ||
+ | </ | ||
+ | |||
+ | On vérifie. | ||
+ | |||
+ | < | ||
+ | -bash-4.2$ whoami | ||
+ | |||
+ | postgres | ||
+ | -bash-4.2$ | ||
+ | </ | ||
+ | |||
+ | On lance la console // | ||
+ | |||
+ | < | ||
+ | -bash-4.2$ psql | ||
+ | |||
+ | postgres | ||
+ | -bash-4.2$ psql | ||
+ | psql (11.3) | ||
+ | Saisissez « help » pour l' | ||
+ | |||
+ | postgres=# | ||
+ | </ | ||
+ | |||
+ | On vérifie que l'aide fonctionne correctement. | ||
+ | |||
+ | < | ||
+ | postgres=# HELP | ||
+ | |||
+ | Vous utilisez psql, l' | ||
+ | Saisissez: | ||
+ | \copyright pour les termes de distribution | ||
+ | \h pour l' | ||
+ | \? pour l' | ||
+ | \g ou point-virgule en fin d' | ||
+ | \q pour quitter | ||
+ | postgres=# | ||
+ | </ | ||
+ | |||
+ | ===== SCHEMA ===== | ||
+ | |||
+ | Une base de données contient un ou plusieurs schémas, qui eux, contiennent des tables. Les schémas contiennent aussi d' | ||
+ | |||
+ | On crée un schéma qu'on appellera '' | ||
+ | |||
+ | < | ||
+ | postgres=# CREATE SCHEMA test; | ||
+ | |||
+ | CREATE SCHEMA | ||
+ | postgres=# | ||
+ | </ | ||
+ | |||
+ | ===== RÔLE ===== | ||
+ | |||
+ | Un //rôle// est une entité qui peut posséder des objets de la base de données et avoir des droits sur celle-ci. Il peut être considéré comme un " | ||
+ | |||
+ | On crée un rôle // | ||
+ | |||
+ | {{Images_icone-201-003_Note.png? | ||
+ | |||
+ | < | ||
+ | postgres=# CREATE USER toto PASSWORD ' | ||
+ | |||
+ | CREATE ROLE | ||
+ | postgres=# | ||
+ | </ | ||
+ | |||
+ | ===== GRANT ===== | ||
+ | |||
+ | La commande '' | ||
+ | |||
+ | On donne au nouveau //rôle// tous les droits //(tel que la possibilité de créer des tables)// sur le nouveau schéma. | ||
+ | |||
+ | < | ||
+ | postgres=# GRANT ALL ON SCHEMA test TO toto; | ||
+ | |||
+ | GRANT | ||
+ | postgres=# | ||
+ | </ | ||
+ | |||
+ | On donne au nouveau //rôle// tous les droits //(tel que la possibilité d' | ||
+ | |||
+ | < | ||
+ | postgres=# GRANT ALL ON ALL TABLES IN SCHEMA test TO toto; | ||
+ | |||
+ | GRANT | ||
+ | postgres=# | ||
+ | </ | ||
+ | |||
+ | ===== Sortie de la console PostgreSQL ===== | ||
+ | |||
+ | On quitte la console // | ||
+ | < | ||
+ | |||
+ | postgres=# \q | ||
+ | |||
+ | -bash-4.2$ | ||
+ | </ | ||
+ | |||
+ | On retourne à l' | ||
+ | |||
+ | < | ||
+ | -bash-4.2$ exit | ||
+ | |||
+ | déconnexion | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | ===== Utilisateur standard Linux (toto) et PostgreSQL ===== | ||
+ | |||
+ | On crée un utilisateur standard Linux. | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# useradd -m -U -s / | ||
+ | |||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | {{ Images_Cahier-201-02-204.png }} | ||
+ | \\ | ||
+ | |||
+ | On vérifie. | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# cat /etc/passwd | grep toto | ||
+ | |||
+ | toto: | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | On lui octroie un mot de passe. | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# passwd toto | ||
+ | |||
+ | Changement de mot de passe pour l' | ||
+ | Nouveau mot de passe : mot-de-passe-pour-toto | ||
+ | Retapez le nouveau mot de passe : mot-de-passe-pour-toto | ||
+ | passwd : mise à jour réussie de tous les jetons d' | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | On se substitue à l' | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# su - toto | ||
+ | |||
+ | toto@tchana ~]$ | ||
+ | </ | ||
+ | |||
+ | {{Images_icone-201-003_Note.png? | ||
+ | |||
+ | <WRAP box> | ||
+ | < | ||
+ | -bash-4.2$ su - toto | ||
+ | |||
+ | Mot de passe : mot-de-passe-de-toto | ||
+ | -bash-4.2$ | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | ==== Connexion à la BD avec un utilisateur standard ==== | ||
+ | |||
+ | Par défaut, le mode d' | ||
+ | |||
+ | On se logue, en tant qu' | ||
+ | |||
+ | < | ||
+ | -bash-4.2$ psql -d postgres | ||
+ | |||
+ | psql (11.3) | ||
+ | Saisissez « help » pour l' | ||
+ | |||
+ | postgres=> | ||
+ | </ | ||
+ | |||
+ | === HELP === | ||
+ | |||
+ | On essaie l' | ||
+ | |||
+ | < | ||
+ | postgres=> | ||
+ | |||
+ | Vous utilisez psql, l' | ||
+ | Saisissez: | ||
+ | \copyright pour les termes de distribution | ||
+ | \h pour l' | ||
+ | \? pour l' | ||
+ | \g ou point-virgule en fin d' | ||
+ | \q pour quitter | ||
+ | postgres=> | ||
+ | </ | ||
+ | |||
+ | === CREATE === | ||
+ | |||
+ | Dans le schéma '' | ||
+ | |||
+ | < | ||
+ | postgres=> | ||
+ | |||
+ | CREATE TABLE | ||
+ | postgres=> | ||
+ | </ | ||
+ | |||
+ | === INSERT === | ||
+ | |||
+ | On insère une entrée dans la nouvelle table. | ||
+ | |||
+ | < | ||
+ | postgres=> | ||
+ | |||
+ | INSERT 0 1 | ||
+ | postgres=> | ||
+ | </ | ||
+ | |||
+ | === SELECT === | ||
+ | |||
+ | Sélection depuis une table. | ||
+ | |||
+ | < | ||
+ | postgres=> | ||
+ | |||
+ | | ||
+ | ----------- | ||
+ | Ça fonctionne! | ||
+ | (1 ligne) | ||
+ | |||
+ | postgres=> | ||
+ | </ | ||
+ | |||
+ | {{Images_icone-201-003_Note.png? | ||
+ | |||
+ | === Déconnexion === | ||
+ | |||
+ | L' | ||
+ | |||
+ | < | ||
+ | postgres=> | ||
+ | |||
+ | -bash-4.2$ | ||
+ | </ | ||
+ | |||
+ | On vérifie qui on est. | ||
+ | |||
+ | < | ||
+ | -bash-4.2$ whoami | ||
+ | |||
+ | toto | ||
+ | -bash-4.2$ | ||
+ | </ | ||
+ | |||
+ | On retourne à l' | ||
+ | |||
+ | < | ||
+ | -bash-4.2$ exit | ||
+ | |||
+ | déconnexion | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | ==== Suppression de l' | ||
+ | |||
+ | On supprime l' | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# userdel -f -r toto | ||
+ | |||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | On vérifie. | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# cat /etc/passwd | grep toto | ||
+ | |||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | ==== Nettoyage de PostgreSQL ==== | ||
+ | |||
+ | === Suppression du SCHEMA test === | ||
+ | |||
+ | On se substitue au super-utilisateur **__postgres__**. | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# su - postgres | ||
+ | |||
+ | Dernière connexion : jeudi 16 mai 2019 à 17:46:27 EDT EDT sur pts/0 | ||
+ | -bash-4.2$ | ||
+ | </ | ||
+ | |||
+ | On vérifie. | ||
+ | |||
+ | < | ||
+ | -bash-4.2$ whoami | ||
+ | |||
+ | postgres | ||
+ | -bash-4.2$ | ||
+ | </ | ||
+ | |||
+ | On lance la console // | ||
+ | |||
+ | < | ||
+ | -bash-4.2$ psql | ||
+ | |||
+ | psql (11.3) | ||
+ | Saisissez « help » pour l' | ||
+ | postgres=# | ||
+ | </ | ||
+ | |||
+ | On affiche les SCHEMA. | ||
+ | |||
+ | < | ||
+ | postgres=# \dn | ||
+ | |||
+ | Liste des schémas | ||
+ | Nom | Propriétaire | ||
+ | --------+-------------- | ||
+ | | ||
+ | | ||
+ | (2 lignes) | ||
+ | |||
+ | postgres=# | ||
+ | </ | ||
+ | |||
+ | On supprime le SCHEMA '' | ||
+ | |||
+ | < | ||
+ | postgres=# DROP SCHEMA test CASCADE; | ||
+ | |||
+ | NOTICE: | ||
+ | DROP SCHEMA | ||
+ | postgres=# | ||
+ | </ | ||
+ | |||
+ | On vérifie la suppression. | ||
+ | |||
+ | < | ||
+ | postgres=# \dn | ||
+ | |||
+ | Liste des schémas | ||
+ | Nom | Propriétaire | ||
+ | --------+-------------- | ||
+ | | ||
+ | (1 ligne) | ||
+ | |||
+ | postgres=# | ||
+ | </ | ||
+ | |||
+ | === Suppression de l' | ||
+ | |||
+ | < | ||
+ | postgres=# DROP USER toto; | ||
+ | |||
+ | DROP ROLE | ||
+ | postgres=# | ||
+ | </ | ||
+ | |||
+ | On vérifie la suppression. | ||
+ | |||
+ | < | ||
+ | postgres=# \du | ||
+ | |||
+ | Liste des rôles | ||
+ | Nom du rôle | Attributs | ||
+ | -------------+---------------------------------------------------------------------------------+----------- | ||
+ | | ||
+ | |||
+ | postgres=# | ||
+ | </ | ||
+ | |||
+ | On quitte la console // | ||
+ | |||
+ | < | ||
+ | postgres=# \q | ||
+ | |||
+ | -bash-4.2$ | ||
+ | </ | ||
+ | |||
+ | On quitte la substitution d' | ||
+ | |||
+ | < | ||
+ | -bash-4.2$ exit | ||
+ | |||
+ | déconnexion | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | On vérifie qu'on est bien de retour à l' | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# whoami | ||
+ | |||
+ | root | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | <WRAP centeralign> | ||
+ | |||
+ | ====== PostgreSQL-11 - Configuration finale ====== | ||
+ | |||
+ | ===== MD5 ===== | ||
+ | |||
+ | Maintenant, il nous faut configurer // | ||
+ | |||
+ | On vérifie qu'on est bien **__root__**. | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# whoami | ||
+ | |||
+ | root | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | {{Images_icone-201-004_Triangle.png? | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# sed -i "/ | ||
+ | |||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | On vérifie. | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# cat / | ||
+ | |||
+ | # METHOD can be " | ||
+ | # Note that " | ||
+ | host all | ||
+ | host all | ||
+ | host replication | ||
+ | host replication | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | ===== Création de l' | ||
+ | |||
+ | On peut choisir le mot de passe qu'on veut, mais l' | ||
+ | |||
+ | ==== Utilisateur Linux ==== | ||
+ | |||
+ | Le répertoire personnel //( -d )// de l' | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# useradd -m -U -r -d / | ||
+ | |||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | On octroie un __mot de passe robuste__ à l' | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# passwd flectra | ||
+ | |||
+ | Changement de mot de passe pour l' | ||
+ | Nouveau mot de passe : mot-de-passe-robuste-pour-flectra | ||
+ | Retapez le nouveau mot de passe : mot-de-passe-robuste-pour-flectra | ||
+ | passwd : mise à jour réussie de tous les jetons d' | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | {{Images_icone-201-004_Triangle.png? | ||
+ | |||
+ | {{Images_icone-201-003_Note.png? | ||
+ | |||
+ | ==== Utilisateur PostgreSQL ==== | ||
+ | |||
+ | Pour notre démonstration, | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# echo -e " | ||
+ | su - postgres | ||
+ | -c " | ||
+ | --createdb | ||
+ | --username postgres | ||
+ | --no-createrole | ||
+ | --no-superuser | ||
+ | --pwprompt flectra" | ||
+ | |||
+ | Saisir le mot de passe pour le nouveau rôle : | ||
+ | Le saisir de nouveau : | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | Il n'est pas nécessaire d' | ||
+ | |||
+ | {{Images_icone-201-004_Triangle.png? | ||
+ | \\ | ||
+ | |||
+ | ===== Sécurité ===== | ||
+ | |||
+ | // | ||
+ | |||
+ | ==== Sécurité de base ==== | ||
+ | |||
+ | Pour commencer, gardez à l' | ||
+ | |||
+ | Alors, s'il vous plaît, ne prenez pas cette section comme la liste ultime des mesures qui préviendront tous les problèmes de sécurité. Elle est seulement conçue comme un résumé des premières mesures importantes que vous devriez être certain d' | ||
+ | |||
+ | Lors du déploiement d'un serveur connecté à l' | ||
+ | |||
+ | * Définissez toujours un mot de passe administrateur // | ||
+ | \\ | ||
+ | |||
+ | * Choisissez des //login// uniques et des mots de passe robustes pour tous les comptes d' | ||
+ | \\ | ||
+ | |||
+ | * Utilisez les filtres de base de données appropriés ''< | ||
+ | \\ | ||
+ | |||
+ | * Une fois que vos paramètres ''< | ||
+ | \\ | ||
+ | |||
+ | * Assurez-vous que l' | ||
+ | \\ | ||
+ | |||
+ | * Maintenez les installations à jour en installant régulièrement les dernières versions, soit via //GitHub//, soit en téléchargeant la dernière version.\\ | ||
+ | \\ | ||
+ | |||
+ | * Configurez votre serveur en mode // | ||
+ | // | ||
+ | \\ \\ )) avec des limites adaptées à votre utilisation habituelle // | ||
+ | \\ | ||
+ | |||
+ | * Exécutez //Flectra// derrière un serveur Web fournissant une connexion //HTTPS// avec // | ||
+ | [[nethserver_101_cahier_04_local_certificat_let_encrypt|Cahier-04]]: | ||
+ | // | ||
+ | \\ | ||
+ | |||
+ | * Configurez le mandataire //(proxy)// Web pour limiter la taille des demandes, définissez des délais d' | ||
+ | \\ | ||
+ | |||
+ | * Si vous devez autoriser l' | ||
+ | \\ | ||
+ | |||
+ | * Il est fortement recommandé de désactiver complètement l' | ||
+ | [[nethserver_101_cahier_03_creation_un_serveur_virtuel# | ||
+ | dans le **Cahier-03**: | ||
+ | \\ | ||
+ | |||
+ | * Dans la mesure du possible, hébergez vos instances de démo/test sur des machines différentes de celles de production et veiller à leur appliquer les mêmes précautions de sécurité que celles pour les serveurs en production.\\ | ||
+ | \\ | ||
+ | |||
+ | * Si vous hébergez plusieurs clients, isolez les données des clients et leurs fichiers les uns des autres en utilisant des conteneurs ou des techniques appropriées de " | ||
+ | \\ | ||
+ | |||
+ | * Configurez les sauvegardes quotidiennes de vos bases de données/ | ||
+ | |||
+ | ==== Sécurité du gestionnaire des bases de données ==== | ||
+ | |||
+ | Sur la [[https:// | ||
+ | |||
+ | <WRAP indent> | ||
+ | "Les écrans de gestion de base de données sont protégés par le paramètre '' | ||
+ | |||
+ | Ce paramètre est utilisé sur tous les écrans de gestion de base de données //(créer, supprimer, vider ou restaurer des bases de données)// | ||
+ | </ | ||
+ | |||
+ | Si les écrans de gestion ne doivent pas être accessibles du tout, vous devez définir l' | ||
+ | |||
+ | Si les écrans de gestion ne doivent être accessibles qu'à partir d'un ensemble de machines sélectionnées, | ||
+ | |||
+ | Si l' | ||
+ | |||
+ | Le mot de passe devrait être stocké en toute sécurité et être généré de manière aléatoire, par exemple: | ||
+ | |||
+ | <WRAP box> | ||
+ | < | ||
+ | python -c ' | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | qui générera une chaîne imprimable pseudo-aléatoire de 32 caractères. | ||
+ | |||
+ | ===== Instantané VirtualBox ===== | ||
+ | |||
+ | {{Images_icone-201-002_Lumiere.png? | ||
+ | |||
+ | ====== Python36 ====== | ||
+ | |||
+ | Nous allons installer la // | ||
+ | \\ | ||
+ | |||
+ | <WRAP column 50%> | ||
+ | À l'URL: [[http:// | ||
+ | </ | ||
+ | <WRAP column 40%> | ||
+ | |{{ Images_Cahier-201-02-026.png? | ||
+ | </ | ||
+ | <WRAP clear></ | ||
+ | |||
+ | ===== Référentiel centos-sclo-rh ===== | ||
+ | |||
+ | Le référentiel // | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# yum repolist | grep -i sclo | ||
+ | |||
+ | * ce-sclo-rh: mirrors.vooservers.com | ||
+ | * ce-sclo-sclo: | ||
+ | ce-sclo-rh/ | ||
+ | ce-sclo-sclo/ | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | {{Images_icone-201-003_Note.png? | ||
+ | // | ||
+ | \\ | ||
+ | |||
+ | ===== Installation ===== | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# yum install -y --enablerepo=centos-sclo-rh rh-python36* | ||
+ | |||
+ | ... | ||
+ | Résumé de la transaction | ||
+ | ============================================================================================ | ||
+ | Installation | ||
+ | |||
+ | Taille totale des téléchargements : 74 M | ||
+ | Taille d' | ||
+ | ... | ||
+ | Installé: | ||
+ | rh-python36.x86_64 0:2.0-1.el7 | ||
+ | ... | ||
+ | rh-python36-scldevel.x86_64 0:2.0-1.el7 | ||
+ | Dépendance(s) installée(s) : | ||
+ | atlas.x86_64 0: | ||
+ | ... | ||
+ | zip.x86_64 0: | ||
+ | |||
+ | Terminé ! | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | Une fois la // | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# scl -l | ||
+ | |||
+ | httpd24 | ||
+ | php56 | ||
+ | php70 | ||
+ | php71 | ||
+ | php72 | ||
+ | php73 | ||
+ | rh-python36 | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | {{Images_icone-201-003_Note.png? | ||
+ | \\ | ||
+ | |||
+ | ===== Vérification de la version Python ===== | ||
+ | |||
+ | Le chemin de la commande '' | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# ls -als / | ||
+ | |||
+ | 0 lrwxrwxrwx 1 root root 7 11 mai 18:11 / | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | On affiche la version de la commande '' | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# / | ||
+ | |||
+ | Python 3.6.3 | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | ===== Instantané VirtualBox ===== | ||
+ | |||
+ | {{Images_icone-201-002_Lumiere.png? | ||
+ | |||
+ | <WRAP centeralign> | ||
+ | |||
+ | ======= Flectra - Prérequis ======= | ||
+ | |||
+ | ===== Description ===== | ||
+ | |||
+ | //Flectra// requière un assez grand nombre de dépendances avant d' | ||
+ | |||
+ | ===== Logiciels généraux ===== | ||
+ | |||
+ | Le compilateur '' | ||
+ | |||
+ | {{Images_Cahier-101-03-008.png? | ||
+ | [[nethserver_201_cahier_07_flectra# | ||
+ | . | ||
+ | |||
+ | ==== Installation ==== | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# yum install -y git gcc zlib-devel bzip2-devel openssl-devel | ||
+ | ncurses-devel sqlite-devel readline-devel tk-devel | ||
+ | libffi-devel libxslt libxslt-devel libxml2-devel | ||
+ | openldap-devel libjpeg-turbo-devel openjpeg-devel | ||
+ | libtiff-devel libXext libz.so.1 xorg-x11-fonts-Type1 | ||
+ | |||
+ | ... | ||
+ | Résumé de la transaction | ||
+ | ============================================================================================ | ||
+ | Installation | ||
+ | |||
+ | Taille totale des téléchargements : 53 M | ||
+ | Taille d' | ||
+ | ... | ||
+ | Installé : | ||
+ | bzip2-devel.x86_64 0: | ||
+ | git.x86_64 0: | ||
+ | libjpeg-turbo-devel.x86_64 0: | ||
+ | libxml2-devel.x86_64 0: | ||
+ | ncurses-devel.x86_64 0: | ||
+ | openldap-devel.x86_64 0: | ||
+ | readline-devel.x86_64 0: | ||
+ | tk-devel.x86_64 1: | ||
+ | zlib.i686 0: | ||
+ | |||
+ | Dépendance(s) installée(s) : | ||
+ | ... | ||
+ | cpp.x86_64 0: | ||
+ | ... | ||
+ | ttmkfdir.x86_64 0: | ||
+ | xz-devel.x86_64 0: | ||
+ | |||
+ | Terminé ! | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | ===== Logiciels du référentiel EPEL ===== | ||
+ | |||
+ | On s' | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# yum repolist | grep epel | ||
+ | |||
+ | * epel: mirror.layeronline.com | ||
+ | epel/ | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | ==== cabextract ==== | ||
+ | |||
+ | L' | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# yum install -y --enablerepo=epel cabextract | ||
+ | |||
+ | ... | ||
+ | Résumé de la transaction | ||
+ | ============================================================================================ | ||
+ | Installation | ||
+ | |||
+ | Taille totale des téléchargements : 107 k | ||
+ | Taille d' | ||
+ | ... | ||
+ | Installé: | ||
+ | cabextract.x86_64 0:1.5-1.el7 | ||
+ | |||
+ | Dépendance(s) installée(s) : | ||
+ | libmspack.x86_64 0: | ||
+ | |||
+ | Terminé ! | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | {{Images_icone-201-003_Note.png? | ||
+ | |||
+ | ===== npm ===== | ||
+ | |||
+ | // | ||
+ | L' | ||
+ | |||
+ | <WRAP column 50%> | ||
+ | {{Images_Cahier-101-03-003.png? | ||
+ | Les versions disponibles se trouvent à l'// | ||
+ | |||
+ | <WRAP centeralign> | ||
+ | </ | ||
+ | <WRAP column 42%> | ||
+ | |{{ Images_Cahier-201-07-005.png? | ||
+ | </ | ||
+ | <WRAP clear></ | ||
+ | |||
+ | ==== Node.js-v10.15.3 ==== | ||
+ | |||
+ | On crée un répertoire de travail. | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# mkdir /temp | ||
+ | |||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | On s'y rend. | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# cd /temp/ | ||
+ | |||
+ | [root@tchana temp]# | ||
+ | </ | ||
+ | |||
+ | On télécharge la version // | ||
+ | |||
+ | < | ||
+ | [root@tchana temp]# wget https:// | ||
+ | |||
+ | --2019-05-17 07: | ||
+ | Résolution de nodejs.org (nodejs.org)... 104.20.22.46, | ||
+ | Connexion vers nodejs.org (nodejs.org)|104.20.22.46|: | ||
+ | requête HTTP transmise, en attente de la réponse...200 OK | ||
+ | Longueur: 18638507 (18M) [application/ | ||
+ | Sauvegarde en : «node-v10.15.3-linux-x64.tar.gz» | ||
+ | |||
+ | 100%[==================================================> | ||
+ | |||
+ | 2019-05-17 07:53:08 (1,79 MB/s) - «node-v10.15.3-linux-x64.tar.gz» sauvegardé [18638507/ | ||
+ | |||
+ | [root@tchana temp]# | ||
+ | </ | ||
+ | |||
+ | On extraie vers le répertoire ''/ | ||
+ | |||
+ | < | ||
+ | [root@tchana temp]# tar -C /usr --strip-components 1 -xzf node-v10.15.3-linux-x64.tar.gz | ||
+ | |||
+ | [root@tchana temp]# | ||
+ | </ | ||
+ | |||
+ | On vérifie la présence de '' | ||
+ | |||
+ | < | ||
+ | [root@tchana temp]# which npm | ||
+ | |||
+ | / | ||
+ | [root@tchana temp]# | ||
+ | </ | ||
+ | |||
+ | On vérifie la version. | ||
+ | |||
+ | < | ||
+ | [root@tchana temp]# npm --version | ||
+ | |||
+ | 6.4.1 | ||
+ | [root@tchana temp]# | ||
+ | </ | ||
+ | |||
+ | ===== less et less-plugin-clean-css ===== | ||
+ | |||
+ | ==== less ==== | ||
+ | |||
+ | // | ||
+ | |||
+ | L' | ||
+ | |||
+ | ==== less-plugin-clean-css ==== | ||
+ | |||
+ | // | ||
+ | |||
+ | Ce greffon compresse la sortie '' | ||
+ | |||
+ | {{Images_Cahier-101-03-003.png? | ||
+ | |||
+ | < | ||
+ | [root@tchana temp]# npm config set strict-ssl false | ||
+ | |||
+ | [root@tchana temp]# | ||
+ | </ | ||
+ | |||
+ | On installe ces logiciels. | ||
+ | |||
+ | < | ||
+ | [root@tchana temp]# npm install -g less less-plugin-clean-css | ||
+ | |||
+ | / | ||
+ | + less-plugin-clean-css@1.5.1 | ||
+ | + less@3.9.0 | ||
+ | added 66 packages from 128 contributors in 4.337s | ||
+ | [root@tchana temp]# | ||
+ | </ | ||
+ | |||
+ | On vérifie la présence de '' | ||
+ | |||
+ | < | ||
+ | [root@tchana temp]# which less | ||
+ | |||
+ | / | ||
+ | [root@tchana temp]# | ||
+ | </ | ||
+ | |||
+ | On vérifie sa version. | ||
+ | |||
+ | < | ||
+ | [root@tchana temp]# less --version | ||
+ | |||
+ | less 458 (POSIX regular expressions) | ||
+ | Copyright (C) 1984-2012 Mark Nudelman | ||
+ | |||
+ | less comes with NO WARRANTY, to the extent permitted by law. | ||
+ | For information about the terms of redistribution, | ||
+ | see the file named README in the less distribution. | ||
+ | Homepage: http:// | ||
+ | [root@tchana temp]# | ||
+ | </ | ||
+ | |||
+ | On vérifie la présence de '' | ||
+ | |||
+ | < | ||
+ | [root@tchana temp]# which lessc | ||
+ | |||
+ | / | ||
+ | [root@tchana temp]# | ||
+ | </ | ||
+ | |||
+ | On vérifie sa version. | ||
+ | |||
+ | < | ||
+ | [root@tchana temp]# lessc --version | ||
+ | |||
+ | lessc 3.9.0 (Less Compiler) [JavaScript] | ||
+ | [root@tchana temp]# | ||
+ | </ | ||
+ | |||
+ | ===== wkhtmltox ===== | ||
+ | |||
+ | Les '' | ||
+ | |||
+ | ==== Dépendances pour wkhtmltopdf ==== | ||
+ | |||
+ | // | ||
+ | '' | ||
+ | |||
+ | On installe les dépendances. | ||
+ | |||
+ | < | ||
+ | [root@tchana temp]# yum install -y fontconfig libpng libX11 libXext libXrender xorg-x11-fonts-Type1 xorg-x11-fonts-75dpi | ||
+ | |||
+ | ... | ||
+ | Résumé de la transaction | ||
+ | ============================================================================================ | ||
+ | Installation | ||
+ | |||
+ | Taille totale des téléchargements : 2.8 M | ||
+ | Taille d' | ||
+ | ... | ||
+ | Installé : | ||
+ | xorg-x11-fonts-75dpi.noarch 0:7.5-9.el7 | ||
+ | |||
+ | Terminé ! | ||
+ | [root@tchana temp]# | ||
+ | </ | ||
+ | |||
+ | ==== wkhtmltox ==== | ||
+ | |||
+ | Si ce n'est déjà fait, on se rend dans le répertoire de travail. | ||
+ | |||
+ | <WRAP box round> | ||
+ | < | ||
+ | [root@tchana ~]# cd /temp | ||
+ | |||
+ | [root@tchana temp]# | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | On nettoie le répertoire ''/ | ||
+ | |||
+ | < | ||
+ | [root@tchana temp]# rm -rf * | ||
+ | |||
+ | [root@tchana temp]# | ||
+ | </ | ||
+ | |||
+ | <WRAP column 52%> | ||
+ | À l'aide d'un navigateur Internet, on se rend à l'Url: | ||
+ | |||
+ | [[https:// | ||
+ | |||
+ | On claque sur le fichier: **wkhtmltox-0.12.5-1.centos7.x86_64.rpm**. | ||
+ | |||
+ | **-> Copier l' | ||
+ | </ | ||
+ | <WRAP column 40%> | ||
+ | |{{ Images_Cahier-201-07-006.png? | ||
+ | </ | ||
+ | <WRAP clear></ | ||
+ | |||
+ | Le lien copié est: https:// | ||
+ | |||
+ | À la ligne de commande, on entre '' | ||
+ | |||
+ | < | ||
+ | [root@tchana temp]# rpm -Uvh https:// | ||
+ | |||
+ | Récupération de https:// | ||
+ | Préparation... | ||
+ | Mise à jour / installation... | ||
+ | 1: | ||
+ | [root@tchana temp]# | ||
+ | </ | ||
+ | |||
+ | On vérifie l' | ||
+ | |||
+ | < | ||
+ | [root@tchana temp]# ls -als / | ||
+ | |||
+ | 36936 -rwxr-xr-x 1 root root 37818944 11 juin 2018 / | ||
+ | 37016 -rwxr-xr-x 1 root root 37900864 11 juin 2018 / | ||
+ | [root@tchana temp]# | ||
+ | </ | ||
+ | |||
+ | On supprime tout dans le répertoire ''/ | ||
+ | |||
+ | < | ||
+ | [root@tchana temp]# rm -rf /temp/* | ||
+ | |||
+ | [root@tchana temp]# | ||
+ | </ | ||
+ | |||
+ | On retourne dans le répertoire personnel de **__root__**. | ||
+ | |||
+ | < | ||
+ | [root@tchana temp]# cd | ||
+ | |||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | On vérifie. | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# pwd | ||
+ | |||
+ | /root | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | ===== pychart ===== | ||
+ | |||
+ | //PyChart// est une bibliothèque //Python// pour la création de //PDF//, //PNG// ou graphiques //SVG// en // | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# yum install -y pychart | ||
+ | |||
+ | ... | ||
+ | Résumé de la transaction | ||
+ | ============================================================================================ | ||
+ | Installation | ||
+ | |||
+ | Taille totale des téléchargements : 190 k | ||
+ | Taille d' | ||
+ | ... | ||
+ | Installé : | ||
+ | pychart.noarch 0: | ||
+ | |||
+ | Terminé ! | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | ===== Vérifications finales ===== | ||
+ | |||
+ | **NPM** | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# which npm | ||
+ | |||
+ | / | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# npm --version | ||
+ | |||
+ | 6.4.1 | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | **LESS** | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# which less | ||
+ | |||
+ | / | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# less --version | ||
+ | |||
+ | less 458 (POSIX regular expressions) | ||
+ | Copyright (C) 1984-2012 Mark Nudelman | ||
+ | |||
+ | less comes with NO WARRANTY, to the extent permitted by law. | ||
+ | For information about the terms of redistribution, | ||
+ | see the file named README in the less distribution. | ||
+ | Homepage: http:// | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | **LESSC** | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# which lessc | ||
+ | |||
+ | / | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# lessc --version | ||
+ | |||
+ | lessc 3.9.0 (Less Compiler) [JavaScript] | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | ===== Instantané VirtualBox ===== | ||
+ | |||
+ | {{Images_Cahier-101-03-004.png? | ||
+ | |||
+ | <WRAP centeralign> | ||
+ | |||
+ | ====== Flectra - Installation ====== | ||
+ | |||
+ | ===== Pare-feu ===== | ||
+ | |||
+ | {{Images_Cahier-101-03-006.png? | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# config set fw_flectra service status enabled TCPPort 7073 access green | ||
+ | |||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | Pour ouvrir le port //7073// pour les réseaux vert et rouge. | ||
+ | |||
+ | <WRAP box> | ||
+ | < | ||
+ | [root@tchana ~]# config set fw_flectra service status enabled TCPPort 7073 access green,red | ||
+ | |||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | On signale le changement. | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# signal-event firewall-adjust | ||
+ | |||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | On vérifie. | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# cat / | ||
+ | |||
+ | ACCEPT | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | <WRAP box> | ||
+ | < | ||
+ | [root@tchana ~]# cat / | ||
+ | |||
+ | ACCEPT | ||
+ | ACCEPT | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | On affiche la configuration du port ouvert pour // | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# config show fw_flectra | ||
+ | |||
+ | fw_flectra=service | ||
+ | TCPPort=7073 | ||
+ | access=green | ||
+ | status=enabled | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | <WRAP box> | ||
+ | < | ||
+ | [root@tchana ~]# config show fw_flectra | ||
+ | |||
+ | fw_flectra=service | ||
+ | TCPPort=7073 | ||
+ | access=green, | ||
+ | status=enabled | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | ===== git clone Flectra ===== | ||
+ | |||
+ | On se substitue à l' | ||
+ | |||
+ | {{Images_Cahier-101-03-006.png? | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# su - flectra | ||
+ | |||
+ | [flectra@tchana ~]$ | ||
+ | </ | ||
+ | |||
+ | On vérifie quel utilisateur nous sommes. | ||
+ | |||
+ | < | ||
+ | [flectra@tchana ~]$ whoami | ||
+ | |||
+ | flectra | ||
+ | [flectra@tchana ~]$ | ||
+ | </ | ||
+ | |||
+ | On vérifie le chemin du répertoire courant. | ||
+ | |||
+ | < | ||
+ | [flectra@tchana ~]$ pwd | ||
+ | |||
+ | / | ||
+ | [flectra@tchana ~]$ | ||
+ | </ | ||
+ | |||
+ | <WRAP column 30%> | ||
+ | On se rend à l'// | ||
+ | |||
+ | **Clone or download ->** on clique l' | ||
+ | </ | ||
+ | <WRAP column 62%> | ||
+ | |{{ Images_Cahier-201-07-007.png? | ||
+ | </ | ||
+ | <WRAP clear></ | ||
+ | |||
+ | Le lien copié est: [[https:// | ||
+ | |||
+ | On emploie l' | ||
+ | |||
+ | On entre '' | ||
+ | |||
+ | < | ||
+ | [flectra@tchana ~]$ git clone https:// | ||
+ | |||
+ | Cloning into ' | ||
+ | remote: Enumerating objects: 25765, done. | ||
+ | remote: Counting objects: 100% (25765/ | ||
+ | remote: Compressing objects: 100% (18241/ | ||
+ | remote: Total 25765 (delta 8233), reused 19250 (delta 6685), pack-reused 0 | ||
+ | Receiving objects: 100% (25765/ | ||
+ | Resolving deltas: 100% (8233/ | ||
+ | Checking out files: 100% (23269/ | ||
+ | [flectra@tchana ~]$ | ||
+ | </ | ||
+ | |||
+ | On vérifie. | ||
+ | |||
+ | < | ||
+ | [flectra@tchana ~]$ ls -als | ||
+ | |||
+ | total 20 | ||
+ | 0 drwx------ | ||
+ | 0 drwxr-xr-x. 7 root root 73 18 sept. 23:14 .. | ||
+ | 4 -rw------- | ||
+ | 4 -rw-r--r-- | ||
+ | 4 -rw-r--r-- | ||
+ | 4 -rw-r--r-- | ||
+ | 0 drwx------ | ||
+ | 4 drwxrwxr-x | ||
+ | 0 drwx------ | ||
+ | 0 drwxrw---- | ||
+ | [flectra@tchana ~]$ | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | [flectra@tchana ~]$ ls -als flectra/ | ||
+ | |||
+ | total 180 | ||
+ | 4 drwxrwxr-x | ||
+ | 0 drwx------ | ||
+ | 16 drwxrwxr-x 306 flectra flectra 12288 19 sept. 19:05 addons | ||
+ | 8 -rw-rw-r-- | ||
+ | 4 -rw-rw-r-- | ||
+ | 4 -rw-rw-r-- | ||
+ | 4 -rw-rw-r-- | ||
+ | 0 drwxrwxr-x | ||
+ | 0 drwxrwxr-x | ||
+ | 0 drwxrwxr-x | ||
+ | 4 -rwxrwxr-x | ||
+ | 0 drwxrwxr-x | ||
+ | 4 -rw-rw-r-- | ||
+ | 0 drwxrwxr-x | ||
+ | 4 -rw-rw-r-- | ||
+ | 44 -rw-rw-r-- | ||
+ | 56 -rw-rw-r-- | ||
+ | 4 -rw-rw-r-- | ||
+ | 4 -rw-rw-r-- | ||
+ | 4 -rw-rw-r-- | ||
+ | 4 -rw-rw-r-- | ||
+ | 0 drwxrwxr-x | ||
+ | 4 -rw-rw-r-- | ||
+ | 8 -rw-rw-r-- | ||
+ | [flectra@tchana ~]$ | ||
+ | </ | ||
+ | |||
+ | ===== Environnement virtuel pour l' | ||
+ | |||
+ | On active // | ||
+ | |||
+ | < | ||
+ | [flectra@tchana ~]$ scl enable rh-python36 bash | ||
+ | |||
+ | [flectra@tchana ~]$ | ||
+ | </ | ||
+ | |||
+ | On crée un environnement virtuel pour l' | ||
+ | |||
+ | < | ||
+ | [flectra@tchana ~]$ python3 -m venv flectra-venv | ||
+ | |||
+ | [flectra@tchana ~]$ | ||
+ | </ | ||
+ | |||
+ | On vérifie. | ||
+ | |||
+ | < | ||
+ | [flectra@tchana ~]$ ls -als | ||
+ | |||
+ | total 20 | ||
+ | 0 drwx------ | ||
+ | 0 drwxr-xr-x. 7 root root 73 18 sept. 23:14 .. | ||
+ | 4 -rw------- | ||
+ | 4 -rw-r--r-- | ||
+ | 4 -rw-r--r-- | ||
+ | 4 -rw-r--r-- | ||
+ | 0 drwx------ | ||
+ | 4 drwxrwxr-x | ||
+ | 0 drwxrwxr-x | ||
+ | 0 drwx------ | ||
+ | 0 drwxrw---- | ||
+ | [flectra@tchana ~]$ | ||
+ | </ | ||
+ | |||
+ | On active l' | ||
+ | |||
+ | < | ||
+ | [flectra@tchana ~]$ source flectra-venv/ | ||
+ | |||
+ | (flectra-venv) [flectra@tchana ~]$ | ||
+ | </ | ||
+ | |||
+ | ==== requirements.txt ==== | ||
+ | |||
+ | C'est ici que '' | ||
+ | |||
+ | < | ||
+ | (flectra-venv) [flectra@tchana ~]$ ls -als / | ||
+ | |||
+ | 4 -rw-rw-r-- 1 flectra flectra 1179 19 sept. 19:05 / | ||
+ | (flectra-venv) [flectra@tchana ~]$ | ||
+ | </ | ||
+ | |||
+ | On installe toutes les exigences contenues dans le fichier '' | ||
+ | |||
+ | < | ||
+ | (flectra-venv) [flectra@tchana ~]$ pip3 install -r / | ||
+ | |||
+ | ... | ||
+ | Ignoring pypiwin32: markers ' | ||
+ | Collecting Babel==2.3.4 (from -r / | ||
+ | Using cached https:// | ||
+ | ... | ||
+ | Running setup.py install for lxml ... \ | ||
+ | ... | ||
+ | Running setup.py install for pycrypto ... done | ||
+ | Successfully installed Babel-2.3.4 Jinja2-2.10.1 Mako-1.0.4 MarkupSafe-0.23 Pillow-4.0.0 PyPDF2-1.26.0 PyYAML-3.12 Werkzeug-0.11.15 XlsxWriter-0.9.3 argparse-1.4.0 beautifulsoup4-4.8.0 certifi-2019.9.11 chardet-3.0.4 decorator-4.0.10 docutils-0.12 ebaysdk-2.1.5 feedparser-5.2.1 gevent-1.1.2 greenlet-0.4.10 html2text-2016.9.19 idna-2.7 linecache2-1.0.0 lxml-3.7.1 mock-2.0.0 num2words-0.5.6 numpy-1.14.3 oauthlib-2.0.7 ofxparse-0.16 olefile-0.46 passlib-1.6.5 pbr-5.4.3 phonenumbers-8.8.9 psutil-4.3.1 psycopg2-2.7.3.1 pycrypto-2.6.1 pydot-1.2.3 pyldap-2.4.28 pyparsing-2.1.10 pyserial-3.1.1 python-dateutil-2.5.3 python-stdnum-1.11 pytz-2016.7 pyusb-1.0.0 qrcode-5.3 reportlab-3.3.0 requests-2.20.0 six-1.12.0 soupsieve-1.9.3 suds-jurko-0.6 traceback2-1.4.0 unittest2-1.1.0 urllib3-1.24.3 vatnumber-1.2 vobject-0.9.3 xlrd-1.0.0 xlwt-1.3.0 | ||
+ | You are using pip version 9.0.1, however version 19.2.3 is available. | ||
+ | You should consider upgrading via the 'pip install --upgrade pip' command. | ||
+ | (flectra-venv) [flectra@tchana ~]$ | ||
+ | </ | ||
+ | |||
+ | {{Images_Cahier-101-03-006.png? | ||
+ | |||
+ | On désactive l' | ||
+ | |||
+ | < | ||
+ | (flectra-venv) [flectra@tchana ~]$ deactivate && exit | ||
+ | |||
+ | exit | ||
+ | [flectra@tchana ~]$ | ||
+ | </ | ||
+ | |||
+ | On quitte la substitution d' | ||
+ | |||
+ | < | ||
+ | [flectra@tchana ~]$ exit | ||
+ | |||
+ | déconnexion | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | On vérifie qui nous sommes. | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# whoami | ||
+ | |||
+ | root | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | ===== Journal ===== | ||
+ | |||
+ | ==== Création du répertoire ==== | ||
+ | |||
+ | {{Images_Cahier-101-03-006.png? | ||
+ | |||
+ | < | ||
+ | DIR="/ | ||
+ | for NAME in $DIR | ||
+ | do | ||
+ | if [ ! -d $NAME ]; then | ||
+ | mkdir $NAME | ||
+ | chown flectra.flectra $NAME | ||
+ | chmod 700 $NAME | ||
+ | fi | ||
+ | done | ||
+ | |||
+ | </ | ||
+ | |||
+ | On vérifie la création du répertoire. | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# ls -alsd / | ||
+ | |||
+ | 0 drwx------ 2 flectra flectra 32 19 sept. 01:20 / | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | ==== logrotation ==== | ||
+ | |||
+ | Nous autorisons la rotation du journal <wrap em> | ||
+ | |||
+ | {{Images_Cahier-101-03-006.png? | ||
+ | |||
+ | < | ||
+ | cat > / | ||
+ | / | ||
+ | |||
+ | # Fichier de logrotate pour / | ||
+ | # Michel-André 2018-06-1_22h00 | ||
+ | # Pour plus de détails, voir: man logrotate | ||
+ | # Rotation quotidienne | ||
+ | daily | ||
+ | |||
+ | # Si le fichier n' | ||
+ | missingok | ||
+ | |||
+ | # Grandeur maximale de 100k | ||
+ | maxsize 100000 | ||
+ | |||
+ | # Ne conserver que 5 fichiers de log | ||
+ | rotate 5 | ||
+ | |||
+ | # Ne pas faire de rotation si le fichier est vide. | ||
+ | notifempty | ||
+ | |||
+ | # Immédiatement après la permutation, | ||
+ | # peut être omis, auquel cas ces attributs omis pour le nouveau journal prendront les même | ||
+ | # valeurs que pour le journal original. | ||
+ | # create droits propriétaire groupe | ||
+ | create 0640 flectra flectra | ||
+ | } | ||
+ | EOF | ||
+ | |||
+ | |||
+ | </ | ||
+ | |||
+ | On vérifie la création du fichier. | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# ls -ls / | ||
+ | |||
+ | 4 -rw-r--r-- 1 root root 794 19 sept. 19:33 / | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | On vérifie le début du contenu. | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# head / | ||
+ | |||
+ | / | ||
+ | |||
+ | # Fichier de logrotate pour / | ||
+ | # Michel-André 2018-06-1_22h00 | ||
+ | # Pour plus de détails, voir: man logrotate | ||
+ | # Rotation quotidienne | ||
+ | daily | ||
+ | |||
+ | # Si le fichier n' | ||
+ | missingok | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | {{Images_Cahier-101-03-006.png? | ||
+ | |||
+ | <WRAP column 60%> | ||
+ | Le journal pourra être examiné dans l' | ||
+ | |||
+ | {{Images_Cahier-101-03-006.png? | ||
+ | </ | ||
+ | <WRAP column 32%> | ||
+ | |{{ Images_Cahier-201-07-008.png? | ||
+ | </ | ||
+ | <WRAP clear></ | ||
+ | |||
+ | ==== Sauvegarde ==== | ||
+ | |||
+ | On vérifie si le nom du fichier ''/ | ||
+ | |||
+ | {{Images_Cahier-101-03-006.png? | ||
+ | |||
+ | < | ||
+ | NouvelleInclusion="/ | ||
+ | if grep -Fxq " | ||
+ | then | ||
+ | # L' | ||
+ | echo -e "\nLe fichier custom.include contient déjà l' | ||
+ | else | ||
+ | # L' | ||
+ | echo -e " | ||
+ | echo -e " | ||
+ | fi | ||
+ | |||
+ | |||
+ | </ | ||
+ | |||
+ | On vérifie. | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# cat / | ||
+ | |||
+ | / | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | Ci-dessus, il n'y a pas de ligne vide avant __/ | ||
+ | |||
+ | ===== Fichier de configuration: | ||
+ | |||
+ | Pour débuter, nous activons '' | ||
+ | |||
+ | {{Images_Cahier-101-03-006.png? | ||
+ | |||
+ | < | ||
+ | cat > / | ||
+ | [options] | ||
+ | ; Ceci est le mot de passe qui autorise les oprérations sur la base de données: | ||
+ | admin_passwd = fghtbgh | ||
+ | ; OPTIONS DE LA BASE DE DONNÉES | ||
+ | db_host = localhost | ||
+ | db_port = 5432 | ||
+ | db_name = Flectra | ||
+ | db_user = flectra | ||
+ | db_password = fghtbgh | ||
+ | ; PARAMÈTRES DIVERS | ||
+ | addons_path = / | ||
+ | load = web | ||
+ | timezone = America/ | ||
+ | without-demo=all | ||
+ | no-xmlrpc = True | ||
+ | no-xmlrpcs = True | ||
+ | no-netrpc = True | ||
+ | ; PARAMÈTRES DES JOURNAUX | ||
+ | logfile = / | ||
+ | ; MAR - Ceci est le défault | ||
+ | ; | ||
+ | ; MAR - Pour voir tous les messageS de Flectra, on active à :DEBUG | ||
+ | log_handler = :DEBUG | ||
+ | ;log_level = warn | ||
+ | no-logrotate = True | ||
+ | EOT | ||
+ | |||
+ | |||
+ | </ | ||
+ | |||
+ | On vérifie. | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# cat / | ||
+ | |||
+ | [options] | ||
+ | ; Ceci est le mot de passe qui autorise les oprérations sur la base de données: | ||
+ | admin_passwd = fghtbgh | ||
+ | ; OPTIONS DE LA BASE DE DONNÉES | ||
+ | db_host = localhost | ||
+ | db_port = 5432 | ||
+ | db_name = Flectra | ||
+ | db_user = flectra | ||
+ | db_password = fghtbgh | ||
+ | ; PARAMÈTRES DIVERS | ||
+ | addons_path = / | ||
+ | load = web | ||
+ | timezone = America/ | ||
+ | without-demo=all | ||
+ | no-xmlrpc = True | ||
+ | no-xmlrpcs = True | ||
+ | no-netrpc = True | ||
+ | ; PARAMÈTRES DES JOURNAUX | ||
+ | logfile = / | ||
+ | ; MAR - Ceci est le défault | ||
+ | ; | ||
+ | ; MAR - Pour voir tous les messageS de Flectra, on active à :DEBUG | ||
+ | log_handler = :DEBUG | ||
+ | ;log_level = warn | ||
+ | no-logrotate = True | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | {{Images_Cahier-101-03-006.png? | ||
+ | |||
+ | {{Images_Cahier-101-03-008.png? | ||
+ | |||
+ | On vérifie les droits du fichier. | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# ls -als / | ||
+ | |||
+ | 4 -rw-r--r-- 1 root root 673 19 sept. 19:54 / | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | On rend le script exécutable par le propriétaire/ | ||
+ | |||
+ | < | ||
+ | [root@dorgee ~]# chmod 550 / | ||
+ | |||
+ | [root@dorgee ~]# | ||
+ | </ | ||
+ | |||
+ | On change le propriétaire et le groupe pour '' | ||
+ | |||
+ | < | ||
+ | [root@dorgee ~]# chown flectra: | ||
+ | |||
+ | [root@dorgee ~]# | ||
+ | </ | ||
+ | |||
+ | On vérifie. | ||
+ | |||
+ | < | ||
+ | [root@dorgee ~]# ls -ls / | ||
+ | |||
+ | 4 -r-xr-x--- 1 flectra flectra 673 19 sept. 19:54 / | ||
+ | [root@dorgee ~]# | ||
+ | </ | ||
+ | |||
+ | ===== Départ/ | ||
+ | |||
+ | On veut que //Flectra// se lance automatiquement à tous les amorçages du //Serveur NethServer// | ||
+ | |||
+ | ==== Fichier / | ||
+ | |||
+ | {{Images_Cahier-101-03-006.png? | ||
+ | |||
+ | < | ||
+ | cat > / | ||
+ | [Unit] | ||
+ | Description=Flectra | ||
+ | Requires=postgresql-11.service | ||
+ | After=network.target postgresql-11.service | ||
+ | |||
+ | [Service] | ||
+ | Type=simple | ||
+ | SyslogIdentifier=flectra | ||
+ | PermissionsStartOnly=true | ||
+ | User=flectra | ||
+ | Group=flectra | ||
+ | ExecStart=/ | ||
+ | StandardOutput=journal+console | ||
+ | |||
+ | [Install] | ||
+ | WantedBy=multi-user.target | ||
+ | |||
+ | EOT | ||
+ | |||
+ | |||
+ | </ | ||
+ | |||
+ | On vérifie la création du fichier. | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# ls -als / | ||
+ | |||
+ | 4 -rw-r--r-- 1 root root 416 19 sept. 20:10 / | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | On vérifie son contenu. | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# cat / | ||
+ | |||
+ | [Unit] | ||
+ | Description=Flectra | ||
+ | Requires=postgresql-11.service | ||
+ | After=network.target postgresql-11.service | ||
+ | |||
+ | [Service] | ||
+ | Type=simple | ||
+ | SyslogIdentifier=flectra | ||
+ | PermissionsStartOnly=true | ||
+ | User=flectra | ||
+ | Group=flectra | ||
+ | ExecStart=/ | ||
+ | StandardOutput=journal+console | ||
+ | |||
+ | [Install] | ||
+ | WantedBy=multi-user.target | ||
+ | |||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | ==== Premier démarrage de Flectra ==== | ||
+ | |||
+ | On recharge la configuration du gestionnaire '' | ||
+ | // | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# systemctl daemon-reload | ||
+ | |||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | La première fois qu'on lance // | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# systemctl enable flectra --now | ||
+ | |||
+ | Created symlink from / | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | ==== Vérification ==== | ||
+ | |||
+ | {{Images_Cahier-101-03-006.png? | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# systemctl status flectra | ||
+ | |||
+ | ● flectra.service - Flectra | ||
+ | | ||
+ | | ||
+ | Main PID: 4010 (scl) | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | sept. 19 20:17:22 tchana.micronator-dev.org systemd[1]: Started Flectra. | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | ===== Finalisation de l' | ||
+ | |||
+ | ==== Accès à Flectra ==== | ||
+ | |||
+ | - Autoriser les __témoins__ et activer __JavaScript__ du fureteur Internet.\\ | ||
+ | \\ | ||
+ | |||
+ | - On se rend à la page de notre site //Flectra// en spécifiant le port <wrap em>:7073 </ | ||
+ | |||
+ | ==== Création d'une nouvelle base de données ==== | ||
+ | |||
+ | <WRAP column 46%> | ||
+ | ● **//Master password:// | ||
+ | [[nethserver_201_cahier_07_flectra# | ||
+ | . | ||
+ | |||
+ | ● **// | ||
+ | |||
+ | ● **// | ||
+ | |||
+ | ● **// | ||
+ | |||
+ | ● **// | ||
+ | |||
+ | ● **// | ||
+ | |||
+ | ● **//Démo data://** -> cocher pour installer des données fictives pour l' | ||
+ | {{Images_Cahier-101-03-006.png? | ||
+ | |||
+ | On clique **Create database** pour créer la base de données de notre société. | ||
+ | </ | ||
+ | <WRAP column 46%> | ||
+ | |{{ Images_Cahier-201-07-009.png? | ||
+ | </ | ||
+ | <WRAP clear></ | ||
+ | |||
+ | {{Images_Cahier-101-03-004.png? | ||
+ | |||
+ | <WRAP column 22%> | ||
+ | La page d' | ||
+ | </ | ||
+ | <WRAP column 70%> | ||
+ | |{{ Images_Cahier-201-07-010.png? | ||
+ | </ | ||
+ | <WRAP clear></ | ||
+ | |||
+ | <WRAP centeralign> | ||
+ | |||
+ | ===== Paramètre du journal Flectra ===== | ||
+ | |||
+ | Maintenant que tout fonctionne correctement, | ||
+ | |||
+ | === Fichier final de configuration / | ||
+ | |||
+ | < | ||
+ | ... | ||
+ | ; PARAMÈTRES DES JOURNAUX | ||
+ | logfile = / | ||
+ | ; MAR - Ceci est le défault | ||
+ | log_handler = werkzeug: | ||
+ | ; MAR - Pour voir tous les messageS de Flectra, on active à :DEBUG | ||
+ | ; | ||
+ | ... | ||
+ | </ | ||
+ | |||
+ | À la console du serveur, on ouvre le fichier avec l' | ||
+ | |||
+ | {{Images_Cahier-101-03-003.png? | ||
+ | |||
+ | < | ||
+ | vi / | ||
+ | |||
+ | </ | ||
+ | |||
+ | On vérifie les changements dans le fichiers ''/ | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# cat / | ||
+ | |||
+ | log_handler = werkzeug: | ||
+ | ; | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | Nous avons changé un paramètre important, on redémarre le service //Flectra// afin qu'il recharge son fichier de configuration. | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# systemctl restart flectra | ||
+ | |||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | ==== Rotation du journal Flectra ==== | ||
+ | |||
+ | Le journal de //Flectra// est très volumineux, car il contient toutes les entrées de débogage. | ||
+ | |||
+ | < | ||
+ | [flectra@tchana ~]$ ls -als / | ||
+ | |||
+ | 24924 -rw-r--r-- 1 flectra flectra 25520972 19 sept. 21:12 / | ||
+ | [flectra@tchana ~]$ | ||
+ | </ | ||
+ | |||
+ | On force la rotation de ce journal. | ||
+ | |||
+ | < | ||
+ | [flectra@tchana ~]$ logrotate -vf / | ||
+ | |||
+ | reading config file / | ||
+ | Allocating hash table for state file, size 15360 B | ||
+ | |||
+ | Handling 1 logs | ||
+ | |||
+ | rotating pattern: / | ||
+ | empty log files are not rotated, log files >= 100000 are rotated earlier, old logs are removed | ||
+ | considering log / | ||
+ | log needs rotating | ||
+ | rotating log / | ||
+ | dateext suffix ' | ||
+ | glob pattern ' | ||
+ | renaming / | ||
+ | old log / | ||
+ | renaming / | ||
+ | old log / | ||
+ | renaming / | ||
+ | old log / | ||
+ | renaming / | ||
+ | old log / | ||
+ | renaming / | ||
+ | old log / | ||
+ | renaming / | ||
+ | old log / | ||
+ | log / | ||
+ | renaming / | ||
+ | creating new / | ||
+ | [flectra@tchana ~]$ | ||
+ | </ | ||
+ | |||
+ | On vérifie. | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# ls -als / | ||
+ | |||
+ | total 24928 | ||
+ | 0 drwx------ | ||
+ | 4 drwxr-xr-x. 22 root root 4096 19 sept. 20:16 .. | ||
+ | 0 -rw-r----- | ||
+ | 24924 -rw-r--r-- | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | ===== Désinstallation des compilateurs gcc et cpp ===== | ||
+ | |||
+ | {{Images_Cahier-101-03-008.png? | ||
+ | {{Images_Cahier-101-03-004.png? | ||
+ | Le paquet '' | ||
+ | |||
+ | Nous forçons la désinstallation de ces deux //RPM//. | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# rpm -e --nodeps gcc cpp | ||
+ | |||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | On vérifie '' | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# rpm -qa | grep cpp | ||
+ | |||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | On vérifie '' | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# rpm -qa | grep gcc | ||
+ | |||
+ | libgcc-4.8.5-36.el7_6.2.x86_64 | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | Les compilateurs '' | ||
+ | {{Images_Cahier-101-03-006.png? | ||
+ | |||
+ | ===== Instantané VirtualBox ===== | ||
+ | |||
+ | {{Images_Cahier-101-03-004.png? | ||
+ | |||
+ | <WRAP centeralign> | ||
+ | |||
+ | ====== Flectra - Redirection sécurisée ====== | ||
+ | |||
+ | ===== Description ===== | ||
+ | |||
+ | Un grand merci à //Markus Neuberger//, | ||
+ | |||
+ | <WRAP column 46%> | ||
+ | {{Images_Cahier-101-03-006.png? | ||
+ | </ | ||
+ | <WRAP column 46%> | ||
+ | |{{ Images_Cahier-201-07-011.png? | ||
+ | </ | ||
+ | <WRAP clear></ | ||
+ | |||
+ | Contenu du répertoire ''/ | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# ls -als / | ||
+ | |||
+ | total 0 | ||
+ | 0 drwxr-xr-x. 3 root root 25 24 avril 09:46 . | ||
+ | 0 drwxr-xr-x. 4 root root 33 24 avril 09:46 .. | ||
+ | 0 drwxr-xr-x. 3 root root 28 4 janv. 09:16 .well-known | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | ==== Serveur branché directement à l' | ||
+ | |||
+ | Voir la section | ||
+ | [[nethserver_101_cahier_05_vdsl_fqdn_internet_et_nethserver# | ||
+ | du **Cahier-05**: | ||
+ | |||
+ | ===== Préparation pour la demande d'un certificat Let's Encrypt ===== | ||
+ | |||
+ | <WRAP column 22%> | ||
+ | Avant d' | ||
+ | [[nethserver_101_cahier_04_local_certificat_let_encrypt# | ||
+ | du **Cahier-04**: | ||
+ | </ | ||
+ | <WRAP column 70%> | ||
+ | |{{ Images_Cahier-201-07-012.png? | ||
+ | |||
+ | |{{ Images_Cahier-201-07-013.png? | ||
+ | |||
+ | |{{ Images_Cahier-201-07-014.png? | ||
+ | </ | ||
+ | <WRAP clear></ | ||
+ | |||
+ | <WRAP column 22%> | ||
+ | On vérifie le résultat. | ||
+ | |||
+ | On se déconnecte de // | ||
+ | </ | ||
+ | <WRAP column 70%> | ||
+ | |{{ Images_Cahier-201-07-015.png? | ||
+ | </ | ||
+ | <WRAP clear></ | ||
+ | |||
+ | ==== Création d' | ||
+ | |||
+ | <WRAP column 22%> | ||
+ | **Configuration -> DNS ->** onglet | ||
+ | </ | ||
+ | <WRAP column 70%> | ||
+ | |{{ Images_Cahier-201-07-016-A.png? | ||
+ | </ | ||
+ | <WRAP clear></ | ||
+ | |||
+ | <WRAP column 37%> | ||
+ | < | ||
+ | < | ||
+ | |{{ Images_Cahier-201-07-016.png? | ||
+ | </ | ||
+ | <WRAP column 55%> | ||
+ | \\ | ||
+ | On vérifie le résultat. | ||
+ | |{{ Images_Cahier-201-07-017.png? | ||
+ | </ | ||
+ | <WRAP clear></ | ||
+ | |||
+ | <WRAP column 30%> | ||
+ | < | ||
+ | < | ||
+ | |{{ Images_Cahier-201-07-018.png? | ||
+ | </ | ||
+ | <WRAP column 30%> | ||
+ | < | ||
+ | < | ||
+ | |{{ Images_Cahier-201-07-019.png? | ||
+ | </ | ||
+ | <WRAP column 30%> | ||
+ | \\ | ||
+ | On vérifie le résultat. | ||
+ | |{{ Images_Cahier-201-07-020.png? | ||
+ | </ | ||
+ | <WRAP clear></ | ||
+ | |||
+ | ===== Demande d'un certificat de test ===== | ||
+ | |||
+ | On force // | ||
+ | |||
+ | {{Images_icone-201-003_Note.png? | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# / | ||
+ | --issue | ||
+ | --dns dns_cf | ||
+ | -d micronator-dev.org | ||
+ | -d www.micronator-dev.org | ||
+ | -d mail.micronator-dev.org | ||
+ | -d wpad.micronator-dev.org | ||
+ | -d flectra.micronator-dev.org | ||
+ | -d www.flectra.micronator-dev.org | ||
+ | -d mail.flectra.micronator-dev.org | ||
+ | --cert-file / | ||
+ | --ca-file / | ||
+ | --key-file / | ||
+ | --reloadcmd "/ | ||
+ | --force | ||
+ | --test | ||
+ | |||
+ | ... | ||
+ | [jeu. sept. 19 21:50:25 EDT 2019] Installing CA to:/ | ||
+ | [jeu. sept. 19 21:50:25 EDT 2019] Installing key to:/ | ||
+ | [jeu. sept. 19 21:50:25 EDT 2019] Run reload cmd: / | ||
+ | [jeu. sept. 19 21:50:28 EDT 2019] Reload success | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | La demande d'un certificat de test est réussie. | ||
+ | |||
+ | ===== Demande d'un certificat officiel ===== | ||
+ | |||
+ | On //force// le renouvellement pour l' | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# / | ||
+ | --issue | ||
+ | --dns dns_cf | ||
+ | -d micronator-dev.org | ||
+ | -d www.micronator-dev.org | ||
+ | -d mail.micronator-dev.org | ||
+ | -d wpad.micronator-dev.org | ||
+ | -d flectra.micronator-dev.org | ||
+ | -d www.flectra.micronator-dev.org | ||
+ | -d mail.flectra.micronator-dev.org | ||
+ | --cert-file / | ||
+ | --ca-file / | ||
+ | --key-file / | ||
+ | --reloadcmd "/ | ||
+ | --force | ||
+ | |||
+ | ... | ||
+ | [jeu. sept. 19 22:00:57 EDT 2019] Installing cert to:/ | ||
+ | [jeu. sept. 19 22:00:57 EDT 2019] Installing CA to:/ | ||
+ | [jeu. sept. 19 22:00:57 EDT 2019] Installing key to:/ | ||
+ | [jeu. sept. 19 22:00:57 EDT 2019] Run reload cmd: / | ||
+ | [jeu. sept. 19 22:01:00 EDT 2019] Reload success | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | La demande d'un certificat officiel a été couronné de succès. | ||
+ | |||
+ | Vérification du certificat // | ||
+ | |||
+ | <WRAP column 30%> | ||
+ | < | ||
+ | < | ||
+ | |{{ Images_Cahier-201-07-021.png? | ||
+ | </ | ||
+ | <WRAP column 30%> | ||
+ | \\ | ||
+ | **Plus d' | ||
+ | |{{ Images_Cahier-201-07-022.png? | ||
+ | </ | ||
+ | <WRAP column 30%> | ||
+ | < | ||
+ | < | ||
+ | |{{ Images_Cahier-201-07-023.png? | ||
+ | </ | ||
+ | <WRAP clear></ | ||
+ | |||
+ | <WRAP column 46%> | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | |{{ Images_Cahier-201-07-024.png? | ||
+ | </ | ||
+ | <WRAP column 46%> | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | |{{ Images_Cahier-201-07-025.png? | ||
+ | </ | ||
+ | <WRAP clear></ | ||
+ | |||
+ | <WRAP column 46%> | ||
+ | Nous sommes sur un réseau LOCAL et vu que nous n' | ||
+ | |||
+ | <WRAP centeralign>'' | ||
+ | |||
+ | du poste de travail afin qu'il puisse trouver l' | ||
+ | |||
+ | {{Images_Cahier-101-03-006.png? | ||
+ | </ | ||
+ | <WRAP column 46%> | ||
+ | |{{ Images_Cahier-201-07-026.png? | ||
+ | </ | ||
+ | <WRAP clear></ | ||
+ | |||
+ | ===== Redirection par le module Proxy inverse ===== | ||
+ | |||
+ | // | ||
+ | |||
+ | On installe le module //Proxy Inverse// qui s' | ||
+ | |||
+ | <WRAP column 22%> | ||
+ | ==== Installation ==== | ||
+ | |||
+ | **Administration -> Gestionnaire des logiciels ->** onglet **Disponible ->** cocher **Proxy inverse -> AJOUTER**. | ||
+ | </ | ||
+ | <WRAP column 70%> | ||
+ | |{{ Images_Cahier-201-07-027.png? | ||
+ | </ | ||
+ | <WRAP clear></ | ||
+ | |||
+ | <WRAP column 30%> | ||
+ | \\ | ||
+ | **APPLIQUER LES CHANGEMENTS**. | ||
+ | |{{ Images_Cahier-201-07-028.png? | ||
+ | </ | ||
+ | <WRAP column 30%> | ||
+ | \\ | ||
+ | **Recharger la page**. | ||
+ | |{{ Images_Cahier-201-07-029.png? | ||
+ | </ | ||
+ | <WRAP column 30%> | ||
+ | Le nouveau menu //Proxy inverse// est disponible. | ||
+ | |{{ Images_Cahier-201-07-030.png? | ||
+ | </ | ||
+ | <WRAP clear></ | ||
+ | |||
+ | ===== Configuration en mandataire inversé ===== | ||
+ | |||
+ | <WRAP column 46%> | ||
+ | On configure le //Serveur NethServer// | ||
+ | |||
+ | **Passerelle -> Proxy inverse ->** onglet **Hôtes virtuels -> CRÉER NOUVEAU**. | ||
+ | {{ Images_Cahier-201-07-031-D.png? | ||
+ | |||
+ | On entre les informations demandées. | ||
+ | |||
+ | **SOUMETTRE**. | ||
+ | </ | ||
+ | <WRAP column 46%> | ||
+ | |{{ Images_Cahier-201-07-031-B.png? | ||
+ | </ | ||
+ | <WRAP clear></ | ||
+ | |||
+ | <WRAP column 22%> | ||
+ | On vérifie le résultat. | ||
+ | </ | ||
+ | <WRAP column 70%> | ||
+ | |{{ Images_Cahier-201-07-031-C.png? | ||
+ | </ | ||
+ | <WRAP clear></ | ||
+ | |||
+ | ===== Vérification de la connexion redirigée et sécurisée ===== | ||
+ | |||
+ | {{Images_Cahier-101-03-003.png? | ||
+ | |||
+ | On se rend à l'// | ||
+ | |||
+ | <WRAP column 62%> | ||
+ | {{Images_icone-201-003_Note.png? | ||
+ | </ | ||
+ | <WRAP column 30%> | ||
+ | |{{ Images_Cahier-201-07-030-A.png? | ||
+ | </ | ||
+ | <WRAP clear></ | ||
+ | |||
+ | <WRAP column 30%> | ||
+ | < | ||
+ | < | ||
+ | |{{ Images_Cahier-201-07-031.png? | ||
+ | {{Images_icone-201-003_Note.png? | ||
+ | </ | ||
+ | <WRAP column 62%> | ||
+ | \\ | ||
+ | La page d' | ||
+ | |{{ Images_Cahier-201-07-032.png? | ||
+ | </ | ||
+ | <WRAP clear></ | ||
+ | |||
+ | ===== Messagerie électronique ===== | ||
+ | |||
+ | On configure la messagerie électronique pour le domaine // | ||
+ | |||
+ | **Configuration -> Messagerie électronique ->** onglet **Domaines -> CRÉER NOUVEAU ->** on entre les informations demandées **-> SOUMETTRE**. | ||
+ | |||
+ | <WRAP column 46%> | ||
+ | |{{ Images_Cahier-201-07-033.png? | ||
+ | </ | ||
+ | <WRAP column 46%> | ||
+ | |{{ Images_Cahier-201-07-034.png? | ||
+ | </ | ||
+ | <WRAP clear></ | ||
+ | |||
+ | <WRAP column 22%> | ||
+ | On vérifie le résultat. | ||
+ | </ | ||
+ | <WRAP column 70%> | ||
+ | |{{ Images_Cahier-201-07-035.png? | ||
+ | </ | ||
+ | <WRAP clear></ | ||
+ | |||
+ | <WRAP column 46%> | ||
+ | Pour accéder à //Webmail// de ce domaine, | ||
+ | |||
+ | <WRAP centeralign> | ||
+ | **https:// | ||
+ | ou\\ | ||
+ | **https:// | ||
+ | ou\\ | ||
+ | **https:// | ||
+ | </ | ||
+ | </ | ||
+ | <WRAP column 46%> | ||
+ | |{{ Images_Cahier-201-07-036.png? | ||
+ | </ | ||
+ | <WRAP clear></ | ||
+ | |||
+ | ===== Instantané VirtualBox ===== | ||
+ | |||
+ | {{Images_Cahier-101-03-004.png? | ||
+ | \\ | ||
+ | |||
+ | ====== Flectra - Post-scriptum ====== | ||
+ | |||
+ | ===== Vérification du démarrages des services ===== | ||
+ | |||
+ | ==== PostgreSQL ==== | ||
+ | |||
+ | On vérifie son statut. | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# systemctl status postgresql-11 | ||
+ | |||
+ | ● postgresql-11.service - PostgreSQL 11 database server | ||
+ | | ||
+ | | ||
+ | Docs: https:// | ||
+ | Main PID: 3416 (postmaster) | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | sept. 19 21:54:37 tchana.micronator-dev.org systemd[1]: Starting PostgreSQL 11 database .... | ||
+ | sept. 19 21:54:46 tchana.micronator-dev.org postmaster[3416]: | ||
+ | sept. 19 21:54:46 tchana.micronator-dev.org postmaster[3416]: | ||
+ | sept. 19 21:54:47 tchana.micronator-dev.org postmaster[3416]: | ||
+ | sept. 19 21:54:48 tchana.micronator-dev.org postmaster[3416]: | ||
+ | sept. 19 21:54:48 tchana.micronator-dev.org postmaster[3416]: | ||
+ | sept. 19 21:54:51 tchana.micronator-dev.org systemd[1]: Started PostgreSQL 11 database s.... | ||
+ | Hint: Some lines were ellipsized, use -l to show in full. | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | ==== Flectra ==== | ||
+ | |||
+ | On vérifie son statut. | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# systemctl status flectra | ||
+ | |||
+ | ● flectra.service - Flectra | ||
+ | | ||
+ | | ||
+ | Main PID: 4014 (scl) | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | sept. 19 21:54:51 tchana.micronator-dev.org systemd[1]: Started Flectra. | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | ===== Administration de Flectra ===== | ||
+ | |||
+ | Pour administrer // | ||
+ | [[nethserver_201_cahier_07_flectra# | ||
+ | . | ||
+ | |||
+ | ● On se rend à: **https:// | ||
+ | ● On peut aussi utiliser **http:// | ||
+ | |||
+ | <WRAP column 30%> | ||
+ | < | ||
+ | < | ||
+ | |{{ Images_Cahier-201-07-037.png? | ||
+ | </ | ||
+ | <WRAP column 62%> | ||
+ | \\ | ||
+ | La page d' | ||
+ | |{{ Images_Cahier-201-07-037.png? | ||
+ | </ | ||
+ | <WRAP clear></ | ||
+ | |||
+ | ===== Fichiers journaux ===== | ||
+ | |||
+ | ==== PostgreSQL ==== | ||
+ | |||
+ | Le fichier du journal de // | ||
+ | |||
+ | ==== Flectra ==== | ||
+ | |||
+ | Afin de nous assurer que tout a démarré correctement, | ||
+ | |||
+ | - À l'aide de l' | ||
+ | - Directement dans les fichiers ''/ | ||
+ | |||
+ | ==== Fichier / | ||
+ | |||
+ | On peut aussi utiliser la console du serveur pour vérifier le journal de //Flectra// afin de s' | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# cat / | ||
+ | |||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | S'il y avait un module manquant, il apparaîtrait ici. | ||
+ | |||
+ | === Installation d'un module manquant === | ||
+ | |||
+ | __Exemple__ si le module // | ||
+ | |||
+ | On vérifie le journal. | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# cat / | ||
+ | |||
+ | 2019-05-29 17: | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | On se substitue à l' | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# su - flectra | ||
+ | |||
+ | Dernière connexion : mercredi 22 mai 2019 à 00:12:34 EDT sur pts/1 | ||
+ | [flectra@tchana ~]$ | ||
+ | </ | ||
+ | |||
+ | On active // | ||
+ | |||
+ | < | ||
+ | [flectra@tchana ~]$ scl enable rh-python36 bash | ||
+ | |||
+ | [flectra@tchana ~]$ | ||
+ | </ | ||
+ | |||
+ | On s' | ||
+ | |||
+ | < | ||
+ | [flectra@tchana ~]$ pwd | ||
+ | |||
+ | / | ||
+ | [flectra@tchana ~]$ | ||
+ | </ | ||
+ | |||
+ | On active l' | ||
+ | |||
+ | < | ||
+ | [flectra@tchana ~]$ source flectra-venv/ | ||
+ | |||
+ | (flectra-venv) [flectra@tchana ~]$ | ||
+ | </ | ||
+ | |||
+ | On installe le module // | ||
+ | |||
+ | < | ||
+ | (flectra-venv) [flectra@tchana ~]$ pip3 install phonenumbers | ||
+ | |||
+ | Collecting phonenumbers | ||
+ | Downloading https:// | ||
+ | 100% |████████████████████████████████| 2.6MB 359kB/s | ||
+ | Installing collected packages: phonenumbers | ||
+ | Successfully installed phonenumbers-8.10.12 | ||
+ | You are using pip version 9.0.1, however version 19.1.1 is available. | ||
+ | You should consider upgrading via the 'pip install --upgrade pip' command. | ||
+ | (flectra-venv) [flectra@tchana ~]$ | ||
+ | </ | ||
+ | |||
+ | On désactive l' | ||
+ | |||
+ | < | ||
+ | (flectra-venv) [flectra@tchana ~]$ deactivate && exit | ||
+ | |||
+ | exit | ||
+ | [flectra@tchana ~]$ | ||
+ | </ | ||
+ | |||
+ | On vérifie qui nous sommes. | ||
+ | |||
+ | < | ||
+ | [flectra@tchana ~]$ whoami | ||
+ | |||
+ | flectra | ||
+ | [flectra@tchana ~]$ | ||
+ | </ | ||
+ | |||
+ | On quitte la substitution d' | ||
+ | |||
+ | < | ||
+ | [flectra@tchana ~]$ exit | ||
+ | |||
+ | déconnexion | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | On vérifie qui nous sommes. | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# whoami | ||
+ | |||
+ | root | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | {{Images_icone-201-003_Note.png? | ||
+ | |||
+ | On redémarre // | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# systemctl restart flectra | ||
+ | |||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | On vérifie le journal. | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# cat / | ||
+ | |||
+ | 2019-05-29 17: | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | Il n' | ||
+ | |||
+ | On vérifie pour des erreurs. | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# cat / | ||
+ | |||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | On vérifie pour des avertissements. | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# cat / | ||
+ | |||
+ | 2019-05-29 16: | ||
+ | 2019-05-29 16: | ||
+ | 2019-05-29 16: | ||
+ | 2019-05-29 16: | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | {{Images_icone-201-003_Note.png? | ||
+ | |||
+ | ===== Changements de mots de passe ===== | ||
+ | |||
+ | ==== Utilisateur flectra de PostgreSQL ==== | ||
+ | |||
+ | Vous pouvez trouver le mot de passe de l' | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# cat / | ||
+ | |||
+ | db_password = fghtbgh | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | Si le mot de passe a été perdu ou piraté, on doit changer le mot de passe de l' | ||
+ | |||
+ | - à la console du //Serveur NethServer//, | ||
+ | - à la console de // | ||
+ | - dans le fichier ''/ | ||
+ | |||
+ | === À la console du Serveur NethServer === | ||
+ | |||
+ | On change le mot de passe Linux de l' | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# passwd flectra | ||
+ | |||
+ | Changement de mot de passe pour l' | ||
+ | Nouveau mot de passe : nouveau-mot-de-passe-pour-flectra | ||
+ | MOT DE PASSE INCORRECT : Le mot de passe comporte moins de 8 caractères | ||
+ | Retapez le nouveau mot de passe : nouveau-mot-de-passe-pour-flectra | ||
+ | passwd : mise à jour réussie de tous les jetons d' | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | L' | ||
+ | {{Images_Cahier-101-03-008.png? | ||
+ | {{Images_Cahier-101-03-006.png? | ||
+ | |||
+ | === A la console de PostgreSQL === | ||
+ | |||
+ | Il faut se substituer au super-utilisateur **__postgres__**, | ||
+ | |||
+ | À la console du serveur, on se substitue à l' | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# su - postgres | ||
+ | |||
+ | -bash-4.2$ | ||
+ | </ | ||
+ | |||
+ | On vérifie. | ||
+ | |||
+ | < | ||
+ | -bash-4.2$ whoami | ||
+ | |||
+ | postgres | ||
+ | -bash-4.2$ | ||
+ | </ | ||
+ | |||
+ | L' | ||
+ | |||
+ | < | ||
+ | -bash-4.2$ psql | ||
+ | |||
+ | psql (11.3)) | ||
+ | Saisissez « help » pour l' | ||
+ | |||
+ | postgres=# | ||
+ | </ | ||
+ | |||
+ | On change le mot de passe de l' | ||
+ | |||
+ | < | ||
+ | postgres=# ALTER ROLE flectra WITH PASSWORD ' | ||
+ | |||
+ | ALTER ROLE | ||
+ | postgres=# | ||
+ | </ | ||
+ | |||
+ | On quitte la console // | ||
+ | |||
+ | < | ||
+ | postgres=# \q | ||
+ | |||
+ | -bash-4.2$ | ||
+ | </ | ||
+ | |||
+ | On retourne à l' | ||
+ | |||
+ | < | ||
+ | -bash-4.2$ exit | ||
+ | |||
+ | déconnexion | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | On vérifie. | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# whoami | ||
+ | |||
+ | root | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | === Dans le fichier / | ||
+ | |||
+ | {{Images_Cahier-101-03-006.png? | ||
+ | |||
+ | On édite le fichier ''/ | ||
+ | |||
+ | On vérifie. | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# cat / | ||
+ | |||
+ | db_password = fghtbgh | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | === Redémarrage de PostgreSQL === | ||
+ | |||
+ | On redémarre le service // | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# systemctl restart postgresql-11 | ||
+ | |||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | On vérifie. | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# systemctl status postgresql-11 | ||
+ | |||
+ | ● postgresql-11.service - PostgreSQL 11 database server | ||
+ | | ||
+ | | ||
+ | Docs: https:// | ||
+ | Process: 14467 ExecStartPre=/ | ||
+ | Main PID: 14473 (postmaster) | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | sept. 20 11:35:04 tchana.micronator-dev.org systemd[1]: Stopped PostgreSQL 11 database s.... | ||
+ | sept. 20 11:35:04 tchana.micronator-dev.org systemd[1]: Starting PostgreSQL 11 database .... | ||
+ | sept. 20 11:35:04 tchana.micronator-dev.org postmaster[14473]: | ||
+ | sept. 20 11:35:04 tchana.micronator-dev.org postmaster[14473]: | ||
+ | sept. 20 11:35:04 tchana.micronator-dev.org postmaster[14473]: | ||
+ | sept. 20 11:35:04 tchana.micronator-dev.org postmaster[14473]: | ||
+ | sept. 20 11:35:04 tchana.micronator-dev.org postmaster[14473]: | ||
+ | sept. 20 11:35:04 tchana.micronator-dev.org systemd[1]: Started PostgreSQL 11 database s.... | ||
+ | Hint: Some lines were ellipsized, use -l to show in full. | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | === Redémarrage de Flectra === | ||
+ | |||
+ | On redémarre le service Flectra. | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# systemctl restart flectra | ||
+ | |||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | On vérifie. | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# systemctl status flectra | ||
+ | |||
+ | ● flectra.service - Flectra | ||
+ | | ||
+ | | ||
+ | Main PID: 14599 (scl) | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | sept. 20 11:36:23 tchana.micronator-dev.org systemd[1]: Started Flectra. | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | {{Images_Cahier-101-03-006.png? | ||
+ | |||
+ | ==== Super-utilisateur de PostgreSQL ==== | ||
+ | |||
+ | Si le mot de passe a été perdu ou piraté, on doit changer le mot de passe du super utilisateur // | ||
+ | |||
+ | Vous pouvez trouver le mot de passe du super utilisateur // | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# cat / | ||
+ | |||
+ | admin_passwd = fghtbgh | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | Si on veut changer le mot de passe du super utilisateur // | ||
+ | |||
+ | - à la console du //Serveur NethServer//, | ||
+ | - à la console de // | ||
+ | - dans le fichier ''/ | ||
+ | |||
+ | === À la console du Serveur NethServer === | ||
+ | |||
+ | On vérifie si nous sommes **__root__**. | ||
+ | |||
+ | < | ||
+ | root@tchana ~]# whoami | ||
+ | |||
+ | root | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | On change le mot de passe Linux du super-utilisateur **__postgres__**. | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# passwd postgres | ||
+ | |||
+ | Changement de mot de passe pour l' | ||
+ | Entrez le nouveau mot de passe UNIX : nouveau-mot-de-passe-pour-postgres | ||
+ | Retapez le nouveau mot de passe UNIX : nouveau-mot-de-passe-pour-postgres | ||
+ | passwd : mise à jour réussie de tous les jetons d' | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | === À la console de PostgreSQL === | ||
+ | |||
+ | On se substitue au super-utilisateur **__postgres__**. | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# su - postgres | ||
+ | |||
+ | Dernière connexion : dimanche 19 mai 2019 à 13:14:13 EDT sur pts/0 | ||
+ | -bash-4.2$ | ||
+ | </ | ||
+ | |||
+ | On ouvre la console // | ||
+ | |||
+ | < | ||
+ | -bash-4.2$ psql | ||
+ | |||
+ | psql (11.3) | ||
+ | Saisissez « help » pour l' | ||
+ | |||
+ | postgres=# | ||
+ | </ | ||
+ | |||
+ | On change le mot de passe du super-utilisateur **__postgres__**. | ||
+ | |||
+ | < | ||
+ | postgres=# \password | ||
+ | |||
+ | Saisissez le nouveau mot de passe : nouveau-mot-de-passe-du-super-utilisateur | ||
+ | Saisissez-le à nouveau : nouveau-mot-de-passe-du-super-utilisateur | ||
+ | postgres=# | ||
+ | </ | ||
+ | |||
+ | On sort de la console // | ||
+ | |||
+ | < | ||
+ | postgres=# \q | ||
+ | |||
+ | -bash-4.2$ | ||
+ | </ | ||
+ | |||
+ | On retourne à l' | ||
+ | |||
+ | < | ||
+ | -bash-4.2$ exit | ||
+ | |||
+ | déconnexion | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | === Dans le fichier / | ||
+ | |||
+ | On édite le fichier ''/ | ||
+ | |||
+ | On vérifie. | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# cat / | ||
+ | |||
+ | admin_passwd = fghtbgh | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | === Redémarrage de PostgreSQL === | ||
+ | |||
+ | On redémarre // | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# systemctl restart postgresql-11 | ||
+ | |||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | On vérifie. | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# systemctl status postgresql-11 | ||
+ | |||
+ | ● postgresql-11.service - PostgreSQL 11 database server | ||
+ | | ||
+ | | ||
+ | Docs: https:// | ||
+ | Process: 14956 ExecStartPre=/ | ||
+ | Main PID: 14961 (postmaster) | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | sept. 20 11:42:07 tchana.micronator-dev.org systemd[1]: Stopped PostgreSQL 11 database s.... | ||
+ | sept. 20 11:42:07 tchana.micronator-dev.org systemd[1]: Starting PostgreSQL 11 database .... | ||
+ | sept. 20 11:42:07 tchana.micronator-dev.org postmaster[14961]: | ||
+ | sept. 20 11:42:07 tchana.micronator-dev.org postmaster[14961]: | ||
+ | sept. 20 11:42:07 tchana.micronator-dev.org postmaster[14961]: | ||
+ | sept. 20 11:42:07 tchana.micronator-dev.org postmaster[14961]: | ||
+ | sept. 20 11:42:07 tchana.micronator-dev.org postmaster[14961]: | ||
+ | sept. 20 11:42:07 tchana.micronator-dev.org systemd[1]: Started PostgreSQL 11 database s.... | ||
+ | Hint: Some lines were ellipsized, use -l to show in full. | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | === Redémarrage de Flectra === | ||
+ | |||
+ | On redémarre le service // | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# systemctl restart flectra | ||
+ | |||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | On vérifie. | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# systemctl status flectra | ||
+ | |||
+ | ● flectra.service - Flectra | ||
+ | | ||
+ | | ||
+ | Main PID: 15032 (scl) | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | sept. 20 11:42:54 tchana.micronator-dev.org systemd[1]: Stopped Flectra. | ||
+ | sept. 20 11:42:54 tchana.micronator-dev.org systemd[1]: Started Flectra. | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | {{Images_Cahier-101-03-006.png? | ||
+ | |||
+ | ==== Administrateur Flectra ==== | ||
+ | |||
+ | Si le mot de passe a été perdu ou piraté, on doit changer le mot de passe de l' | ||
+ | [[nethserver_201_cahier_07_flectra# | ||
+ | . | ||
+ | |||
+ | <WRAP column 20%> | ||
+ | |{{ Images_Cahier-201-07-039.png? | ||
+ | </ | ||
+ | <WRAP column 30%> | ||
+ | |{{ Images_Cahier-201-07-040.png? | ||
+ | </ | ||
+ | <WRAP column 40%> | ||
+ | |{{ Images_Cahier-201-07-041.png? | ||
+ | </ | ||
+ | <WRAP clear></ | ||
+ | |||
+ | On se déconnecte de //Flectra// et on se reconnecte avec le nouveau mot de passe. | ||
+ | |||
+ | <WRAP column 30%> | ||
+ | On se connecte. | ||
+ | |{{ Images_Cahier-201-07-042.png? | ||
+ | </ | ||
+ | <WRAP column 62%> | ||
+ | La page d' | ||
+ | |{{ Images_Cahier-201-07-043.png? | ||
+ | </ | ||
+ | <WRAP clear></ | ||
+ | |||
+ | Le nouveau mot de passe de l' | ||
+ | |||
+ | ===== Logo de la société ===== | ||
+ | |||
+ | Il est toujours intéressant d' | ||
+ | |||
+ | <WRAP column 30%> | ||
+ | \\ | ||
+ | **Configuration -> Sociétés -> Modifier**. | ||
+ | |{{ Images_Cahier-201-07-044.png? | ||
+ | </ | ||
+ | <WRAP column 30%> | ||
+ | On survole avec la souris pour faire apparaître le **crayon** qu'on clique. | ||
+ | |{{ Images_Cahier-201-07-045.png? | ||
+ | </ | ||
+ | <WRAP column 30%> | ||
+ | On choisit l' | ||
+ | |{{ Images_Cahier-201-07-046.png? | ||
+ | </ | ||
+ | <WRAP clear></ | ||
+ | |||
+ | <WRAP column 30%> | ||
+ | On entre le nom de notre société **-> Sauvegarder**. | ||
+ | |{{ Images_Cahier-201-07-047.png? | ||
+ | </ | ||
+ | <WRAP column 30%> | ||
+ | On rafraîchie la page et notre logo apparaît. | ||
+ | |{{ Images_Cahier-201-07-048.png? | ||
+ | </ | ||
+ | <WRAP column 30%> | ||
+ | Notre logo s' | ||
+ | |{{ Images_Cahier-201-07-049.png? | ||
+ | </ | ||
+ | <WRAP clear></ | ||
+ | |||
+ | ====== Sauvegarde/ | ||
+ | |||
+ | ===== Description ===== | ||
+ | |||
+ | {{Images_Cahier-101-03-004.png? | ||
+ | |||
+ | Ce script sera lancé par une tâche '' | ||
+ | |||
+ | ===== Répertoire de sauvegarde ===== | ||
+ | |||
+ | Tout ce qui a trait à la sauvegarde de la //BD// //Flectra// de // | ||
+ | |||
+ | * Le propriétaire et le groupe du répertoire seront **postgres: | ||
+ | * Le fichier de la nouvelle sauvegarde sera: | ||
+ | * généré et écrasera la sauvegarde précédente et | ||
+ | * sécurisé par le script en changeant le propriétaire et le groupe pour **root: | ||
+ | \\ | ||
+ | |||
+ | On crée le répertoire. | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# mkdir / | ||
+ | |||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | On change le propriétaire et le groupe. | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# chown postgres: | ||
+ | |||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | On ajuste tous les droits afin que seul l' | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# chmod 700 / | ||
+ | |||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | On vérifie. | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# ls -alsd / | ||
+ | |||
+ | 0 drwx------ 2 postgres postgres 6 20 sept. 14:46 / | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | ===== Script de sauvegarde PostgreSQL ===== | ||
+ | |||
+ | {{Images_Cahier-101-03-006.png? | ||
+ | |||
+ | < | ||
+ | cat > / | ||
+ | #!/bin/sh | ||
+ | |||
+ | # Script pour générer une sauvegarde de la BD PostgreSQL de Flectra. | ||
+ | # Michel-André 2018-09-17_11h16 / modifié le 19 septembre pour Flectra | ||
+ | |||
+ | # vars | ||
+ | TEMPS_DE_PAUSE=10 | ||
+ | REP_SAUVEGARDE=/ | ||
+ | NOM_BD_FLECTRA=Flectra | ||
+ | FORMAT_FICHIER=dump | ||
+ | |||
+ | # On vérifie que flectra-server est en cours d' | ||
+ | if (!(/ | ||
+ | # Message au système et à la console | ||
+ | /bin/logger " | ||
+ | /bin/logger " | ||
+ | /bin/echo " | ||
+ | |||
+ | # On relance server-flectra pour la sauvegarde de la BD $NOM_BD_FLECTRA | ||
+ | / | ||
+ | /bin/logger " | ||
+ | /bin/logger " | ||
+ | /bin/echo " | ||
+ | |||
+ | # Message au système et à la console | ||
+ | /bin/logger "Pause de $TEMPS_DE_PAUSE secondes pour le démarrage de Flectra" | ||
+ | /bin/echo "Pause de $TEMPS_DE_PAUSE secondes pour le démarrage de Flectra" | ||
+ | |||
+ | # On fait une pause de $TEMPS_DE_PAUSE secondes pour le démarrage de Flectra. | ||
+ | /bin/sleep $TEMPS_DE_PAUSE | ||
+ | fi | ||
+ | |||
+ | /bin/logger " | ||
+ | /bin/logger " | ||
+ | /bin/echo " | ||
+ | |||
+ | # On sauvegarde la BD dans $REP_SAUVEGARDE/ | ||
+ | # La sauvegarde du jour écrase la sauvegarde du jour précédent. | ||
+ | |||
+ | # On sauvegarde la BD | ||
+ | su - postgres -c '/ | ||
+ | |||
+ | # On sécurise le fichier de $NOM_BD_FLECTRA.$FORMAT_FICHIER. | ||
+ | /bin/chown root:root $REP_SAUVEGARDE/ | ||
+ | /bin/chmod 700 $REP_SAUVEGARDE/ | ||
+ | |||
+ | # On écrit une entrée dans le journal du système. | ||
+ | /bin/logger "La sauvegarde de la BD $NOM_BD_FLECTRA est dans: $REP_SAUVEGARDE/ | ||
+ | /bin/logger " | ||
+ | /bin/echo "La sauvegarde de la BD $NOM_BD_FLECTRA est dans: $REP_SAUVEGARDE/ | ||
+ | exit 1 | ||
+ | |||
+ | EOT | ||
+ | |||
+ | |||
+ | </ | ||
+ | |||
+ | {{Images_icone-201-003_Note.png? | ||
+ | |||
+ | On vérifie les premières lignes du fichier. | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# head -n7 / | ||
+ | |||
+ | #!/bin/sh | ||
+ | |||
+ | # Script pour générer une sauvegarde de la BD PostgreSQL de Flectra. | ||
+ | # Michel-André 2018-09-17_11h16 / modifié le 19 septembre pour Flectra | ||
+ | |||
+ | # vars | ||
+ | TEMPS_DE_PAUSE=10 | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | {{Images_Cahier-101-03-006.png? | ||
+ | |||
+ | On sécurise le fichier en changeant le groupe et le propriétaire. | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# chown root:root / | ||
+ | |||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | On ajuste les droits pour rendre le fichier exécutable par l' | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# chmod 700 / | ||
+ | |||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | On vérifie. | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# ls -als / | ||
+ | |||
+ | 4 -rwx------ 1 root root 2273 20 sept. 15:51 / | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | ===== Sauvegarde ===== | ||
+ | |||
+ | ==== Vérification du script de sauvegarde ==== | ||
+ | |||
+ | {{Images_Cahier-101-03-003.png? | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# / | ||
+ | |||
+ | | ||
+ | flectra-server est en cours d' | ||
+ | % Total % Received % Xferd Average Speed | ||
+ | | ||
+ | 100 3604k 0 3603k 100 | ||
+ | La sauvegarde de la BD Flectra est dans: / | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | On vérifie le fichier de sauvegarde pour s' | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# ls -ls / | ||
+ | |||
+ | 3604 -rwx------ 1 root root 3690361 20 sept. 15:40 / | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | {{Images_icone-201-003_Note.png? | ||
+ | |||
+ | ==== Journal du Serveur NethServer ==== | ||
+ | |||
+ | <WRAP box> | ||
+ | < | ||
+ | ... | ||
+ | Sep 20 15:40:27 tchana root: ******************** | ||
+ | Sep 20 15:40:27 tchana root: flectra-server est en cours d' | ||
+ | Sep 20 15:40:30 tchana root: La sauvegarde de la BD Flectra est dans: / | ||
+ | Sep 20 15:40:30 tchana root: ******************** | ||
+ | ... | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | ==== Si flectra-server n'est pas en exécution (arrêté) ==== | ||
+ | |||
+ | {{Images_Cahier-101-03-006.png? | ||
+ | |||
+ | === Vérification === | ||
+ | |||
+ | On affiche le status de // | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# systemctl status flectra | ||
+ | |||
+ | ● flectra.service - Flectra | ||
+ | | ||
+ | | ||
+ | Main PID: 3591 (scl) | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | sept. 20 15:40:27 tchana.micronator-dev.org systemd[1]: Started Flectra. | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | On arrête // | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# systemctl stop flectra | ||
+ | |||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | On vérifie. | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# systemctl status flectra | ||
+ | |||
+ | ● flectra.service - Flectra | ||
+ | | ||
+ | | ||
+ | Process: 3591 ExecStart=/ | ||
+ | Main PID: 3591 (code=killed, | ||
+ | |||
+ | sept. 20 15:40:27 tchana.micronator-dev.org systemd[1]: Started Flectra. | ||
+ | sept. 20 15:58:56 tchana.micronator-dev.org systemd[1]: Stopping Flectra... | ||
+ | sept. 20 15:58:57 tchana.micronator-dev.org systemd[1]: Stopped Flectra. | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | On relance le script de sauvegarde. | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# / | ||
+ | |||
+ | flectra-server N'EST PAS en cours d' | ||
+ | flectra-server est relancé | ||
+ | Pause de 10 secondes pour le démarrage de Flectra | ||
+ | flectra-server est en cours d' | ||
+ | % Total % Received % Xferd Average Speed | ||
+ | | ||
+ | 100 3604k 0 3603k 100 | ||
+ | La sauvegarde de la BD Flectra est dans: / | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | On vérifie le statut de // | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# systemctl status flectra | ||
+ | |||
+ | ● flectra.service - Flectra | ||
+ | | ||
+ | | ||
+ | Main PID: 4867 (scl) | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | sept. 20 15:59:42 tchana.micronator-dev.org systemd[1]: Started Flectra. | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | {{Images_Cahier-101-03-006.png? | ||
+ | |||
+ | On vérifie le fichier de sauvegarde pour s' | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# ls -ls / | ||
+ | |||
+ | 3604 -rwx------ 1 root root 3690361 20 sept. 15:59 / | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | ==== Inclusion du répertoire dans la sauvegarde de NethServer ==== | ||
+ | |||
+ | On vérifie si le nom du répertoire ''/ | ||
+ | |||
+ | {{Images_Cahier-101-03-006.png? | ||
+ | |||
+ | < | ||
+ | NouvelleInclusion="/ | ||
+ | if grep -Fxq " | ||
+ | then | ||
+ | # L' | ||
+ | echo -e "\nLe fichier custom.include contient déjà l' | ||
+ | else | ||
+ | # L' | ||
+ | echo -e " | ||
+ | echo -e " | ||
+ | fi | ||
+ | |||
+ | </ | ||
+ | |||
+ | {{Images_icone-201-003_Note.png? | ||
+ | |||
+ | On vérifie. | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# cat / | ||
+ | |||
+ | / | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | Ci-dessus, il n'y a pas de ligne vide avant __/ | ||
+ | |||
+ | ===== Tâche cron ===== | ||
+ | |||
+ | On crée une tâche //cron// qui s' | ||
+ | |||
+ | ==== Répertoire pour un gabarit personnalisé ==== | ||
+ | |||
+ | Création du répertoire. | ||
+ | |||
+ | {{Images_Cahier-101-03-006.png? | ||
+ | |||
+ | < | ||
+ | DIR="/ | ||
+ | for NAME in $DIR | ||
+ | do | ||
+ | if [ ! -d $NAME ]; then | ||
+ | mkdir -p $NAME | ||
+ | chown flectra.flectra $NAME | ||
+ | chmod 770 $NAME | ||
+ | fi | ||
+ | done | ||
+ | |||
+ | </ | ||
+ | |||
+ | On vérifie. | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# ls -alsd / | ||
+ | |||
+ | 0 drwxrwx--- 2 flectra flectra 6 20 sept. 16:04 / | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | ==== Création de la tâche cron ==== | ||
+ | |||
+ | On crée le fichier de la tâche //cron// et on y insère son contenu. Elle s' | ||
+ | |||
+ | {{Images_Cahier-101-03-006.png? | ||
+ | |||
+ | < | ||
+ | cat > / | ||
+ | SHELL=/ | ||
+ | MAILTO=root | ||
+ | # | ||
+ | # Tâche cron qui lance / | ||
+ | # de sauvegarder la BD de Flectra. Cette tâche cron roulera quotidiennement à 02h30. | ||
+ | |||
+ | # Michel-André, | ||
+ | |||
+ | # ┌───────────── min (0 - 59) | ||
+ | # │ ┌────────────── heure (0 - 23) | ||
+ | # │ │ ┌─────────────── jour du mois (1 - 31) | ||
+ | # │ │ │ ┌──────────────── mois (1 - 12) | ||
+ | # │ │ │ │ ┌───────────────── jour de la semaine (0 - 6) (0 à 6 sont de dimanche à samedi, | ||
+ | # │ │ │ │ │ 7 est dimanche, même que 0) | ||
+ | # │ │ │ │ │ | ||
+ | # * * * * * [utilisateur] commande à exécuter | ||
+ | # | ||
+ | 0 2 * * * root / | ||
+ | |||
+ | EOT | ||
+ | |||
+ | |||
+ | </ | ||
+ | |||
+ | {{Images_icone-201-003_Note.png? | ||
+ | |||
+ | On vérifie le contenu du fichier de la tâche. | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# cat / | ||
+ | |||
+ | SHELL=/ | ||
+ | MAILTO=root | ||
+ | # | ||
+ | # Tâche cron qui lance / | ||
+ | # de sauvegarder la BD de Flectra. Cette tâche cron roulera quotidiennement à 02h30. | ||
+ | |||
+ | # Michel-André, | ||
+ | |||
+ | # ┌───────────── min (0 - 59) | ||
+ | # │ ┌────────────── heure (0 - 23) | ||
+ | # │ │ ┌─────────────── jour du mois (1 - 31) | ||
+ | # │ │ │ ┌──────────────── mois (1 - 12) | ||
+ | # │ │ │ │ ┌───────────────── jour de la semaine (0 - 6) (0 à 6 sont de dimanche à samedi, | ||
+ | # │ │ │ │ │ 7 est dimanche, même que 0) | ||
+ | # │ │ │ │ │ | ||
+ | # * * * * * [utilisateur] commande à exécuter | ||
+ | # | ||
+ | 0 2 * * * root / | ||
+ | |||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | {{Images_Cahier-101-03-006.png? | ||
+ | |||
+ | On sécurise le fichier. | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# chmod 700 / | ||
+ | |||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | On vérifie | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# ls -ls / | ||
+ | |||
+ | 4 -rwx------ 1 root root 860 20 sept. 16:05 / | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | On développe le gabarit personnalisé. | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# / | ||
+ | |||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | On redémarre le démon '' | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# systemctl restart crond | ||
+ | |||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | ==== Vérification de la tâche cron ==== | ||
+ | |||
+ | On modifie l' | ||
+ | |||
+ | On change l' | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# sed -i 's/^0 2/\* \*/' / | ||
+ | |||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | On vérifie. | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# tail -n3 / | ||
+ | |||
+ | # | ||
+ | * * * * * root / | ||
+ | |||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | On développe le gabarit personnalisé. | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# / | ||
+ | |||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | On redémarre le démon '' | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# systemctl restart crond | ||
+ | |||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | === Suivi === | ||
+ | |||
+ | On lance la commande ci-dessous pour suivre toutes les tâches //cron// et on filtre avec '' | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# tail -F / | ||
+ | |||
+ | |||
+ | </ | ||
+ | |||
+ | À toutes les minutes, on voit notre tâche s' | ||
+ | |||
+ | <WRAP box> | ||
+ | < | ||
+ | ... | ||
+ | Sep 20 16:08:02 tchana root: La sauvegarde de la BD Flectra est dans: / | ||
+ | Sep 20 16:09:04 tchana root: La sauvegarde de la BD Flectra est dans: / | ||
+ | Sep 20 16:10:03 tchana root: La sauvegarde de la BD Flectra est dans: / | ||
+ | ... | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | On arrête la commande tail avec <wrap em> | ||
+ | |||
+ | < | ||
+ | ... | ||
+ | Sep 20 16:10:03 tchana root: La sauvegarde de la BD Flectra est dans: / | ||
+ | ^C | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | === Vérification lorsque Flectra est arrêté === | ||
+ | |||
+ | On arrête // | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# systemctl stop flectra | ||
+ | |||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | On relance la commande '' | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# tail -F / | ||
+ | |||
+ | |||
+ | </ | ||
+ | |||
+ | À toutes les minutes, on voit notre tâche s' | ||
+ | |||
+ | < | ||
+ | ... | ||
+ | May 20 17:24:03 tchana root: La sauvegarde de la BD Flectra est dans: / | ||
+ | ... | ||
+ | </ | ||
+ | |||
+ | On arrête la commande tail avec <wrap em> | ||
+ | |||
+ | < | ||
+ | ... | ||
+ | May 20 17:24:03 tchana root: La sauvegarde de la BD Flectra est dans: / | ||
+ | ^C | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | On remet l' | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# sed -i 's/\* \* \* \* \* root/0 2 \* \* \* root/' | ||
+ | / | ||
+ | |||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | On vérifie. | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# tail -n3 / | ||
+ | |||
+ | # | ||
+ | * 2 * * * * root / | ||
+ | |||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | On développe le gabarit personnalisé. | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# / | ||
+ | |||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | On redémarre le démon '' | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# systemctl restart crond | ||
+ | |||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | ==== Courriel de notification ==== | ||
+ | |||
+ | L' | ||
+ | |||
+ | On se rend à l'// | ||
+ | |||
+ | <WRAP column 30%> | ||
+ | |{{ Images_Cahier-201-07-050.png? | ||
+ | </ | ||
+ | <WRAP column 62%> | ||
+ | |{{ Images_Cahier-201-07-051.png? | ||
+ | </ | ||
+ | <WRAP clear></ | ||
+ | |||
+ | |||
+ | ==== Inclusion du script dans la sauvegarde de NethServer ==== | ||
+ | |||
+ | On vérifie si le nom du répertoire ''/ | ||
+ | |||
+ | {{Images_Cahier-101-03-006.png? | ||
+ | |||
+ | < | ||
+ | NouvelleInclusion="/ | ||
+ | if grep -Fxq " | ||
+ | then | ||
+ | # L' | ||
+ | echo -e "\nLe fichier custom.include contient déjà l' | ||
+ | else | ||
+ | # L' | ||
+ | echo -e " | ||
+ | echo -e " | ||
+ | fi | ||
+ | |||
+ | </ | ||
+ | |||
+ | On vérifie. | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# cat / | ||
+ | |||
+ | / | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | <WRAP centeralign> | ||
+ | |||
+ | ===== Suppression du logo ===== | ||
+ | |||
+ | Pour s' | ||
+ | |||
+ | <WRAP column 30%> | ||
+ | **Configuration -> Sociétés ->** on clique le **nom de notre société**. | ||
+ | |{{ Images_Cahier-201-07-052.png? | ||
+ | </ | ||
+ | <WRAP column 30%> | ||
+ | \\ | ||
+ | **Modifier**. | ||
+ | |{{ Images_Cahier-201-07-053.png? | ||
+ | </ | ||
+ | <WRAP column 30%> | ||
+ | On survole le logo avec la souris pour faire apparaître la **corbeille** qu'on clique. | ||
+ | |{{ Images_Cahier-201-07-054.png? | ||
+ | </ | ||
+ | <WRAP clear></ | ||
+ | |||
+ | <WRAP column 30%> | ||
+ | < | ||
+ | |||
+ | < | ||
+ | </ | ||
+ | <WRAP column 30%> | ||
+ | |{{ Images_Cahier-201-07-055.png? | ||
+ | </ | ||
+ | <WRAP column 30%> | ||
+ | |{{ Images_Cahier-201-07-056.png? | ||
+ | </ | ||
+ | <WRAP clear></ | ||
+ | |||
+ | ===== Récupération du fichier de sauvegarde ===== | ||
+ | |||
+ | On peut choisir le fichier de sauvegarde qu'on veut restaurer. | ||
+ | |||
+ | - ''/ | ||
+ | - '' | ||
+ | |||
+ | ==== / | ||
+ | |||
+ | La dernière sauvegarde // | ||
+ | |||
+ | ==== Flectra dump depuis une sauvegarde NethServer ==== | ||
+ | |||
+ | On peut récupérer un fichier de sauvegarde // | ||
+ | |||
+ | On s' | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# / | ||
+ | |||
+ | Fri Sep 20 16:12:14 2019 var/ | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | Le fichier '' | ||
+ | |||
+ | <WRAP column 46%> | ||
+ | **Configuration -> Restaurer les données**. | ||
+ | |||
+ | **//Backup file//** -> On choisit la sauvegarde désirée. | ||
+ | |||
+ | ⦿ **// | ||
+ | On peut choisir la destination de la récupération. | ||
+ | |||
+ | **// | ||
+ | |||
+ | On sélectionne le répertoire: | ||
+ | |||
+ | **// | ||
+ | |||
+ | **RESTAURER**. | ||
+ | </ | ||
+ | <WRAP column 46%> | ||
+ | |{{ Images_Cahier-201-07-057.png? | ||
+ | </ | ||
+ | <WRAP clear></ | ||
+ | |||
+ | <WRAP column 46%> | ||
+ | Le répertoire a été trouvé et restauré à sa position initiale. | ||
+ | </ | ||
+ | <WRAP column 46%> | ||
+ | |{{ Images_Cahier-201-07-058.png? | ||
+ | </ | ||
+ | <WRAP clear></ | ||
+ | |||
+ | On vérifie. | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# ls -als / | ||
+ | |||
+ | 3604 -rwx------ 1 root root 3690361 20 sept. 15:59 / | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | Le fichier est bien celui de la sauvegarde que nous avons lancée manuellement le 20 septembre.\\ | ||
+ | {{Images_icone-201-003_Note.png? | ||
+ | |||
+ | ===== Suppression de la base de données actuelle ===== | ||
+ | |||
+ | On vérifie si le service //Flectra// est en cours d' | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# systemctl status flectra | ||
+ | |||
+ | ● flectra.service - Flectra | ||
+ | | ||
+ | | ||
+ | Main PID: 5802 (scl) | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | sept. 20 16:12:01 tchana.micronator-dev.org systemd[1]: Started Flectra. | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | ==== Arrêt de Flectra ==== | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# systemctl stop flectra | ||
+ | |||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | On vérifie. | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# systemctl status flectra | grep Active | ||
+ | |||
+ | | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | ==== Suppression de la BD actuelle ==== | ||
+ | |||
+ | On se substitue à l' | ||
+ | |||
+ | < | ||
+ | root@tchana ~]# su - postgres | ||
+ | |||
+ | Dernière connexion : jeudi 19 septembre 2019 à 20:46:08 EDT sur pts/0 | ||
+ | -bash-4.2$ | ||
+ | </ | ||
+ | |||
+ | On entre dans la console // | ||
+ | |||
+ | < | ||
+ | -bash-4.2$ psql | ||
+ | |||
+ | psql (11.5) | ||
+ | Saisissez « help » pour l' | ||
+ | |||
+ | postgres=# | ||
+ | </ | ||
+ | |||
+ | On affiche les //BD// présentes. | ||
+ | |||
+ | < | ||
+ | postgres=# | ||
+ | |||
+ | Liste des bases de données | ||
+ | Nom | Propriétaire | Encodage | Collationnement | Type caract. | Droits d' | ||
+ | -----------+--------------+----------+-----------------+--------------+---------------------- | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | (4 lignes) | ||
+ | |||
+ | postgres=# | ||
+ | </ | ||
+ | |||
+ | La //BD// //Flectra// est présente. | ||
+ | |||
+ | On quitte la console // | ||
+ | |||
+ | < | ||
+ | postgres=# \q | ||
+ | |||
+ | -bash-4.2$ | ||
+ | </ | ||
+ | |||
+ | On supprime la //BD// // | ||
+ | |||
+ | < | ||
+ | -bash-4.2$ dropdb ' | ||
+ | |||
+ | -bash-4.2$ | ||
+ | </ | ||
+ | |||
+ | On retourne dans la console// PostgreSQL// | ||
+ | |||
+ | < | ||
+ | -bash-4.2$ psql | ||
+ | |||
+ | psql (11.5) | ||
+ | Saisissez « help » pour l' | ||
+ | |||
+ | postgres=# | ||
+ | </ | ||
+ | |||
+ | On affiche les //BD// présentes. | ||
+ | |||
+ | < | ||
+ | postgres=# | ||
+ | |||
+ | Liste des bases de données | ||
+ | Nom | Propriétaire | Encodage | Collationnement | Type caract. | Droits d' | ||
+ | -----------+--------------+----------+-----------------+--------------+---------------------- | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | (4 lignes) | ||
+ | |||
+ | postgres=# | ||
+ | </ | ||
+ | |||
+ | La base de données //Flectra// n'est plus présente, elle a bien été supprimée. | ||
+ | |||
+ | On quitte la console // | ||
+ | |||
+ | < | ||
+ | postgres=# | ||
+ | |||
+ | -bash-4.2$ | ||
+ | </ | ||
+ | |||
+ | On revient à l' | ||
+ | |||
+ | < | ||
+ | -bash-4.2$ exit | ||
+ | |||
+ | déconnexion | ||
+ | root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | ==== Propriétaire du fichier de sauvegarde ==== | ||
+ | |||
+ | L' | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# cd / | ||
+ | |||
+ | [root@tchana sauvegarde]# | ||
+ | </ | ||
+ | |||
+ | On affiche le contenu du répertoire. | ||
+ | |||
+ | < | ||
+ | [root@tchana sauvegarde]# | ||
+ | |||
+ | total 3608 | ||
+ | 0 drwx------ 2 postgres postgres | ||
+ | 0 drwx------ 4 postgres postgres | ||
+ | 3604 -rwx------ 1 root | ||
+ | 4 -rwx------ 1 root | ||
+ | [root@tchana sauvegarde]# | ||
+ | </ | ||
+ | |||
+ | On change le propriétaire du fichier de sauvegarde afin que l' | ||
+ | |||
+ | < | ||
+ | [root@tchana sauvegarde]# | ||
+ | |||
+ | [root@tchana sauvegarde]# | ||
+ | </ | ||
+ | |||
+ | On vérifie. | ||
+ | |||
+ | < | ||
+ | [root@tchana sauvegarde]# | ||
+ | |||
+ | 3604 -rwx------ 1 postgres root 3690361 20 sept. 15:59 Flectra.dump | ||
+ | [root@tchana sauvegarde]# | ||
+ | </ | ||
+ | |||
+ | ===== Restauration de la BD ===== | ||
+ | |||
+ | On se substitue à l' | ||
+ | |||
+ | < | ||
+ | root@tchana ~]# su - postgres | ||
+ | |||
+ | Dernière connexion : jeudi 19 septembre 2019 à 20:56:08 EDT sur pts/0 | ||
+ | -bash-4.2$ | ||
+ | </ | ||
+ | |||
+ | L' | ||
+ | |||
+ | < | ||
+ | -bash-4.2$ cd / | ||
+ | |||
+ | -bash-4.2$ | ||
+ | </ | ||
+ | |||
+ | On vérifie le fichier de sauvegarde. | ||
+ | |||
+ | < | ||
+ | -bash-4.2$ ls -ls | ||
+ | |||
+ | total 3608 | ||
+ | 3604 -rwx------ 1 postgres root 3690361 20 sept. 15:59 Flectra.dump | ||
+ | 4 -rwx------ 1 root | ||
+ | -bash-4.2$ | ||
+ | </ | ||
+ | |||
+ | On restaure la sauvegarde. | ||
+ | |||
+ | < | ||
+ | -bash-4.2$ psql -f Flectra.dump | ||
+ | |||
+ | SET | ||
+ | SET | ||
+ | ... | ||
+ | SET | ||
+ | COMMENT-bash-4.2$ | ||
+ | </ | ||
+ | |||
+ | === Vérification === | ||
+ | |||
+ | On entre dans la console // | ||
+ | |||
+ | < | ||
+ | -bash-4.2$ psql | ||
+ | |||
+ | psql (11.5) | ||
+ | Saisissez « help » pour l' | ||
+ | |||
+ | postgres=# | ||
+ | </ | ||
+ | |||
+ | On affiche les //BD// présentes. | ||
+ | |||
+ | < | ||
+ | postgres=# | ||
+ | |||
+ | Liste des bases de données | ||
+ | Nom | Propriétaire | Encodage | Collationnement | Type caract. | Droits d' | ||
+ | -----------+--------------+----------+-----------------+--------------+---------------------- | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | (4 lignes) | ||
+ | |||
+ | postgres=# | ||
+ | </ | ||
+ | |||
+ | La //BD// //Flectra// a été créée et restaurée. | ||
+ | |||
+ | On quitte la console // | ||
+ | |||
+ | < | ||
+ | postgres=# \q | ||
+ | |||
+ | -bash-4.2$ | ||
+ | </ | ||
+ | |||
+ | On revient à l' | ||
+ | |||
+ | < | ||
+ | -bash-4.2$ exit | ||
+ | |||
+ | déconnexion | ||
+ | root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | ==== Vérification ==== | ||
+ | |||
+ | On se logue à //Flectra// et on vérifie si tout est tel qu' | ||
+ | {{Images_Cahier-101-03-004.png? | ||
+ | |||
+ | <WRAP column 30%> | ||
+ | < | ||
+ | < | ||
+ | |{{ Images_Cahier-201-07-059.png? | ||
+ | </ | ||
+ | <WRAP column 62%> | ||
+ | \\ | ||
+ | La page d' | ||
+ | |{{ Images_Cahier-201-07-060.png? | ||
+ | </ | ||
+ | <WRAP clear></ | ||
+ | |||
+ | ===== Instantané VirtualBox ===== | ||
+ | |||
+ | {{Images_Cahier-101-03-004.png? | ||
+ | |||
+ | <WRAP centeralign> | ||
+ | |||
+ | ====== Sauvegarde NethServer ====== | ||
+ | |||
+ | ===== Description ===== | ||
+ | // | ||
+ | Référence:// | ||
+ | |||
+ | La récupération d'une sauvegarde est le seul moyen de restaurer une machine en cas de sinistre. Le système gère deux types de sauvegardes: | ||
+ | |||
+ | - **Sauvegarde de la configuration**\\ Ce type de sauvegarde ne contient que les fichiers de configuration du système. Son objectif est de restaurer rapidement une machine en cas de récupération après sinistre. | ||
+ | - **Sauvegarde des données**\\ Ce type de sauvegarde est activée par l’installation du module " | ||
+ | \\ | ||
+ | |||
+ | ===== Sauvegarde de la configuration ===== | ||
+ | |||
+ | // | ||
+ | |||
+ | Depuis la page **Configuration -> Sauvegarde (configuration)**, | ||
+ | |||
+ | En outre, une tâche automatisée s' | ||
+ | |||
+ | ==== Config de la Sauvegarde de la configuration==== | ||
+ | |||
+ | **Configuration -> Sauvegarde (configuration) ->** onglet | ||
+ | |||
+ | <WRAP column 50%> | ||
+ | |{{ Images_Cahier-201-02-092.png? | ||
+ | </ | ||
+ | <WRAP column 42%> | ||
+ | |{{ Images_Cahier-201-02-093.png? | ||
+ | </ | ||
+ | <WRAP clear></ | ||
+ | |||
+ | {{Images_icone-201-003_Note.png? | ||
+ | |||
+ | La liste des modules installés est incluse dans l' | ||
+ | |||
+ | ==== Personnalisation ==== | ||
+ | |||
+ | === Inclusion === | ||
+ | |||
+ | Dans la plupart des cas, il n'est pas nécessaire de modifier la // | ||
+ | |||
+ | Si vous souhaitez ajouter un fichier à la // | ||
+ | |||
+ | === Exclusion === | ||
+ | |||
+ | Si vous souhaitez exclure un fichier de la // | ||
+ | |||
+ | ==== Lancement de la Sauvegarde de la configuration ==== | ||
+ | |||
+ | <WRAP column 32%> | ||
+ | **Configuration -> Sauvegarde (configuration) -> CRÉER UNE SAUVEGARDE**. | ||
+ | </ | ||
+ | <WRAP column 60%> | ||
+ | |{{ Images_Cahier-201-07-094.png? | ||
+ | </ | ||
+ | <WRAP clear></ | ||
+ | |||
+ | <WRAP column 46%> | ||
+ | \\ | ||
+ | Si l' | ||
+ | |{{ Images_Cahier-201-02-095.png? | ||
+ | </ | ||
+ | <WRAP column 46%> | ||
+ | < | ||
+ | < | ||
+ | |{{ Images_Cahier-201-02-096.png? | ||
+ | </ | ||
+ | <WRAP clear></ | ||
+ | |||
+ | <WRAP column 32%> | ||
+ | La sauvegarde a été créée et on voit sa description, | ||
+ | |||
+ | On peut télécharger la sauvegarde sur le poste de travail en cliquant **Télécharger**. | ||
+ | </ | ||
+ | <WRAP column 60%> | ||
+ | |{{ Images_Cahier-201-07-097.png? | ||
+ | </ | ||
+ | <WRAP clear></ | ||
+ | |||
+ | <WRAP column 30%> | ||
+ | \\ | ||
+ | **Enregistrer le fichier -> OK**. | ||
+ | |{{ Images_Cahier-201-02-098.png? | ||
+ | </ | ||
+ | <WRAP column 30%> | ||
+ | \\ | ||
+ | **Enregistrer**. | ||
+ | |{{ Images_Cahier-201-02-099.png? | ||
+ | </ | ||
+ | <WRAP column 30%> | ||
+ | Ces fichiers ne sont pas très volumineux, quelques //Ko// seulement. | ||
+ | |{{ Images_Cahier-201-02-099-A.png? | ||
+ | </ | ||
+ | <WRAP clear></ | ||
+ | |||
+ | ==== Restauration d'une configuration ==== | ||
+ | |||
+ | On peut récupérer une ancienne sauvegarde stockée sur le poste de travail afin de la restaurer. | ||
+ | |||
+ | <WRAP column 22%> | ||
+ | \\ | ||
+ | \\ | ||
+ | **Envoyer**. | ||
+ | |{{ Images_Cahier-201-02-100.png? | ||
+ | </ | ||
+ | <WRAP column 22%> | ||
+ | \\ | ||
+ | \\ | ||
+ | **Parcourir...** | ||
+ | |{{ Images_Cahier-201-02-101.png? | ||
+ | </ | ||
+ | <WRAP column 22%> | ||
+ | < | ||
+ | < | ||
+ | |{{ Images_Cahier-201-02-102.png? | ||
+ | </ | ||
+ | <WRAP column 22%> | ||
+ | \\ | ||
+ | < | ||
+ | < | ||
+ | |{{ Images_Cahier-201-02-103.png? | ||
+ | </ | ||
+ | <WRAP clear></ | ||
+ | |||
+ | <WRAP column 32%> | ||
+ | La sauvegarde récupérée apparaît dans la liste et on peut la restaurer en cliquant **Restaurer**. | ||
+ | </ | ||
+ | <WRAP column 60%> | ||
+ | |{{ Images_Cahier-201-07-104.png? | ||
+ | </ | ||
+ | <WRAP clear></ | ||
+ | |||
+ | <WRAP column 30%> | ||
+ | \\ | ||
+ | \\ | ||
+ | Les différentes paramètres de la sauvegarde récupérée apparaissent ci-dessous. | ||
+ | |{{ Images_Cahier-201-02-105.png? | ||
+ | </ | ||
+ | <WRAP column 30%> | ||
+ | < | ||
+ | < | ||
+ | |{{ Images_Cahier-201-02-106.png? | ||
+ | </ | ||
+ | <WRAP column 30%> | ||
+ | \\ | ||
+ | \\ | ||
+ | \\ | ||
+ | \\ | ||
+ | La restauration est en cours. | ||
+ | |{{ Images_Cahier-201-02-107.png? | ||
+ | </ | ||
+ | <WRAP clear></ | ||
+ | |||
+ | <WRAP column 32%> | ||
+ | La restauration a réussie. | ||
+ | |||
+ | {{Images_icone-201-003_Note.png? | ||
+ | </ | ||
+ | <WRAP column 60%> | ||
+ | |{{ Images_Cahier-201-07-108.png? | ||
+ | </ | ||
+ | <WRAP clear></ | ||
+ | |||
+ | ===== Sauvegarde des données ===== | ||
+ | |||
+ | {{Images_icone-201-004_Triangle.png? | ||
+ | |||
+ | NethServer implémente 2 types de sauvegarde des données: | ||
+ | |||
+ | - **Sauvegarde unique** // | ||
+ | - **Sauvegardes multiples** // | ||
+ | |||
+ | La sauvegarde des données peut être effectuée à l'aide de différents moteurs: | ||
+ | |||
+ | - Duplicity (défaut) - [[http:// | ||
+ | - Restic - [[https:// | ||
+ | - rsync - [[https:// | ||
+ | |||
+ | ==== Duplicity ==== | ||
+ | |||
+ | // | ||
+ | |||
+ | {{Images_icone-201-006_Securite.png? | ||
+ | |||
+ | Applications dorsales(( **Applications dorsales**: Programme qui, dans une architecture client-serveur, | ||
+ | |||
+ | - CIFS | ||
+ | - NFS | ||
+ | - USB | ||
+ | - WebDAV // | ||
+ | |||
+ | ==== Sauvegarde unique ==== | ||
+ | |||
+ | Il s'agit de la sauvegarde système par défaut pouvant être configurée et restaurée à l'aide de l' | ||
+ | |||
+ | - Peut être planifiée une fois par jour. | ||
+ | - Peut inclure les journaux du système. | ||
+ | - Envoie des notifications à l' | ||
+ | |||
+ | ==== Répertoire partagé pour les sauvegardes ==== | ||
+ | |||
+ | - Nos sauvegardes utiliseront le protocol CIFS //(Common Internet File System)//. | ||
+ | - Elles seront téléversées automatiquement dans un répertoire partagé sur le poste de travail. | ||
+ | |||
+ | Il nous faut donc un répertoire partagé sur le poste de travail afin que le //Serveur NethServer// | ||
+ | |||
+ | <WRAP column 30%> | ||
+ | < | ||
+ | < | ||
+ | |{{ Images_Cahier-201-02-109.png? | ||
+ | </ | ||
+ | <WRAP column 30%> | ||
+ | \\ | ||
+ | \\ | ||
+ | Si // | ||
+ | |{{ Images_Cahier-201-02-110.png? | ||
+ | </ | ||
+ | <WRAP column 30%> | ||
+ | \\ | ||
+ | \\ | ||
+ | \\ | ||
+ | Dans les menus de l' | ||
+ | |{{ Images_Cahier-201-02-111.png? | ||
+ | </ | ||
+ | <WRAP clear></ | ||
+ | |||
+ | <WRAP column 30%> | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | |{{ Images_Cahier-201-02-112.png? | ||
+ | </ | ||
+ | <WRAP column 30%> | ||
+ | \\ | ||
+ | < | ||
+ | < | ||
+ | |{{ Images_Cahier-201-02-113.png? | ||
+ | </ | ||
+ | <WRAP column 30%> | ||
+ | \\ | ||
+ | \\ | ||
+ | \\ | ||
+ | Onglet **Partage -> Partage avancé...** | ||
+ | |{{ Images_Cahier-201-02-114.png? | ||
+ | </ | ||
+ | <WRAP clear></ | ||
+ | |||
+ | <WRAP column 30%> | ||
+ | Cocher **Partager ce dossier ->** //**Nom du partage: | ||
+ | |{{ Images_Cahier-201-02-115.png? | ||
+ | </ | ||
+ | <WRAP column 30%> | ||
+ | \\ | ||
+ | \\ | ||
+ | **Ajouter...** | ||
+ | |{{ Images_Cahier-201-02-116.png? | ||
+ | </ | ||
+ | <WRAP column 30%> | ||
+ | On entre le nom d'un utilisateur de la machine Windows, ex: **__michelandre__** **-> Vérifier les noms**. | ||
+ | |{{ Images_Cahier-201-02-117.png? | ||
+ | </ | ||
+ | <WRAP clear></ | ||
+ | |||
+ | <WRAP column 30%> | ||
+ | \\ | ||
+ | Le nom vérifié apparaît **-> OK**. | ||
+ | |{{ Images_Cahier-201-02-118.png? | ||
+ | </ | ||
+ | <WRAP column 30%> | ||
+ | Sélectionner **michelandre ->** cocher toutes les // | ||
+ | |{{ Images_Cahier-201-02-119.png? | ||
+ | </ | ||
+ | <WRAP column 30%> | ||
+ | Sélectionner **Tout le monde ->** décocher toutes les // | ||
+ | |{{ Images_Cahier-201-02-120.png? | ||
+ | </ | ||
+ | <WRAP clear></ | ||
+ | |||
+ | <WRAP column 30%> | ||
+ | < | ||
+ | |||
+ | < | ||
+ | </ | ||
+ | <WRAP column 30%> | ||
+ | |{{ Images_Cahier-201-02-121.png? | ||
+ | </ | ||
+ | <WRAP column 30%> | ||
+ | |{{ Images_Cahier-201-02-122.png? | ||
+ | </ | ||
+ | <WRAP clear></ | ||
+ | |||
+ | <WRAP column 46%> | ||
+ | === Vérification === | ||
+ | |||
+ | Dans l' | ||
+ | |||
+ | Il voit le répertoire de partage: // | ||
+ | |||
+ | Tout est bien paramétré. | ||
+ | </ | ||
+ | <WRAP column 46%> | ||
+ | |{{ Images_Cahier-201-02-123.png? | ||
+ | </ | ||
+ | <WRAP clear></ | ||
+ | |||
+ | <WRAP column 32%> | ||
+ | ==== Installation du module Sauvegarde ==== | ||
+ | |||
+ | **Administration -> Gestionnaire des logiciels ->** on coche **Sauvegarde -> AJOUTER**. | ||
+ | </ | ||
+ | <WRAP column 60%> | ||
+ | |{{ Images_Cahier-201-07-124.png? | ||
+ | </ | ||
+ | <WRAP clear></ | ||
+ | |||
+ | <WRAP column 46%> | ||
+ | **APPLIQUER LES CHANGEMENTS**. | ||
+ | |{{ Images_Cahier-201-02-125.png? | ||
+ | </ | ||
+ | <WRAP column 46%> | ||
+ | **Recharger la page** pour afficher les nouveaux menus. | ||
+ | |{{ Images_Cahier-201-02-126.png? | ||
+ | </ | ||
+ | <WRAP clear></ | ||
+ | |||
+ | ==== Config de la Sauvegardes (données) ==== | ||
+ | |||
+ | <WRAP column 46%> | ||
+ | **Configuration -> Sauvegarde (données) ->** onglet **Général ->** on entre les informations demandées... | ||
+ | |{{ Images_Cahier-201-02-127.png? | ||
+ | </ | ||
+ | <WRAP column 46%> | ||
+ | \\ | ||
+ | ... on entre les informations demandées **-> SOUMETTRE**. | ||
+ | |{{ Images_Cahier-201-02-128.png? | ||
+ | </ | ||
+ | <WRAP clear></ | ||
+ | |||
+ | <WRAP column 46%> | ||
+ | === Notification === | ||
+ | |||
+ | ⦿ // | ||
+ | On préfère **Toujours** être notifié lorsqu' | ||
+ | |||
+ | ⦿ //**Adresse email personnalisée**// | ||
+ | Pour recevoir les courriels, on entre l' | ||
+ | |||
+ | //**Adresse de l' | ||
+ | On spécifie l' | ||
+ | |||
+ | **-> SOUMETTRE**. | ||
+ | </ | ||
+ | <WRAP column 46%> | ||
+ | |{{ Images_Cahier-201-02-129.png? | ||
+ | </ | ||
+ | <WRAP clear></ | ||
+ | |||
+ | ==== Vérifications à la ligne de commande ==== | ||
+ | |||
+ | === Sauvegarde (configuration) === | ||
+ | |||
+ | On affiche les propriétés de la configuration // | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# config show backup-config | ||
+ | |||
+ | backup-config=configuration | ||
+ | HistoryLength=31 | ||
+ | status=enabled | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | // | ||
+ | |||
+ | // | ||
+ | |||
+ | {{Images_icone-201-003_Note.png? | ||
+ | |||
+ | === Sauvegarde (données) === | ||
+ | |||
+ | On affiche les propriétés de la configuration // | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# config show backup-data | ||
+ | |||
+ | backup-data=configuration | ||
+ | IncludeLogs=enabled | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | // | ||
+ | [[nethserver_201_cahier_07_flectra# | ||
+ | . | ||
+ | |||
+ | On affiche les propriétés // | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# db backups show | ||
+ | |||
+ | backup-data=duplicity | ||
+ | BackupTime=0 3 * * * | ||
+ | CleanupOlderThan=56D | ||
+ | FullDay=0 | ||
+ | NFSHost= | ||
+ | NFSShare= | ||
+ | Notify=always | ||
+ | NotifyFrom=admin@micronator-dev.org | ||
+ | NotifyTo=michelandre@micronator.org | ||
+ | SMBHost=10.10.10.81 | ||
+ | SMBLogin=michelandre | ||
+ | SMBPassword=mot-de-passe | ||
+ | SMBShare=Sauvegarde | ||
+ | Type=incremental | ||
+ | USBLabel= | ||
+ | VFSType=cifs | ||
+ | VolSize=250 | ||
+ | WebDAVLogin= | ||
+ | WebDAVPassword= | ||
+ | WebDAVUrl= | ||
+ | status=enabled | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | {{Images_icone-201-003_Note.png? | ||
+ | \\ | ||
+ | |||
+ | ==== Personnalisation ==== | ||
+ | |||
+ | === Inclusion de fichiers/ | ||
+ | |||
+ | On peut inclure des fichiers/ | ||
+ | |||
+ | === Grandeur des fichiers de sauvegarde === | ||
+ | |||
+ | Comme on le voit avec la commande '' | ||
+ | [[nethserver_201_cahier_07_flectra# | ||
+ | , la propriété // | ||
+ | |||
+ | Nous ajustons la grandeur des fichiers à **2 Go** //(2048 Mo)// et ainsi facilitons l' | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# db backups setprop backup-data VolSize 2048 | ||
+ | |||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | On signale le changement. | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# signal-event nethserver-backup-data-update | ||
+ | |||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | On vérifie. | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# db backups show -> grep VolSize | ||
+ | |||
+ | | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | ==== Lancement forcé de la sauvegarde ==== | ||
+ | |||
+ | === Première sauvegarde === | ||
+ | |||
+ | On peut forcer le lancement d'une sauvegarde en exécutant la commande ci-dessous. | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# / | ||
+ | |||
+ | Backup: backup-data | ||
+ | Backup started at 2019-02-08 13:28:03 | ||
+ | Pre backup scripts status: SUCCESS | ||
+ | --------------[ Backup Statistics ]-------------- | ||
+ | StartTime 1549650495.78 (Fri Feb 8 13:28:15 2019) | ||
+ | EndTime 1549650497.91 (Fri Feb 8 13:28:17 2019) | ||
+ | ElapsedTime 2.13 (2.13 seconds) | ||
+ | SourceFiles 419 | ||
+ | SourceFileSize 24495192 (23.4 MB) | ||
+ | NewFiles 419 | ||
+ | NewFileSize 24495192 (23.4 MB) | ||
+ | DeletedFiles 0 | ||
+ | ChangedFiles 0 | ||
+ | ChangedFileSize 0 (0 bytes) | ||
+ | ChangedDeltaSize 0 (0 bytes) | ||
+ | DeltaEntries 419 | ||
+ | RawDeltaSize 24467434 (23.3 MB) | ||
+ | TotalDestinationSizeChange 1963840 (1.87 MB) | ||
+ | Errors 0 | ||
+ | ------------------------------------------------- | ||
+ | |||
+ | Action ' | ||
+ | Post backup scripts status: SUCCESS | ||
+ | Backup status: SUCCESS | ||
+ | Backup ended at 2019-02-08 13:28:19 | ||
+ | Time elapsed: 0 hours, 0 minutes, 16 seconds | ||
+ | |||
+ | Disk Usage: | ||
+ | Size | ||
+ | | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | <WRAP column 32%> | ||
+ | Cette sauvegarde //(1 918 Ko)// est complète. | ||
+ | </ | ||
+ | <WRAP column 60%> | ||
+ | |{{ Images_Cahier-201-07-130.png? | ||
+ | </ | ||
+ | <WRAP clear></ | ||
+ | |||
+ | On vérifie la date. | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# date | ||
+ | |||
+ | ven février | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | {{Images_icone-201-003_Note.png? | ||
+ | |||
+ | === Deuxième sauvegarde === | ||
+ | |||
+ | On peut forcer une autre sauvegarde pour générer une incrémentielle. | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# / | ||
+ | |||
+ | Backup: backup-data | ||
+ | Backup started at 2019-02-08 13:35:07 | ||
+ | Pre backup scripts status: SUCCESS | ||
+ | --------------[ Backup Statistics ]-------------- | ||
+ | StartTime 1549650912.53 (Fri Feb 8 13:35:12 2019) | ||
+ | EndTime 1549650912.95 (Fri Feb 8 13:35:12 2019) | ||
+ | ElapsedTime 0.42 (0.42 seconds) | ||
+ | SourceFiles 422 | ||
+ | SourceFileSize 24526628 (23.4 MB) | ||
+ | NewFiles 9 | ||
+ | NewFileSize 23980 (23.4 KB) | ||
+ | DeletedFiles 0 | ||
+ | ChangedFiles 70 | ||
+ | ChangedFileSize 14856835 (14.2 MB) | ||
+ | ChangedDeltaSize 0 (0 bytes) | ||
+ | DeltaEntries 79 | ||
+ | RawDeltaSize 457642 (447 KB) | ||
+ | TotalDestinationSizeChange 76371 (74.6 KB) | ||
+ | Errors 0 | ||
+ | ------------------------------------------------- | ||
+ | |||
+ | Les métadonnées locales et distantes sont déjà synchronisées. Aucune synchronisation nécessaire. | ||
+ | Date de la dernière sauvegarde complète : Fri Feb 08 13:28:03 2019 | ||
+ | Aucun ancien jeu de sauvegarde n’a été trouvé, rien n’a été supprimé. | ||
+ | Action ' | ||
+ | Post backup scripts status: SUCCESS | ||
+ | Backup status: SUCCESS | ||
+ | Backup ended at 2019-02-08 13:35:14 | ||
+ | Time elapsed: 0 hours, 0 minutes, 7 seconds | ||
+ | |||
+ | Disk Usage: | ||
+ | Size | ||
+ | | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | <WRAP column 32%> | ||
+ | La deuxième sauvegarde n'est que de //(75 Ko)// et est une incrémentielle, | ||
+ | </ | ||
+ | <WRAP column 60%> | ||
+ | |{{ Images_Cahier-201-07-131.png? | ||
+ | </ | ||
+ | <WRAP clear></ | ||
+ | |||
+ | <WRAP column 46%> | ||
+ | === Troisième sauvegarde === | ||
+ | |||
+ | Nous changeons la journée des sauvegardes complètes pour qu' | ||
+ | </ | ||
+ | <WRAP column 46%> | ||
+ | |{{ Images_Cahier-201-07-131-A.png? | ||
+ | </ | ||
+ | <WRAP clear></ | ||
+ | |||
+ | On force une troisième sauvegarde. | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# / | ||
+ | |||
+ | Backup: backup-data | ||
+ | Backup started at 2019-02-08 13:44:43 | ||
+ | Pre backup scripts status: SUCCESS | ||
+ | --------------[ Backup Statistics ]-------------- | ||
+ | StartTime 1549651488.35 (Fri Feb 8 13:44:48 2019) | ||
+ | EndTime 1549651489.30 (Fri Feb 8 13:44:49 2019) | ||
+ | ElapsedTime 0.95 (0.95 seconds) | ||
+ | SourceFiles 422 | ||
+ | SourceFileSize 24547401 (23.4 MB) | ||
+ | NewFiles 422 | ||
+ | NewFileSize 24547401 (23.4 MB) | ||
+ | DeletedFiles 0 | ||
+ | ChangedFiles 0 | ||
+ | ChangedFileSize 0 (0 bytes) | ||
+ | ChangedDeltaSize 0 (0 bytes) | ||
+ | DeltaEntries 422 | ||
+ | RawDeltaSize 24519532 (23.4 MB) | ||
+ | TotalDestinationSizeChange 1996425 (1.90 MB) | ||
+ | Errors 0 | ||
+ | ------------------------------------------------- | ||
+ | |||
+ | Les métadonnées locales et distantes sont déjà synchronisées. Aucune synchronisation nécessaire. | ||
+ | Date de la dernière sauvegarde complète : Fri Feb 08 13:28:03 2019 | ||
+ | Aucun ancien jeu de sauvegarde n’a été trouvé, rien n’a été supprimé. | ||
+ | Action ' | ||
+ | Post backup scripts status: SUCCESS | ||
+ | Backup status: SUCCESS | ||
+ | Backup ended at 2019-02-08 13:44:51 | ||
+ | Time elapsed: 0 hours, 0 minutes, 8 seconds | ||
+ | |||
+ | Disk Usage: | ||
+ | Size | ||
+ | | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | <WRAP column 32%> | ||
+ | La troisième sauvegarde est complète car nous avons paramétré les complètes pour les // | ||
+ | |||
+ | Si nous lançons une quatrième sauvegarde, elle sera complète elle aussi, car nous sommes toujours // | ||
+ | |||
+ | {{Images_icone-201-004_Triangle.png? | ||
+ | </ | ||
+ | <WRAP column 60%> | ||
+ | |{{ Images_Cahier-201-07-132.png? | ||
+ | </ | ||
+ | <WRAP clear></ | ||
+ | |||
+ | === Exemple de récupération du fichier de sauvegarde de la configuration === | ||
+ | |||
+ | {{Images_icone-201-001_doigt.png? | ||
+ | |||
+ | On se rend dans le répertoire de stockage, on claque sur le fichier '' | ||
+ | |||
+ | <WRAP column 46%> | ||
+ | |{{ Images_Cahier-201-02-133.png? | ||
+ | </ | ||
+ | <WRAP column 46%> | ||
+ | |{{ Images_Cahier-201-02-134.png? | ||
+ | </ | ||
+ | <WRAP clear></ | ||
+ | |||
+ | {{Images_icone-201-003_Note.png? | ||
+ | |||
+ | <WRAP column 30%> | ||
+ | Clac sur le fichier **xxx.tar.xz -> Copier vers...** | ||
+ | |{{ Images_Cahier-201-02-135.png? | ||
+ | </ | ||
+ | <WRAP column 30%> | ||
+ | \\ | ||
+ | **OK**. | ||
+ | |{{ Images_Cahier-201-02-136.png? | ||
+ | </ | ||
+ | <WRAP column 30%> | ||
+ | Le fichier de la configuration est récupéré de la sauvegarde des données. | ||
+ | |{{ Images_Cahier-201-02-137.png? | ||
+ | </ | ||
+ | <WRAP clear></ | ||
+ | |||
+ | === Exclusion de fichiers/ | ||
+ | |||
+ | On peut exclure des fichiers/ | ||
+ | |||
+ | ===== Restauration des données ===== | ||
+ | |||
+ | 1) Nous créons un fichier dans le répertoire personnel de **__root__**.\\ | ||
+ | 2) Nous lançons une sauvegarde.\\ | ||
+ | 3) Nous supprimons le fichier créé avant la sauvegarde, celui de l' étape 1.\\ | ||
+ | 4) Nous récupérons ce fichier contenu dans la dernière sauvegarde.\\ | ||
+ | 5) On vérifie la récupération. | ||
+ | |||
+ | 1) On crée le fichier | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# touch toto | ||
+ | |||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | On vérifie. | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# ls -ls toto | ||
+ | |||
+ | 0 -rw-r--r-- 1 root root 0 Feb 8 13:55 toto | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | 2) On lance une sauvegarde. | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# / | ||
+ | |||
+ | Backup: backup-data | ||
+ | Backup started at 2019-02-08 13:56:09 | ||
+ | Pre backup scripts status: SUCCESS | ||
+ | ... | ||
+ | Action ' | ||
+ | Post backup scripts status: SUCCESS | ||
+ | Backup status: SUCCESS | ||
+ | Backup ended at 2019-02-08 13:56:17 | ||
+ | Time elapsed: 0 hours, 0 minutes, 8 seconds | ||
+ | |||
+ | Disk Usage: | ||
+ | Size | ||
+ | | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | 3) Nous supprimons le fichier créé avant la sauvegarde, celui de la première étape. | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# rm toto | ||
+ | |||
+ | rm : supprimer fichier vide « toto » ? y | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | On vérifie. | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# ls -ls toto | ||
+ | |||
+ | ls: impossible d' | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | ==== Restauration ==== | ||
+ | |||
+ | 4) On récupère le fichier. | ||
+ | |||
+ | <WRAP column 46%> | ||
+ | **Configuration -> Restaurer les données**. | ||
+ | |||
+ | //**Backup file**// \\ | ||
+ | On choisit la dernière sauvegarde. | ||
+ | |||
+ | //**Mode de restauration**// | ||
+ | ⦿ Restaurer les fichiers dans le chemin original. | ||
+ | |||
+ | // | ||
+ | On entre **toto**. | ||
+ | |||
+ | < | ||
+ | |||
+ | **-> RESTAURER**. | ||
+ | |||
+ | Le message sur fond vert, // | ||
+ | </ | ||
+ | <WRAP column 46%> | ||
+ | |{{ Images_Cahier-201-07-138.png? | ||
+ | </ | ||
+ | <WRAP clear></ | ||
+ | |||
+ | {{Images_icone-201-003_Note.png? | ||
+ | |||
+ | === Vérification === | ||
+ | |||
+ | 5) On vérifie. | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# ls -ls toto | ||
+ | |||
+ | 0 -rw-r--r-- 1 root root 0 Feb 8 13:55 toto | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | Le fichier a été restauré. | ||
+ | \\ | ||
+ | |||
+ | ==== Recherche de fichiers dans les sauvegardes ==== | ||
+ | |||
+ | On peut rechercher un fichier dans les sauvegardes //(peut prendre un certain temps)//. | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# / | ||
+ | |||
+ | Ven février | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | <WRAP centeralign> | ||
+ | |||
+ | ===== Instantané VirtualBox ===== | ||
+ | |||
+ | {{Images_icone-201-002_Lumiere.png? | ||
+ | |||
+ | ===== NethServer & BackupPC ===== | ||
+ | |||
+ | // | ||
+ | |||
+ | Cette section décrit la marche à suivre pour créer une sauvegarde d'un //Serveur NethServer// | ||
+ | |||
+ | La sauvegarde se fait en utilisant le protocol CIFS //(Common Internet File System)// vers le répertoire partagé '' | ||
+ | |||
+ | {{Images_icone-201-003_Note.png? | ||
+ | |||
+ | // | ||
+ | |||
+ | ===== Description du cahier ===== | ||
+ | |||
+ | Le [[nethserver_101_cahier_11_nethserver_backuppc|Cahier-11]]: | ||
+ | |||
+ | Ce cahier est basé sur les pages Web suivantes: | ||
+ | |||
+ | [[https:// | ||
+ | [[https:// | ||
+ | [[https:// | ||
+ | |||
+ | //Page officielle de BackupPC:// [[https:// | ||
+ | |||
+ | // | ||
+ | // | ||
+ | Il est utilisé pour sauvegarder sur disque un ensemble de postes clients et de serveurs, sous: Unix, Linux, Windows ou Mac OS X. Les protocoles utilisables pour les transferts sont: //SMB//, //tar over SSH/ | ||
+ | |||
+ | ==== But du Cahier-101-11 ==== | ||
+ | |||
+ | <WRAP centeralign>// | ||
+ | \\ | ||
+ | |||
+ | {{ Images_Cahier-201-02-139.png? | ||
+ | \\ | ||
+ | |||
+ | ====== Activation du mode développeur de Flectra ====== | ||
+ | |||
+ | ===== Description ===== | ||
+ | |||
+ | Adaptation de la page: [[https:// | ||
+ | |||
+ | Le mode développeur //Flectra// vous permet d' | ||
+ | |||
+ | ===== Avantage ===== | ||
+ | |||
+ | Bien que //Flectra// soit un puissant cadre d' | ||
+ | |||
+ | De plus, l' | ||
+ | |||
+ | ===== Limites ===== | ||
+ | |||
+ | {{Images_Cahier-101-03-006.png? | ||
+ | |||
+ | ===== Activation par un ajout à l'URL ===== | ||
+ | |||
+ | <WRAP column 46%> | ||
+ | Après s' | ||
+ | </ | ||
+ | <WRAP column 46%> | ||
+ | |{{ Images_Cahier-201-07-150.png? | ||
+ | </ | ||
+ | <WRAP clear></ | ||
+ | |||
+ | <WRAP column 22%> | ||
+ | La page sera rechargée et le mode développeur/ | ||
+ | </ | ||
+ | <WRAP column 70%> | ||
+ | |{{ Images_Cahier-201-07-151.png? | ||
+ | </ | ||
+ | <WRAP clear></ | ||
+ | |||
+ | <WRAP column 25%> | ||
+ | Sur la page **Configuration**, | ||
+ | |{{ Images_Cahier-201-07-155.png? | ||
+ | </ | ||
+ | <WRAP column 22%> | ||
+ | \\ | ||
+ | En cliquant l' | ||
+ | |{{ Images_Cahier-201-07-152.png? | ||
+ | </ | ||
+ | <WRAP column 20%> | ||
+ | À la page **Configuration**, | ||
+ | |{{ Images_Cahier-201-07-153.png? | ||
+ | </ | ||
+ | <WRAP column 20%> | ||
+ | Pour quitter le mode développeur, | ||
+ | |{{ Images_Cahier-201-07-154.png? | ||
+ | </ | ||
+ | <WRAP clear></ | ||
+ | |||
+ | ====== Mises à jour ====== | ||
+ | |||
+ | ===== Flectra ===== | ||
+ | |||
+ | Nous avons utilisé '' | ||
+ | {{Images_Cahier-101-03-004.png? | ||
+ | [[nethserver_201_cahier_07_flectra# | ||
+ | .\\ | ||
+ | {{Images_Cahier-101-03-003.png? | ||
+ | [[nethserver_201_cahier_07_flectra# | ||
+ | . | ||
+ | |||
+ | ==== Flectra et ses extensions ==== | ||
+ | |||
+ | Adaptation de la page: [[https:// | ||
+ | |||
+ | On arrête // | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# systemctl stop flectra | ||
+ | |||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | On vérifie l' | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# systemctl status flectra | ||
+ | |||
+ | | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | {{Images_Cahier-101-03-006.png? | ||
+ | |||
+ | On se substitue à l' | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# su - flectra | ||
+ | |||
+ | Dernière connexion : jeudi 19 septembre 2019 à 20:32:10 EDT sur pts/0 | ||
+ | [flectra@tchana ~]$ | ||
+ | </ | ||
+ | |||
+ | On vérifie. | ||
+ | |||
+ | < | ||
+ | [flectra@tchana ~]$ whoami | ||
+ | |||
+ | flectra | ||
+ | [flectra@tchana ~]$ | ||
+ | </ | ||
+ | |||
+ | On se rend dans le répertoire ''/ | ||
+ | |||
+ | < | ||
+ | [flectra@tchana ~]$ cd / | ||
+ | |||
+ | [flectra@tchana flectra]$ | ||
+ | </ | ||
+ | |||
+ | On vérifie. | ||
+ | |||
+ | < | ||
+ | [flectra@tchana flectra]$ pwd | ||
+ | |||
+ | / | ||
+ | [flectra@tchana flectra]$ | ||
+ | </ | ||
+ | |||
+ | === Récupération des mises à jour === | ||
+ | |||
+ | On récupère les mises à jour avec '' | ||
+ | |||
+ | < | ||
+ | [flectra@tchana flectra]$ git fetch origin master --depth=1 | ||
+ | |||
+ | remote: Total 0 (delta 0), reused 0 (delta 0), pack-reused 0 | ||
+ | From https:// | ||
+ | * branch | ||
+ | [flectra@tchana flectra]$ | ||
+ | </ | ||
+ | |||
+ | === Application des mises à jour === | ||
+ | |||
+ | S'il existait des mise à jour, nous les aurions récupérées et nous devrions demander au système de les appliquer. À ce stade, le système saurait quelles sont les modifications qui devraient être effectuées, | ||
+ | {{Images_Cahier-101-03-006.png? | ||
+ | {{Images_Cahier-101-03-003.png? | ||
+ | |||
+ | On applique les mises à jour. | ||
+ | |||
+ | < | ||
+ | [flectra@tchana flectra]$ git reset --hard master | ||
+ | |||
+ | HEAD is now at 4dd1e69 Merge branch ' | ||
+ | [flectra@tchana flectra]$ | ||
+ | </ | ||
+ | |||
+ | {{Images_icone-201-003_Note.png? | ||
+ | Avec ce '' | ||
+ | |||
+ | ==== Base de donnée PostgreSQL ==== | ||
+ | |||
+ | On met à jour la base de données // | ||
+ | |||
+ | < | ||
+ | [flectra@tchana flectra]$ / | ||
+ | -- / | ||
+ | / | ||
+ | -c / | ||
+ | -u all -d Flectra | ||
+ | |||
+ | |||
+ | </ | ||
+ | |||
+ | - **/// | ||
+ | - **/// | ||
+ | - **//-u all -d Flectra// | ||
+ | |||
+ | Pour une explication des paramètres de la commande '' | ||
+ | |||
+ | === Surveillance de la mise à jour de la BD === | ||
+ | |||
+ | On ouvre __une deuxième session // | ||
+ | |||
+ | < | ||
+ | [flectra@tchana flectra]# top -d1 | grep python3 | ||
+ | |||
+ | 6336 flectra | ||
+ | 6336 flectra | ||
+ | 6336 flectra | ||
+ | ... | ||
+ | 6336 flectra | ||
+ | 6336 flectra | ||
+ | 6336 flectra | ||
+ | 6336 flectra | ||
+ | 6336 flectra | ||
+ | ... | ||
+ | [flectra@tchana flectra]# | ||
+ | </ | ||
+ | |||
+ | C'est la commande '' | ||
+ | {{Images_Cahier-101-03-006.png? | ||
+ | On peut fermer cette deuxième session //PuTTY//. | ||
+ | |||
+ | ==== Arrêt de la commande de mise à jour et redémarrage du service Flectra ==== | ||
+ | |||
+ | On revient à la sessions original de //PuTTY//. | ||
+ | |||
+ | Les paramètres de la mise à jour de la base de données //(-u all -d Flectra)// faisaient partie de la commande du lancement de // | ||
+ | |||
+ | <WRAP box> | ||
+ | < | ||
+ | [flectra@tchana flectra]$ / | ||
+ | -- / | ||
+ | / | ||
+ | -c / | ||
+ | -u all -d Flectra | ||
+ | |||
+ | </ | ||
+ | </ | ||
+ | |||
+ | La mise à jour de la base de données est terminée, mais la commande du lancement de //Flectra// continue de rouler. | ||
+ | |||
+ | Vu que nous n' | ||
+ | |||
+ | On avorte la commande avec un <wrap em> | ||
+ | |||
+ | < | ||
+ | [flectra@tchana flectra]$ / | ||
+ | -- / | ||
+ | / | ||
+ | -c / | ||
+ | -u all -d Flectra | ||
+ | ^C | ||
+ | [flectra@tchana flectra]$ | ||
+ | </ | ||
+ | |||
+ | On quitte la substitution d' | ||
+ | |||
+ | < | ||
+ | [flectra@tchana flectra]$ exit | ||
+ | |||
+ | déconnexion | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | On vérifie. | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# whoami | ||
+ | |||
+ | root | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | On redémarre le __service__ Flectra en utilisant '' | ||
+ | {{Images_Cahier-101-03-004.png? | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# systemctl start flectra | ||
+ | |||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | On vérifie. | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# systemctl status flectra | grep Active: | ||
+ | |||
+ | | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | ==== Vérification du site Flectra ==== | ||
+ | |||
+ | {{Images_Cahier-101-03-003.png? | ||
+ | On se connecte à //Flectra// et on vérifie que tout fonctionne correctement tel qu' | ||
+ | |||
+ | <WRAP column 22%> | ||
+ | |{{ Images_Cahier-201-07-157.png? | ||
+ | </ | ||
+ | <WRAP column 70%> | ||
+ | |{{ Images_Cahier-201-07-158.png? | ||
+ | </ | ||
+ | <WRAP clear></ | ||
+ | |||
+ | ===== PHP ===== | ||
+ | |||
+ | Mise à jour de la // | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# yum update -y nethserver-php-scl --enablerepo=stephdl | ||
+ | |||
+ | ... | ||
+ | Résumé de la transaction | ||
+ | ============================================================================================ | ||
+ | Installation | ||
+ | Mettre à jour 1 Paquet (+52 Paquets en dépendance) | ||
+ | |||
+ | Taille totale des téléchargements : 22 M | ||
+ | ... | ||
+ | Running transaction | ||
+ | Mise à jour : php71-php-json-7.1.32-1.el7.remi.x86_64 | ||
+ | ... | ||
+ | Nettoyage | ||
+ | ... | ||
+ | Mis à jour : | ||
+ | nethserver-php-scl.x86_64 0: | ||
+ | ... | ||
+ | Dépendances mises à jour : | ||
+ | php71-php-bcmath.x86_64 0: | ||
+ | ... | ||
+ | php73-php-xml.x86_64 0: | ||
+ | |||
+ | Terminé ! | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | On redémarre le service // | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# systemctl restart flectra | ||
+ | |||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | ===== PostgreSQL ===== | ||
+ | |||
+ | On procède à la mise à jour de // | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# yum update -y --disablerepo=* --enablerepo=pgdg11 | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | ... | ||
+ | Résumé de la transaction | ||
+ | ============================================================================================ | ||
+ | Mettre à jour 7 Paquets | ||
+ | |||
+ | Taille totale des téléchargements : 22 M | ||
+ | ... | ||
+ | Mise à jour : postgresql11-libs-11.5-1PGDG.rhel7.x86_64 | ||
+ | ... | ||
+ | Nettoyage | ||
+ | ... | ||
+ | Mis à jour : | ||
+ | postgresql11.x86_64 0: | ||
+ | postgresql11-contrib.x86_64 0: | ||
+ | postgresql11-devel.x86_64 0: | ||
+ | postgresql11-docs.x86_64 0: | ||
+ | postgresql11-libs.x86_64 0: | ||
+ | postgresql11-server.x86_64 0: | ||
+ | postgresql11-test.x86_64 0: | ||
+ | |||
+ | Terminé ! | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | Il faut redémarrer // | ||
+ | |||
+ | On redémarre le service // | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# systemctl restart postgresql-11 | ||
+ | |||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | On redémarre le service // | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# systemctl restart flectra | ||
+ | |||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | ==== Vérification du site Flectra ==== | ||
+ | |||
+ | {{Images_Cahier-101-03-003.png? | ||
+ | On se rend à notre site et on s' | ||
+ | |||
+ | ===== RH-Python36 ===== | ||
+ | |||
+ | Mise à jour de la // | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# yum update -y --enablerepo=centos-sclo-rh rh-python36* | ||
+ | |||
+ | ... | ||
+ | Résumé de la transaction | ||
+ | ============================================================================================ | ||
+ | Mettre à jour 8 Paquets | ||
+ | |||
+ | Taille totale des téléchargements : 19 M | ||
+ | ... | ||
+ | Mise à jour : rh-python36-python-3.6.3-7.el7.x86_64 | ||
+ | ... | ||
+ | Nettoyage | ||
+ | ... | ||
+ | Mis à jour : | ||
+ | rh-python36-python.x86_64 0: | ||
+ | rh-python36-python-debug.x86_64 0: | ||
+ | rh-python36-python-devel.x86_64 0: | ||
+ | rh-python36-python-jinja2.noarch 0: | ||
+ | rh-python36-python-libs.x86_64 0: | ||
+ | rh-python36-python-test.x86_64 0: | ||
+ | rh-python36-python-tkinter.x86_64 0: | ||
+ | rh-python36-python-tools.x86_64 0: | ||
+ | |||
+ | Terminé ! | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | On doit redémarrer le service // | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# systemctl restart flectra | ||
+ | |||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | ==== Vérification du site Flectra ==== | ||
+ | |||
+ | {{Images_Cahier-101-03-003.png? | ||
+ | On se connecte à //Flectra// et on vérifie que tout fonctionne correctement tel qu' | ||
+ | |||
+ | ===== npm/node ===== | ||
+ | |||
+ | // | ||
+ | |||
+ | L' | ||
+ | |||
+ | - npm fait partie de l' | ||
+ | - npm fonctionne avec un terminal et gère les dépendances pour une application et | ||
+ | - npm permet également d' | ||
+ | |||
+ | ==== Impacts sur less et lessc ==== | ||
+ | |||
+ | {{Images_Cahier-101-03-006.png? | ||
+ | |||
+ | <WRAP box> | ||
+ | < | ||
+ | Style error | ||
+ | The style compilation failed, see the error below. Your recent actions may be the cause, please try reverting the changes you made. | ||
+ | |||
+ | (b'', | ||
+ | [TypeError: Object function Object() { [native code] } has no method ' | ||
+ | ')This error occured while compiling the bundle ' | ||
+ | - / | ||
+ | ... | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | {{Images_Cahier-101-03-003.png? | ||
+ | |||
+ | Vous pouvez consulter le document suivant pour la création d'un clone d'un //Serveur NethServer//: | ||
+ | |||
+ | On vérifie la version actuelle. | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# npm --version | ||
+ | |||
+ | 6.4.1 | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | ==== Mise à jour ==== | ||
+ | |||
+ | Mise à jour de // | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# npm install -g npm | ||
+ | |||
+ | / | ||
+ | / | ||
+ | + npm@6.11.3 | ||
+ | added 61 packages from 18 contributors, | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | {{Images_Cahier-101-03-006.png? | ||
+ | |||
+ | Vu qu'il y a eu une mise à jour, on doit redémarrer le service // | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# systemctl restart flectra | ||
+ | |||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | ==== Vérification du site Flectra ==== | ||
+ | |||
+ | {{Images_Cahier-101-03-003.png? | ||
+ | On se connecte à //Flectra// et on vérifie que tout fonctionne correctement tel qu' | ||
+ | |||
+ | ==== Retour à la version originalement installée ==== | ||
+ | |||
+ | Au cas où la nouvelle version occasionnerait des problèmes, on peut retourner à la version originalement installée. | ||
+ | |||
+ | <WRAP box> | ||
+ | < | ||
+ | [root@tchana ~]# npm install -g npm@6.4.1 | ||
+ | |||
+ | / | ||
+ | / | ||
+ | + npm@6.4.1 | ||
+ | added 15 packages from 11 contributors, | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | On vérifie. | ||
+ | |||
+ | <WRAP box> | ||
+ | < | ||
+ | [root@tchana ~]# npm --version | ||
+ | |||
+ | 6.4.1 | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | Redémarrage du service // | ||
+ | |||
+ | <WRAP box> | ||
+ | < | ||
+ | [root@tchana ~]# systemctl restart flectra | ||
+ | |||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | {{Images_Cahier-101-03-003.png? | ||
+ | On se connecte à //Flectra// et on vérifie que tout fonctionne correctement tel qu' | ||
+ | |||
+ | ===== less et less-plugin-clean-css ===== | ||
+ | |||
+ | On vérifie la version actuelle de '' | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# less --version | ||
+ | |||
+ | less 458 (POSIX regular expressions) | ||
+ | Copyright (C) 1984-2012 Mark Nudelman | ||
+ | |||
+ | less comes with NO WARRANTY, to the extent permitted by law. | ||
+ | For information about the terms of redistribution, | ||
+ | see the file named README in the less distribution. | ||
+ | Homepage: http:// | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | On vérifie la version actuelle de '' | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# lessc --version | ||
+ | |||
+ | lessc 3.9.0 (Less Compiler) [JavaScript] | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | {{Images_Cahier-101-03-003.png? | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# npm config set strict-ssl false | ||
+ | |||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | Mise à jour de '' | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# npm install -g less less-plugin-clean-css | ||
+ | |||
+ | / | ||
+ | + less-plugin-clean-css@1.5.1 | ||
+ | + less@3.10.3 | ||
+ | updated 7 packages in 4.233s | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | {{Images_Cahier-101-03-006.png? | ||
+ | |||
+ | On vérifie la version actuelle de '' | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# less --version | ||
+ | |||
+ | less 458 (POSIX regular expressions) | ||
+ | Copyright (C) 1984-2012 Mark Nudelman | ||
+ | |||
+ | less comes with NO WARRANTY, to the extent permitted by law. | ||
+ | For information about the terms of redistribution, | ||
+ | see the file named README in the less distribution. | ||
+ | Homepage: http:// | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | Il n'y a pas eu de mises à jour de '' | ||
+ | |||
+ | On vérifie la version actuelle de '' | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# lessc --version | ||
+ | |||
+ | lessc 3.10.3 (Less Compiler) [JavaScript] | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | Il y a eu une mise à jour de '' | ||
+ | |||
+ | Redémarrage du service // | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# systemctl restart flectra | ||
+ | |||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | ==== Vérification du site Flectra ==== | ||
+ | |||
+ | {{Images_Cahier-101-03-003.png? | ||
+ | On se connecte à //Flectra// et on vérifie que tout fonctionne correctement tel qu' | ||
+ | |||
+ | ===== wkhtmltox ===== | ||
+ | |||
+ | ==== Dépendances pour wkhtmltopdf ==== | ||
+ | |||
+ | Mise à jour des dépendances. | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# yum update -y fontconfig libpng libX11 libXext libXrender | ||
+ | | ||
+ | |||
+ | Modules complémentaires chargés : changelog, fastestmirror, | ||
+ | Configuration du processus de mise à jour | ||
+ | Loading mirror speeds from cached hostfile | ||
+ | * base: centos.mirror.ca.planethoster.net | ||
+ | ... | ||
+ | No packages marked for update | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | ==== wkhtmltox ==== | ||
+ | |||
+ | Pour trouver la dernière version de '' | ||
+ | |||
+ | <WRAP column 52%> | ||
+ | La dernière version disponible est la même que celle qu'on a installée à la section | ||
+ | [[nethserver_201_cahier_07_flectra# | ||
+ | . | ||
+ | |||
+ | S'il y avait eu une nouvelle version, nous aurions pu l' | ||
+ | </ | ||
+ | <WRAP column 40%> | ||
+ | |{{ Images_Cahier-201-07-159.png? | ||
+ | </ | ||
+ | <WRAP clear></ | ||
+ | |||
+ | Si des mises à jour ont été installées, | ||
+ | |||
+ | <WRAP box> | ||
+ | < | ||
+ | [root@tchana ~]# systemctl restart flectra | ||
+ | |||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | ==== Vérification du site Flectra ==== | ||
+ | |||
+ | {{Images_Cahier-101-03-003.png? | ||
+ | On se connecte à //Flectra// et on vérifie que tout fonctionne correctement tel qu' | ||
+ | |||
+ | ===== Serveur NethServer ===== | ||
+ | |||
+ | De temps à autre, il faut mettre à jour le //Serveur NethServer// | ||
+ | |||
+ | <WRAP column 46%> | ||
+ | < | ||
+ | < | ||
+ | |{{ Images_Cahier-201-07-160.png? | ||
+ | </ | ||
+ | <WRAP column 46%> | ||
+ | \\ | ||
+ | \\ | ||
+ | À la fin de la mise à jour, **Recharger la page**. | ||
+ | |{{ Images_Cahier-201-07-161.png? | ||
+ | </ | ||
+ | <WRAP clear></ | ||
+ | |||
+ | {{Images_icone-201-003_Note.png? | ||
+ | |||
+ | ==== Vérification du site Flectra ==== | ||
+ | |||
+ | {{Images_Cahier-101-03-003.png? | ||
+ | On se connecte à //Flectra// et on vérifie que tout fonctionne correctement tel qu' | ||
+ | |||
+ | ===== Instantané VirtualBox ===== | ||
+ | |||
+ | {{Images_Cahier-101-03-004.png? | ||
+ | |||
+ | ====== Appendices ====== | ||
+ | |||
+ | {{Images_icone-201-003_Note.png? | ||
+ | [[nethserver_201_cahier_04_dokuwiki# | ||
+ | du **Cahier-04: | ||
+ | |||
+ | ===== Écran conventionnel de démarrage ===== | ||
+ | |||
+ | <WRAP column 46%> | ||
+ | Si nous voulons voir l' | ||
+ | |||
+ | <WRAP centeralign> | ||
+ | ''/ | ||
+ | </ | ||
+ | |{{ Images_Cahier-101-03-368.png? | ||
+ | </ | ||
+ | <WRAP column 46%> | ||
+ | |{{ Images_Cahier-101-03-367.png? | ||
+ | </ | ||
+ | <WRAP clear></ | ||
+ | |||
+ | ==== Suppression du paramètre rhgb ==== | ||
+ | |||
+ | Ligne originale dans le fichier ''/ | ||
+ | |||
+ | <WRAP box> | ||
+ | < | ||
+ | GRUB_CMDLINE_LINUX=" | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | Après avoir enlevé le paramètre **rhgb**. | ||
+ | |||
+ | <WRAP box> | ||
+ | < | ||
+ | GRUB_CMDLINE_LINUX=" | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | On signale le changement en régénérant le fichier de configuration. | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# grub2-mkconfig -o / | ||
+ | |||
+ | Generating grub configuration file ... | ||
+ | Found linux image: / | ||
+ | Found initrd image: / | ||
+ | Found linux image: / | ||
+ | Found initrd image: / | ||
+ | Found linux image: / | ||
+ | Found initrd image: / | ||
+ | done | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | {{Images_Cahier-101-03-005.png? | ||
+ | |||
+ | ===== Nom du serveur dans l' | ||
+ | |||
+ | <WRAP column 50%> | ||
+ | À l' | ||
+ | |||
+ | On peut supprimer complètement l' | ||
+ | |||
+ | Pour supprimer l' | ||
+ | |||
+ | <WRAP centeralign> | ||
+ | ''/ | ||
+ | </ | ||
+ | </ | ||
+ | <WRAP column 40%> | ||
+ | |{{ Images_Cahier-101-03-340.png? | ||
+ | </ | ||
+ | <WRAP clear></ | ||
+ | |||
+ | et y ajouter la ligne suivante: | ||
+ | |||
+ | Par contre, si nous modifions directement ce fichier, le prochain ré-amorçage écrasera la modification lorsque le serveur assemblera les gabarits de configuration du système. | ||
+ | |||
+ | {{Images_Cahier-101-03-003.png? | ||
+ | |||
+ | Création du répertoire pour le gabarit personnalisé. | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# mkdir -p / | ||
+ | |||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | On crée le fichier '' | ||
+ | |||
+ | {{Images_Cahier-101-03-006.png? | ||
+ | |||
+ | < | ||
+ | cat > / | ||
+ | |||
+ | $config[' | ||
+ | |||
+ | EOT | ||
+ | |||
+ | |||
+ | </ | ||
+ | |||
+ | On vérifie. | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# cat / | ||
+ | |||
+ | $config[' | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | {{Images_Cahier-101-03-006.png? | ||
+ | |||
+ | On signale le changement. | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# expand-template / | ||
+ | |||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | On redémarre le démon '' | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# systemctl restart httpd | ||
+ | |||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | <WRAP column 50%> | ||
+ | On se rend à l'// | ||
+ | Le domaine du serveur ne s' | ||
+ | </ | ||
+ | <WRAP column 40%> | ||
+ | |{{ Images_Cahier-101-03-341.png? | ||
+ | </ | ||
+ | <WRAP clear></ | ||
+ | |||
+ | ==== Sauvegarde ==== | ||
+ | |||
+ | On vérifie si le nom du répertoire ''/ | ||
+ | |||
+ | {{Images_Cahier-101-03-006.png? | ||
+ | |||
+ | < | ||
+ | NouvelleInclusion="/ | ||
+ | if grep -Fxq " | ||
+ | then | ||
+ | # L' | ||
+ | echo -e "\nLe fichier custom.include contient déjà l' | ||
+ | else | ||
+ | # L' | ||
+ | echo -e " | ||
+ | echo -e " | ||
+ | fi | ||
+ | |||
+ | |||
+ | </ | ||
+ | |||
+ | On vérifie. | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# cat / | ||
+ | |||
+ | / | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | Ci-dessus, il n'y a pas de ligne vide avant __/ | ||
+ | |||
+ | ===== Langue à la console du serveur ===== | ||
+ | |||
+ | On affiche les langues offertes à la console du serveur. | ||
+ | |||
+ | [root@tchana ~]# localectl list-locales | grep fr_ | ||
+ | | ||
+ | fr_BE | ||
+ | fr_BE.iso88591 | ||
+ | fr_BE.iso885915@euro | ||
+ | fr_BE.utf8 | ||
+ | fr_BE@euro | ||
+ | fr_CA | ||
+ | fr_CA.iso88591 | ||
+ | fr_CA.utf8 | ||
+ | fr_CH | ||
+ | fr_CH.iso88591 | ||
+ | fr_CH.utf8 | ||
+ | fr_FR | ||
+ | fr_FR.iso88591 | ||
+ | fr_FR.iso885915@euro | ||
+ | fr_FR.utf8 | ||
+ | fr_FR@euro | ||
+ | fr_LU | ||
+ | fr_LU.iso88591 | ||
+ | fr_LU.iso885915@euro | ||
+ | fr_LU.utf8 | ||
+ | fr_LU@euro | ||
+ | [root@tchana ~]# | ||
+ | |||
+ | On ajuste la langue désirée pour l' | ||
+ | |||
+ | [root@tchana ~]# localectl set-locale LANG=fr_FR.utf8 | ||
+ | | ||
+ | [root@tchana ~]# | ||
+ | |||
+ | {{Images_icone-201-003_Note.png? | ||
+ | |||
+ | On pourra vérifier, après le prochain redémarrage, | ||
+ | |||
+ | [root@tchana ~]# ls -als toto | ||
+ | | ||
+ | ls: impossible d' | ||
+ | [root@tchana ~]# | ||
+ | |||
+ | ===== Langue de l' | ||
+ | |||
+ | On change la langue de l' | ||
+ | |||
+ | <WRAP column 30%> | ||
+ | **Administration | ||
+ | |{{ Images_Cahier-101-03-112.png? | ||
+ | </ | ||
+ | <WRAP column 30%> | ||
+ | \\ | ||
+ | \\ | ||
+ | **ADD**. | ||
+ | |{{ Images_Cahier-101-03-113.png? | ||
+ | </ | ||
+ | <WRAP column 30%> | ||
+ | \\ | ||
+ | \\ | ||
+ | **APPLY CHANGES**. | ||
+ | |{{ Images_Cahier-101-03-114.png? | ||
+ | </ | ||
+ | <WRAP clear></ | ||
+ | |||
+ | <WRAP column 22%> | ||
+ | \\ | ||
+ | Le //RPM// // | ||
+ | |{{ Images_Cahier-101-03-115.png? | ||
+ | </ | ||
+ | <WRAP column 22%> | ||
+ | \\ | ||
+ | \\ | ||
+ | **Reload page**. | ||
+ | |{{ Images_Cahier-101-03-116.png? | ||
+ | </ | ||
+ | <WRAP column 22%> | ||
+ | On se __déconnecte/ | ||
+ | |{{ Images_Cahier-101-03-117.png? | ||
+ | </ | ||
+ | <WRAP column 22%> | ||
+ | < | ||
+ | < | ||
+ | |{{ Images_Cahier-101-03-118.png? | ||
+ | </ | ||
+ | <WRAP clear></ | ||
+ | |||
+ | ===== Table de mappe de clavier ===== | ||
+ | |||
+ | On affiche les différentes mappes de clavier(( **Table de mappe de clavier**: n.f. Disposition des touches d'un clavier.\\ | ||
+ | // | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# localectl list-keymaps | grep ca | ||
+ | |||
+ | ca | ||
+ | ca-eng | ||
+ | ca-fr-dvorak | ||
+ | ca-fr-legacy | ||
+ | ca-multi | ||
+ | ca-multix | ||
+ | dvorak-ca-fr | ||
+ | es-cat | ||
+ | ph-capewell-dvorak | ||
+ | ph-capewell-qwerf2k6 | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | On active le clavier // | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# localectl set-keymap ca-multi | ||
+ | |||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | On vérifie. | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# localectl | ||
+ | |||
+ | | ||
+ | VC Keymap: ca-multi | ||
+ | X11 Layout: us | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | ===== Fermeture automatique de session (session timeout) ===== | ||
+ | |||
+ | // | ||
+ | Par défaut //(à partir de NethServer 7.5.1804)//, | ||
+ | |||
+ | La commande ci-dessous définit **2** heures de //délai d' | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# config setprop httpd-admin MaxSessionIdleTime 7200 MaxSessionLifeTime 57600 | ||
+ | |||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | Désactivation des délais. | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# config setprop httpd-admin MaxSessionIdleTime '' | ||
+ | |||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | {{Images_Cahier-101-03-006.png? | ||
+ | |||
+ | ===== Fuseau horaire ===== | ||
+ | |||
+ | Pour le fuseau horaire, il existe un fichier pour // | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# ls -ls / | ||
+ | |||
+ | 4 -rw-r--r-- | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | ==== Changement du fuseau horaire ==== | ||
+ | |||
+ | On affiche le fuseau horaire actuel. | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# ls -l / | ||
+ | |||
+ | lrwxrwxrwx 1 root root 37 19 mai 23:48 / | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | On change le fuseau horaire pour celui de // | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# timedatectl set-timezone America/ | ||
+ | |||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | On vérifie. | ||
+ | |||
+ | < | ||
+ | [root@tchana ~]# ls -l / | ||
+ | |||
+ | lrwxrwxrwx 1 root root 38 22 mai 14:02 / | ||
+ | [root@tchana ~]# | ||
+ | </ | ||
+ | |||
+ | Voilà! Le fuseau horaire // | ||
+ | |||
+ | ===== Certificat Let's Encrypt ===== | ||
+ | |||
+ | ==== Description ==== | ||
+ | |||
+ | Un certificat émis par l' | ||
+ | |||
+ | // | ||
+ | // | ||
+ | |||
+ | === Examen du certificat === | ||
+ | |||
+ | {{Images_Cahier-101-03-006.png? | ||
+ | |||
+ | Si la demande de certificat a fonctionnée sans erreur, essayez de vous connecter à la page de l' | ||
+ | |||
+ | On se connecte à l' | ||
+ | |||
+ | <WRAP column 30%> | ||
+ | < | ||
+ | < | ||
+ | |{{ Images_Cahier-101-03-369.png? | ||
+ | </ | ||
+ | <WRAP column 30%> | ||
+ | < | ||
+ | < | ||
+ | |{{ Images_Cahier-101-03-370.png? | ||
+ | </ | ||
+ | <WRAP column 30%> | ||
+ | \\ | ||
+ | **Plus d' | ||
+ | |{{ Images_Cahier-101-03-371.png? | ||
+ | </ | ||
+ | <WRAP clear></ | ||
+ | |||
+ | <WRAP center> | ||
+ | <WRAP column 46%> | ||
+ | \\ | ||
+ | \\ | ||
+ | < | ||
+ | < | ||
+ | |{{ Images_Cahier-101-03-372.png? | ||
+ | </ | ||
+ | <WRAP column 46%> | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | |{{ Images_Cahier-101-03-373.png? | ||
+ | </ | ||
+ | <WRAP clear></ | ||
+ | |||
+ | <WRAP center> | ||
+ | <WRAP column 46%> | ||
+ | \\ | ||
+ | \\ | ||
+ | < | ||
+ | < | ||
+ | |{{ Images_Cahier-101-03-374.png? | ||
+ | </ | ||
+ | <WRAP column 46%> | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | |{{ Images_Cahier-101-03-375.png? | ||
+ | </ | ||
+ | <WRAP clear></ | ||
+ | |||
+ | ==== Vérification par Qualsys SSLLabs ==== | ||
+ | |||
+ | {{Images_Cahier-101-03-006.png? | ||
+ | Une fois que vous avez obtenu votre certificat, testez-le en vous rendant chez //Qualsys SSLLabs//, [[https:// | ||
+ | Soumettez le nom //FQDN// de votre domaine pour vérifier que le certificat fonctionne correctement. | ||
+ | |||
+ | <WRAP center> | ||
+ | <WRAP column 46%> | ||
+ | // | ||
+ | **micronator-101.org | ||
+ | |{{ Images_Cahier-101-03-376.png? | ||
+ | </ | ||
+ | <WRAP column 46%> | ||
+ | < | ||
+ | < | ||
+ | |{{ Images_Cahier-101-03-377.png? | ||
+ | </ | ||
+ | <WRAP clear></ | ||
+ | |||
+ | ===== Changement du mot de passe de root ===== | ||
+ | |||
+ | // | ||
+ | Réinitialiser le mot de passe de **__root__** est normalement une tâche simple si vous êtes déjà connecté avec les privilèges de **__root__**. Toutefois, si vous oubliez le mot de passe et devez le changer, les choses deviennent un peu plus difficiles.\\ | ||
+ | Le processus a changé de la version 6 de // | ||
+ | {{Images_Cahier-101-03-003.png? | ||
+ | |||
+ | Si votre système Linux est en cours d' | ||
+ | |||
+ | Pour //CentOS 7//, le menu de démarrage vous laissera 5 secondes pour sélectionner le noyau du système d’exploitation à démarrer. Ces 5 secondes sont importantes, | ||
+ | |||
+ | Dans le menu de démarrage, appuyez sur <wrap em> | ||
+ | |||
+ | {{ Images_Cahier-101-03-378.png? | ||
+ | \\ | ||
+ | |||
+ | Dans les options de '' | ||
+ | |||
+ | < | ||
+ | rd.break | ||
+ | </ | ||
+ | |||
+ | {{ Images_Cahier-101-03-379.png? | ||
+ | \\ | ||
+ | |||
+ | Appuyez sur **[Ctrl]** + **[x]** pour démarrer avec ces options qui vous amèneront à l' | ||
+ | |||
+ | {{ Images_Cahier-101-03-380.png? | ||
+ | \\ | ||
+ | |||
+ | À ce stade, le système de fichiers racine est monté en mode lecture seule //(ro)// dans le répertoire ''/ | ||
+ | |||
+ | < | ||
+ | switch_root:/# | ||
+ | |||
+ | switch_root:/# | ||
+ | </ | ||
+ | |||
+ | {{ Images_Cahier-101-03-381.png? | ||
+ | \\ | ||
+ | |||
+ | Une fois le système de fichiers remonté, changez-le en une //prison chroot// afin que le répertoire ''/ | ||
+ | |||
+ | < | ||
+ | switch_root:/# | ||
+ | |||
+ | sh-4.2# | ||
+ | </ | ||
+ | |||
+ | {{ Images_Cahier-101-03-382.png? | ||
+ | \\ | ||
+ | |||
+ | À partir d'ici, le mot de passe de **__root__** peut être réinitialisé à l’aide de la commande '' | ||
+ | |||
+ | < | ||
+ | sh-4.2# passwd | ||
+ | |||
+ | Changing password for user root. | ||
+ | New password: Nouveau-mot-de-passe-de-root | ||
+ | Retype new passwd: Nouveau-mot-de-passe-de-root | ||
+ | passwd: all authentification tokens updated successfully. | ||
+ | sh-4.2# | ||
+ | </ | ||
+ | |||
+ | {{ Images_Cahier-101-03-383.png? | ||
+ | \\ | ||
+ | |||
+ | Si vous n' | ||
+ | |||
+ | On crée le fichier ''/ | ||
+ | |||
+ | < | ||
+ | sh-4.2# touch / | ||
+ | |||
+ | sh-4.2# | ||
+ | </ | ||
+ | |||
+ | {{Images_Cahier-101-03-006.png? | ||
+ | |||
+ | On quitte l' | ||
+ | |||
+ | < | ||
+ | sh-4.2# exit | ||
+ | |||
+ | exit | ||
+ | sh-4.2# | ||
+ | </ | ||
+ | |||
+ | On quitte le shell racine '' | ||
+ | |||
+ | < | ||
+ | sh-4.2# exit | ||
+ | |||
+ | logout | ||
+ | ... | ||
+ | </ | ||
+ | |||
+ | ==== Vérification ==== | ||
+ | |||
+ | __À la console du serveur__, vous devriez pouvoir vous connecter et utiliser le système avec le nouveau mot de passe que vous avez créé. | ||
+ | |||
+ | ===== ERROR Failed to send host log message ===== | ||
+ | |||
+ | Cette erreur s' | ||
+ | |||
+ | {{ Images_Cahier-101-03-384.png? | ||
+ | \\ | ||
+ | |||
+ | <WRAP center> | ||
+ | <WRAP column 46%> | ||
+ | < | ||
+ | < | ||
+ | |{{ Images_Cahier-101-03-385.png? | ||
+ | \\ | ||
+ | Au retour, on amorce le //Serveur NethServer// | ||
+ | </ | ||
+ | <WRAP column 46%> | ||
+ | \\ | ||
+ | **Affichage ->** onglet **Écran -> Contrôleur graphique ->** on change pour **VboxVGA -> OK**. | ||
+ | |{{ Images_Cahier-101-03-386.png? | ||
+ | </ | ||
+ | </ | ||
+ | <WRAP clear></ | ||
+ | |||
+ | ===== Martian source ===== | ||
+ | |||
+ | Si dans le fichier journal ''/ | ||
+ | |||
+ | < | ||
+ | ...IPv4: martian source 192.168.1.1... | ||
+ | ...IPv4: martian source 192.168.1.1... | ||
+ | ...IPv4: martian source 192.168.1.1... | ||
+ | </ | ||
+ | |||
+ | === Passerelle du réseau de la carte enp0s3 === | ||
+ | |||
+ | On trouve notre passerelle en lançant un '' | ||
+ | |||
+ | < | ||
+ | [root@dorgee ~]# traceroute google.com | ||
+ | |||
+ | traceroute to google.com (172.217.165.14), | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | [root@dorgee ~]# | ||
+ | </ | ||
+ | L' | ||
+ | \\ | ||
+ | |||
+ | <WRAP column 46%> | ||
+ | **Configuration | ||
+ | |||
+ | On change l'// | ||
+ | |||
+ | **SOUMETTRE**. | ||
+ | </ | ||
+ | <WRAP column 46%> | ||
+ | |{{ Images_Cahier-101-03-395.png? | ||
+ | </ | ||
+ | <WRAP clear></ | ||
+ | |||
+ | ==== Serveurs DNS ==== | ||
+ | |||
+ | // | ||
+ | ... Le //DNS// de // | ||
+ | Le principal avantage bien sûr, c'est que contrairement au //DNS// de Google qui permet de mieux vous profiler pour vous balancer de la pub, on sait que // | ||
+ | |||
+ | // | ||
+ | |||
+ | //Autre référence:// | ||
+ | |||
+ | // | ||
+ | |||
+ | <WRAP center> | ||
+ | <WRAP column 46%> | ||
+ | |{{ Images_Cahier-101-03-396.png? | ||
+ | </ | ||
+ | <WRAP column 46%> | ||
+ | |{{ Images_Cahier-101-03-397.png? | ||
+ | </ | ||
+ | <WRAP clear></ | ||
+ | |||
+ | <WRAP column 46%> | ||
+ | **Configuration | ||
+ | |||
+ | On ajuste les //**DNS Primaire**// | ||
+ | |||
+ | {{Images_Cahier-101-03-005.png? | ||
+ | |||
+ | Le serveur //**DNS secondaire**// | ||
+ | |||
+ | **Soumettre**. | ||
+ | </ | ||
+ | <WRAP column 46%> | ||
+ | |{{ Images_Cahier-101-03-398.png? | ||
+ | </ | ||
+ | <WRAP clear></ | ||
+ | |||
+ | Si votre //FAI// filtre l' | ||
+ | |||
+ | ==== Serveur de production ==== | ||
+ | |||
+ | Une fois que vous maîtrisez tous les aspects de: // | ||
+ | |||
+ | {{ Images_Cahier-201-07-162.png? | ||
+ | |||
+ | ====== Introduction à l' | ||
+ | |||
+ | // | ||
+ | |||
+ | **'' | ||
+ | |||
+ | La documentation de '' | ||
+ | |||
+ | Tout d' | ||
+ | |||
+ | - **'' | ||
+ | - **'' | ||
+ | - **'' | ||
+ | |||
+ | Dès son invocation, '' | ||
+ | |||
+ | Afin de basculer du mode // | ||
+ | |||
+ | <WRAP column 45%> | ||
+ | Nous allons commencer par invoquer '' | ||
+ | < | ||
+ | vi | ||
+ | </ | ||
+ | |||
+ | Ce qui devrait donner l' | ||
+ | |||
+ | '' | ||
+ | |||
+ | < | ||
+ | i | ||
+ | </ | ||
+ | </ | ||
+ | <WRAP column 45%> | ||
+ | |{{ Images_Cahier-101-01-018.png? | ||
+ | </ | ||
+ | <WRAP clear></ | ||
+ | |||
+ | <WRAP column 45%> | ||
+ | Après avoir tapé le texte suivant: | ||
+ | |||
+ | < | ||
+ | vi est un éditeur de texte très | ||
+ | |||
+ | utile pour la communauté des | ||
+ | administrateurs. | ||
+ | </ | ||
+ | |||
+ | On obtient l' | ||
+ | </ | ||
+ | <WRAP column 45%> | ||
+ | |{{ Images_Cahier-101-01-019.png? | ||
+ | </ | ||
+ | <WRAP clear></ | ||
+ | |||
+ | Après cela, on pourrait passer en mode // | ||
+ | |||
+ | Une fois en mode // | ||
+ | |||
+ | Ceci aura pour effet de supprimer la ligne. | ||
+ | |||
+ | Si on est satisfait, il ne nous reste plus qu'à sauvegarder le document sous le nom '' | ||
+ | |||
+ | < | ||
+ | :w texte1.txt | ||
+ | </ | ||
+ | |||
+ | //(Pour les sauvegardes ultérieures, | ||
+ | |||
+ | Afin de quitter '' | ||
+ | |||
+ | < | ||
+ | :q texte1.txt | ||
+ | </ | ||
+ | |||
+ | Les commandes abondent dans '' | ||
+ | |||
+ | ^ <WRAP centeralign> | ||
+ | |// | ||
+ | |i (insert)|Insère un texte sur le curseur| | ||
+ | |I|Insère au début de la ligne| | ||
+ | |a (append)|Insère après le curseur| | ||
+ | |A|Insère à la fin de la ligne| | ||
+ | |Les flèches|pour les déplacements| | ||
+ | |Ctrl-F (forward)|Défiler d'un écran vers le bas| | ||
+ | |Ctrl-B (backward)|Défiler d'un écran vers le haut| | ||
+ | |nG (goto)|va à la nième ligne dans le texte| | ||
+ | |G|Va à la fin du texte| | ||
+ | |x|Effacer le caractère courant| | ||
+ | |dd|Effacer la ligne courante| | ||
+ | |D|Effacer depuis la position du curseur jusqu' | ||
+ | |db (DeleteBegining)|Effacer depuis la position courante jusqu' | ||
+ | |/ | ||
+ | |:w fichier|copie le texte courant sur le disque sous le nom fichier | | ||
+ | |:wq (write & quit)|écrit le fichier sur le disque et quitte vi.| | ||
+ | |: | ||
+ | |:set nu|Affiche le numérotage des lignes.| | ||
+ | \\ | ||
+ | \\ | ||
+ | {{NS-101_002_Banniere_Victoire.png? | ||
+ | \\ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ====== Crédits ====== | ||
+ | |||
+ | © 2019 RF-232\\ | ||
+ | Auteur: Michel-André.\\ | ||
+ | Remerciement: | ||
+ | Intégré par: Michel-André Robillard CLP\\ | ||
+ | Contact: michelandre at micronator.org | ||
+ | |||
+ | Répertoire de ce document: < | ||
+ | |||
+ | Historique des modifications: | ||
+ | |||
+ | ^Version^Date^Commentaire^Auteur| | ||
+ | |0.0.1|2019-09-18|Début.|Michel-André| | ||
+ | |12345678901| | |12345678901| | ||
+ | |||
+ | |||
+ | < | ||
+ | |||
+ | ===== AVIS DE NON-RESPONSABILITÉ ===== | ||
+ | |||
+ | Ce document est uniquement destiné à informer. Les informations, | ||
+ | |||
+ | RF‑232 ne peut être tenu pour responsable de dommages de quelque nature que ce soit, y compris des dommages directs ou indirects, ainsi que des dommages consécutifs résultant de l' | ||
+ | |||
+ | Chaque internaute doit prendre toutes les mesures appropriées //(mettre à jour régulièrement son logiciel antivirus, ne pas ouvrir des documents suspects de source douteuse ou non connue)// de façon à protéger le contenu de son ordinateur de la contamination d' | ||
+ | |||
+ | Toute reproduction interdite | ||
+ | Vous reconnaissez et acceptez que tout le contenu de ce document, incluant mais sans s’y limiter, le texte et les images, sont protégés par le droit d’auteur, les marques de commerce, les marques de service, les brevets, les secrets industriels et les autres droits de propriété intellectuelle. Sauf autorisation expresse de RF-232, vous acceptez de ne pas vendre, délivrer une licence, louer, modifier, distribuer, copier, reproduire, transmettre, | ||
+ | |||
+ | ==== Avertissement==== | ||
+ | |||
+ | Bien que nous utilisions ici un vocabulaire issu des techniques informatiques, | ||
+ | \\ | ||
+ | \\ |