From 10f6cb423bac15c6210cb05eeef38241c211247f Mon Sep 17 00:00:00 2001 From: mathieu Date: Thu, 28 Mar 2019 00:24:13 +0100 Subject: [PATCH] =?UTF-8?q?Mettre=20=C3=A0=20jour=20'Neocom/notep-TP'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Neocom/notep-TP | 45 +++++++++++++++++++++++++-------------------- 1 file changed, 25 insertions(+), 20 deletions(-) diff --git a/Neocom/notep-TP b/Neocom/notep-TP index b8024c0..49637ee 100644 --- a/Neocom/notep-TP +++ b/Neocom/notep-TP @@ -32,22 +32,36 @@ mount -t nfs mount -t nfs 51.38.178.108:/mnt/nfs/www /usr/share/nginx/nfs/html/ ## Installation stack nginx php7.0 mysql-server Client : apt install nginx php7.0 phpmyadmin [[Ce dernier install tout un tas de dépendance PHP]] - -https://git.aumont.fr/mathieu/Bloc-Note/raw/branch/master/Neocom/default - +Récupérer la configuration nginx +wget https://git.aumont.fr/mathieu/Bloc-Note/raw/branch/master/Neocom/default +La copier vers : /etc/nginx/sites-availables/default +systemct restart nginx. ## Installation MariaDB sur Node2 -apt get install mariadb-server +### A compléter +## S'appuyer sur https://linuxtechlab.com/creating-master-slave-replication-mariadb/ +apt get install mariadb-server Sur node server : Editer : /etc/mysql/mariadb.conf.d/50-server.cnf -bind-address = 51.38.178.107 [IP de la machine] -replicate-do-db=codepostaux +bind-address = 51.38.178.107 [IP de la machine locale] +replicate-do-db=[[NomDeLaBaseRepliquee]] log-bin -Se connecter en root sur mysql. +Se connecter en root sur mysql hote. + +STOP SLAVE; +GRANT REPLICATION SLAVE ON *.* TO ‘slaveuser’@’%’ IDENTIFIED BY ‘password’; +FLUSH PRIVILEGES; +FLUSH TABLES WITH READ LOCK; +SHOW MASTER STATUS; + +Dumper la base sur master +Importer la base sur slave + + ### Création certificat ### Probléme @@ -63,29 +77,20 @@ root password + phpmyadmin : +M?ex3rr!Y%)Ua_# Impossible d'uploader +##### Installation firewall apt install ufw +Par défaut ce dernier est desactivé + ufw allow ssh ufw allow http ufw allow https ufw allow mysql (car écoute sur socket ip) ufw enable - - - - -1 - Noeud deux : apt install nfs-kernel-server -2 - Node 2 : mkdir -p /mnt/nfs/www -/mnt/nfs/www 51.38.178.107(r,no_subtree_check,sync,no_root_squash) - -3- Install NFS Client apt install nfs client -4 - Client : mkdir -p /usr/share/nginx/nfs/html -5- Client : apt-install nginx -6 - Client : mount -t nfs 51.38.178.108:/mnt/nfs/www /usr/share/nginx/nfs/html/ - +### A compléter. Install Ngnix