Configs

HAProxy /etc/haproxy/haproxy.cfg global log 127.0.0.1 local2 chroot /var/lib/haproxy pidfile /var/run/haproxy.pid user haproxy group haproxy daemon defaults log global timeout connect 5000ms timeout client 50000ms timeout server 50000ms frontend http_front bind *:80 redirect scheme https code 301 if !{ ssl_fc } mode http frontend stats mode http bind *:8404 stats enable stats uri /stats stats refresh 10s stats auth haproxy:haproxy stats admin if TRUE stats show-modules frontend https_front bind *:443 ssl crt /etc/haproxy/haproxy.pem acl glpi hdr(host) glpi.bagdad.lan acl wiki hdr(host) wiki.bagdad.lan acl zabbix hdr(host) zabbix.bagdad.lan acl host_ha hdr(host) -i ha.bagdad.lan use_backend glpi_backend if glpi use_backend wiki_backend if wiki use_backend zabbix_backend if zabbix use_backend backend_nginxha if host_ha option forwardfor mode http backend backend_nginxha balance roundrobin server ephilates 172.16.96.197:80 check server aloades 172.16.96.198:80 check mode http backend glpi_backend server glpi 172.16.96.196:80 check mode http backend wiki_backend server wiki 172.16.96.194:3000 check mode http backend zabbix_backend server zabbix 172.16.96.51:80 check mode http frontend db_front bind *:3306 mode tcp default_backend db_backend backend db_backend mode tcp server db 172.16.96.37:3306 check Keepalived /etc/keepalived/keepalived.conf | KERES ! Configuration File for keepalived global_defs { } vrrp_script chk_haproxy { script "killall -0 haproxy" # check if haproxy is on interval 2 # check every 2 seconds weight 2 # add 2 points of prio if OK } vrrp_instance haproxy { state MASTER interface ens192 virtual_router_id 51 priority 101 advert_int 1 authentication { auth_type PASS auth_pass G6L7@UgEgz#4RHP2WtU } virtual_ipaddress { 172.16.96.220 } unicast_src_ip 172.16.96.210 # This node unicast_peer { 172.16.96.211 # Other nodes } track_script { chk_haproxy } } /etc/keepalived/keepalived.conf | CYAMITES ! Configuration File for keepalived global_defs { } vrrp_script chk_haproxy { script "killall -0 haproxy" # check if haproxy is running interval 2 # check every 2 seconds weight 2 # add 2 points of prio if OK } vrrp_instance haproxy { state BACKUP interface ens192 virtual_router_id 51 priority 100 advert_int 1 authentication { auth_type PASS auth_pass G6L7@UgEgz#4RHP2WtU } virtual_ipaddress { 172.16.96.220 } unicast_src_ip 172.16.96.211 # This node unicast_peer { 172.16.96.210 # Other nodes } track_script { chk_haproxy } } NGINX /etc/nginx/conf.d/ha.bagdad.lan.conf | EPHILATES server { listen 80; server_name ephilates; server_name ha.bagdad.lan; access_log /var/log/nginx/access_ha.bagdad.lan.log; error_log /var/log/nginx/error_ha.bagdad.lan.log; location / { return 200 "Je suis EPHILATES !"; add_header Content-Type text/plain; } } /etc/nginx/conf.d/ha.bagdad.lan.conf | ALOADES server { listen 80; server_name aloades; server_name ha.bagdad.lan; access_log /var/log/nginx/access_ha.bagdad.lan.log; error_log /var/log/nginx/error_ha.bagdad.lan.log; location / { return 200 "Je suis ALOADES !"; add_header Content-Type text/plain; } } Vérifier l’état des services Vérifier le fonctionnement du roundrobin Rendez-vous sur une machine qui dispose du DNS AD configuré. Ouvrez un invite de commande et tapez la commande suivante : curl -k -H "Host: ha.bagdad.lan" https://172.16.96.220 Relancer la commande plusieurs fois afin de passer d’EPHILATES à ALOADES et ainsi de suite. ...

28 avril 2025 Â· 4 min Â· 771 mots Â· Basile RIBOUR

Srv. Web

Installation d’un serveur web ecommerce.fr sur une machine unique Installation des services Installation des paquets : dnf install nginx php-fpm mariadb-server php-mysqlnd Configuration d’nginx Lancement et démarrage automatique du service nginx : systemctl enable --now nginx Autorisation du protocole http dans firewall-cmd : firewall-cmd --permanent --add-service=http && firewall-cmd --reload Test de connexion sur l’IP de la machine : Configuration de mariadb Lancement et démarrage automatique du service mariadb : systemctl enable --now mariadb ““Sécurisation”” du serveur mariadb mysql_secure_installation Switch to unix_socket authentication [Y/n] Change the root password? [Y/n] n Remove anonymous users? [Y/n] Disallow root login remotely? [Y/n] Remove test database and access to it? [Y/n] Reload privilege tables now? [Y/n] Création d’une base de données et d’un utilisateur : mysql -u root -p create database mabdd; CREATE USER 'hi'@'localhost' IDENTIFIED BY 'motdepasse'; GRANT ALL PRIVILEGES ON mabdd.* TO 'hi'@'localhost'; FLUSH PRIVILEGES; exit Déploiement du site ecommerce.fr Créer le dossier pour le site : ...

20 janvier 2025 Â· 9 min Â· 1875 mots Â· Basile RIBOUR

Mise en place d'une PKI

Prérequis Création d’un répertoire dédié Création d’un fichier index.txt qui va contenir la trace de chaque certificat émis Création d’un fichier serial qui indiquera le nombre de certificat émis mkdir -p /etc/ssl/private cd /etc/ssl/private touch index.txt echo '01' > serial Génération de notre CA Root Lorsque nous allons générer notre CA, openssl nous demandera un mot de passe. Ce mot de passe sera celui qui nous permettra de signer les certificats présents sous notre autorité de certification. ...

11 janvier 2025 Â· 2 min Â· 419 mots Â· Basile RIBOUR