|
|
|
@ -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
|
|
|
|
|
|
|
|
|
|