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

SSH & FIDO2 ❤️

Avant propos Dans cet article, je vais vous montrer comment vous authentifier à votre serveur SSH avec une clé FIDO2. J’ai récemment fait l’acquisition de 4 microcontrôleurs Raspberry Pico 2 afin de les convertir en tant que clés FIDO à pas cher. 2 sont au format USB A et 2 au format USB C. Je précise bien des Raspberry Pico 2 (RP2350) car ils disposent du Secure Boot et du Secure Lock ; ce qui n’est pas le cas des Pico première génération. ...

23 avril 2025 · 3 min · 597 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

À propos

Site encore en construction ⚠️ Le site est hébergé chez moi sur un NUC (Intel N100 + 16Go DDR4 + 512Go NVMe) Il sert un peu à tout et est mon principal serveur d’auto-hébergement. J’administre mes containers avec Dockge Pour le bon fonctionnement de ce site, j’utilise hugo comme framework et papermod comme thème. Traefik est mon reverse proxy et Simple Static Server est mon serveur web.

10 janvier 2025 · 1 min · 67 mots · Basile RIBOUR

Zabbix

Qu’est-ce que Zabbix ? Zabbix est une solution de monitoring open-source utilisée pour suivre la performance et la disponibilité des serveurs, des applications, des réseaux et de l’infrastructure informatique en général. Il permet de collecter des données en temps réel sur l’état des systèmes, d’envoyer des alertes en cas de détection de problèmes, et de générer des rapports et des graphiques pour faciliter l’analyse. Il utilise un modèle de collecte de données basé sur des agents installés sur les hôtes à surveiller ou via des requêtes SNMP (ou encore MQTT). ...

10 janvier 2025 · 6 min · 1159 mots · Basile RIBOUR