
đ§ CentOS â Guide Complet (CentOS Linux vs CentOS Stream âą RHEL ecosystem)
CentOS aujourdâhui = surtout CentOS Stream : une distro âcontinuously deliveredâ situĂ©e juste en amont de RHEL (entre Fedora et RHEL). :contentReference[oaicite:0]{index=0} CatĂ©gorie IDEO-Lab : O/S & Platforms.
CentOS : câest quoi ?
Historique, place dans lâĂ©cosystĂšme Enterprise Linux, pourquoi ça compte encore.
LinuxEnterpriseRHEL ecosystemCentOS Linux vs Stream
La bascule : CentOS Linux (classique) est EOL, Stream devient la voie principale.
EOLStreamRoadmapCentOS Stream (modĂšle)
âContinuously deliveredâ, upstream de RHEL, quand lâutiliser (ou pas) en prod.
UpstreamCIPlatformInstallation & bootstrap
ISO, minimal install, réseau, SSH, mises à jour, base tools, SELinux baseline.
InstallSSHSELinuxPaquets : dnf / yum
DNF, repos, modules, updates, rollback (si dispo), best practices âenterpriseâ.
DNFReposModulesSécurité (SELinux, firewall)
SELinux (enforcing), firewall-cmd, SSH hardening, patching, audit.
SELinuxFirewallDHardeningCloud & AWS (patterns)
Images, bootstrap, immutabilité, monitoring. (et quand préférer Amazon Linux / RHEL).
AWSEC2ImagesOps : systemd, logs, réseau
Playbook âprodâ : systemctl, journalctl, perf, IO, troubleshooting.
systemdLogsDebugMigrations & alternatives
AprĂšs CentOS Linux : choix âRHEL-likeâ (Rocky/Alma), ou Stream, ou RHEL.
MigrationRockyAlmaCockpit (Web Admin)
Administration web native : services, logs, stockage, users, perf.
CockpitWeb UIAnsible & System Roles
Configuration management standard EL : rĂŽles officiels, idempotence.
AnsibleIaCNginx / Web Stack
Nginx, PHP-FPM, reverse proxy, SELinux, perf & hardening.
NginxWebPostgreSQL (Serveur)
DB sur EL : install, tuning OS, SELinux, perf IO.
PostgreSQLDBABackups & DR
Snapshots, rsync, cloud backups, restore tests.
BackupDRKVM / Virtualisation
libvirt, virt-install, bridges, use-cases.
KVMVirtualisationRAID / mdadm
RAID logiciel, fiabilité, rebuild, monitoring.
RAIDStorageSELinux Deep-Dive
Contexts, booleans, ports, policies : niveau expert.
SELinuxSecurityCentOS aujourdâhui
Le projet CentOS met dĂ©sormais lâaccent sur CentOS Stream : une distribution livrĂ©e en continu, pensĂ©e comme plateforme de collaboration autour du dĂ©veloppement de RHEL. :contentReference[oaicite:1]{index=1}
Cas dâusage (rĂ©alistes)
| Cas | Pourquoi | Remarque |
|---|---|---|
| Dev/QA âEnterprise Linuxâ | proche de RHEL | tests avant prod |
| Contrib/RHEL ecosystem | upstream workflow | SIGs, packaging |
| Prod âtrĂšs rĂ©gulĂ©eâ | souvent non | prĂ©fĂ©rer RHEL / clones |

static/img/centos/centos_positioning.pngPositionnement dans lâĂ©cosystĂšme
CentOS Stream se prĂ©sente comme une âmidstreamâ entre Fedora et RHEL : une base collaborative, continuellement livrĂ©e, en avance de quelques pas sur RHEL. :contentReference[oaicite:2]{index=2}
| Couche | Objectif | Public |
|---|---|---|
| Fedora | innovation rapide | devs, features |
| CentOS Stream | preview/validation RHEL | builders, QA, ecosystem |
| RHEL | stabilité/support | prod enterprise |
Diagramme (flux simplifié)
Fedora (innovations)
â
âŒ
CentOS Stream (continuously delivered, upstream RHEL)
â
âŒ
RHEL (enterprise release stable + support)
Liens officiels
- Site CentOS : https://www.centos.org/ :contentReference[oaicite:3]{index=3}
- CentOS Stream (page) : https://www.centos.org/centos-stream/ :contentReference[oaicite:4]{index=4}
- Docs CentOS : https://docs.centos.org/ :contentReference[oaicite:5]{index=5}
- Docs CentOS Stream : https://docs.centos.org/centos-stream-docs/ :contentReference[oaicite:6]{index=6}
- Red Hat âWhat is CentOS Streamâ : https://www.redhat.com/en/topics/linux/what-is-centos-stream :contentReference[oaicite:7]{index=7}
CentOS Linux (classique) : fin de support
CentOS Linux 8 est arrivé en EOL le 31 décembre 2021. :contentReference[oaicite:8]{index=8} CentOS Linux 7 a atteint sa fin de vie le 30 juin 2024. :contentReference[oaicite:9]{index=9}
Dates clés (références projet CentOS / Red Hat)
| Produit | Statut | Date | Source |
|---|---|---|---|
| CentOS Linux 8 | EOL | 2021-12-31 | CentOS Project :contentReference[oaicite:10]{index=10} |
| CentOS Linux 7 | EOL | 2024-06-30 | CentOS blog + Red Hat :contentReference[oaicite:11]{index=11} |
| CentOS Stream 8 | Fin de builds | 2024-05-31 | CentOS Project :contentReference[oaicite:12]{index=12} |
Quoi faire si tu as (encore) des CentOS Linux
- Rester dans lâĂ©cosystĂšme RHEL : aller vers RHEL (support), ou vers une distro compatible âRHEL-likeâ.
- CentOS Stream : si tu veux ĂȘtre proche des Ă©volutions RHEL et participer Ă lâĂ©cosystĂšme. :contentReference[oaicite:13]{index=13}
- Alternatives populaires : Rocky Linux / AlmaLinux (souvent choisis aprĂšs la bascule). :contentReference[oaicite:14]{index=14}
Définition officielle (résumé)
CentOS Stream est une distribution oĂč la communautĂ© peut dĂ©velopper, tester et contribuer Ă une distribution livrĂ©e en continu en amont de RHEL, en collaboration avec les Ă©quipes RHEL. :contentReference[oaicite:15]{index=15}
Quand Stream est un bon choix
| Contexte | Stream | Pourquoi |
|---|---|---|
| Dev/QA enterprise | â | valider compat RHEL Ă venir |
| Build dâoutils/agents | â | anticiper changements |
| Prod âstrictement figĂ©eâ | â ïž | prĂ©fĂ©rer RHEL / compat clones |
| Audits/compliance lourde | â ïž | support/contrats attendus |
Pipeline simplifiĂ© (dev â prod)
Fedora (features rapides)
âŒ
CentOS Stream (integration / validation upstream RHEL)
âŒ
RHEL (release stable + support)

static/img/centos/centos_stream_pipeline.pngDocs Ă connaĂźtre
- CentOS Stream docs : https://docs.centos.org/centos-stream-docs/ :contentReference[oaicite:16]{index=16}
- Docs CentOS (hub) : https://docs.centos.org/ :contentReference[oaicite:17]{index=17}
- CentOS Stream page : https://www.centos.org/centos-stream/ :contentReference[oaicite:18]{index=18}
Installer âpropreâ (pattern)
- Choisir une installation minimal (moins de surface dâattaque)
- Activer SSH, créer un user admin (sudo/wheel), désactiver root login direct
- Configurer réseau (DHCP ou statique), hostname, timezone, NTP
- Mettre à jour immédiatement aprÚs install
Post-install âserveurâ (starter pack)
# updates
sudo dnf -y update
# base tools
sudo dnf -y install vim git curl wget htop tar unzip
sudo dnf -y install chrony
sudo systemctl enable --now chronyd
# firewall baseline (ex: SSH seulement)
sudo systemctl enable --now firewalld
sudo firewall-cmd --permanent --add-service=ssh
sudo firewall-cmd --reload
SELinux : le rĂ©flexe âEnterprise Linuxâ
Sur lâĂ©cosystĂšme EL (RHEL-like), SELinux est un pilier. Objectif : rester en Enforcing, et traiter les exceptions proprement (policies) plutĂŽt que dĂ©sactiver.
getenforce
sestatus
# logs utiles
sudo journalctl -t setroubleshoot
sudo journalctl | grep -i avc
Diagramme bootstrap (infra moderne)
Image/ISO â Minimal install â SSH + user admin
â
ââ dnf update
ââ firewalld (ports stricts)
ââ SELinux enforcing
ââ agents (monitoring/logs)
ââ config management (Ansible) / golden image (Packer)

static/img/centos/centos_bootstrap_flow.pngDNF : commandes essentielles
dnf --version
sudo dnf -y update
dnf list installed | head
dnf search nginx
sudo dnf -y install nginx
dnf info nginx
sudo dnf -y remove nginx
sudo dnf -y autoremove
Repos : ce que tu veux maĂźtriser
- Quels dépÎts sont activés (base/appstream/⊠selon EL)
- TraçabilitĂ© : âquel paquet vient dâoĂčâ
- Verrouillage : Ă©viter dâintroduire des repos tiers sans gouvernance
dnf repolist
dnf repoinfo
Modules (concept)
Les modules permettent de sĂ©lectionner des flux de versions pour certaines stacks. Ă utiliser avec discipline (sinon âdriftâ).
dnf module list
dnf module info
sudo dnf module enable :
Best practices âenterpriseâ
| RĂšgle | Pourquoi | Effet |
|---|---|---|
| Patch window | maĂźtrise du risque | moins dâincidents |
| Golden image + replace | rollback simple | infra reproductible |
| Repos gouvernés | cohérence | debug plus facile |
SSH hardening (baseline)
# cÎté serveur : no password + no root
sudo sed -i 's/^#\?PasswordAuthentication.*/PasswordAuthentication no/' /etc/ssh/sshd_config
sudo sed -i 's/^#\?PermitRootLogin.*/PermitRootLogin no/' /etc/ssh/sshd_config
sudo systemctl restart sshd
FirewallD (pattern)
sudo systemctl enable --now firewalld
sudo firewall-cmd --state
sudo firewall-cmd --get-active-zones
# ouvrir web
sudo firewall-cmd --permanent --add-service=http
sudo firewall-cmd --permanent --add-service=https
sudo firewall-cmd --reload
SELinux : garder âEnforcingâ
getenforce
sestatus
sudo journalctl | grep -i avc
Policy de sécurité (simple & solide)
- Ports minimaux (SG + firewall)
- Clés SSH uniquement, bastion si besoin
- Patching régulier (cadencé)
- Logs centralisés + alerting (auth, sudo, anomalies)
- Backups + restore testés
Pattern EC2 âcleanâ
Launch instance
ââ Image (CentOS Stream / RHEL-like)
ââ Instance type
ââ Security Groups (ports minimum)
ââ Keypair (SSH)
ââ User-data (bootstrap minimal)
ââ Monitoring + logs + backups

static/img/centos/aws_centos_reference_arch.pngImmutabilité (recruteur-friendly)
| Approche | Principe | Pourquoi |
|---|---|---|
| Golden image | AMI/Packer | reproductible |
| Rolling replace | ASG / blue-green | rollback rapide |
| Config mgmt | Ansible | traçabilité |
Quel OS sur AWS (décision pragmatique)
| Besoin | Choix | Pourquoi |
|---|---|---|
| Prod avec support Enterprise | RHEL | contrat + conformité |
| Dev/QA RHEL ecosystem | CentOS Stream | upstream RHEL :contentReference[oaicite:20]{index=20} |
| Remplacer âancien CentOS Linuxâ | Rocky/Alma | alternatives courantes :contentReference[oaicite:21]{index=21} |
Playbook âprodâ (toujours le mĂȘme)
1) SymptÎme précis (quoi / depuis quand / scope)
2) Service (systemctl status) + logs (journalctl)
3) Réseau (ip/route/DNS/ports)
4) Ressources (CPU/RAM/IO/disk)
5) Changement récent ? (deploy/update/conf)
6) Fix minimal + plan rollback
7) Post-mortem (action préventive)
Commandes réflexes
systemctl status nginx
systemctl restart nginx
journalctl -u nginx --since "1 hour ago"
ip a ; ip r
ss -lntp
df -h ; free -h
Perf (baseline)
uptime
top
vmstat 1
iostat -xz 1 # si sysstat installé
Options ârĂ©alistesâ
| Option | Pour qui | Notes |
|---|---|---|
| CentOS Stream | dev/QA, builders | upstream RHEL :contentReference[oaicite:22]{index=22} |
| RHEL | prod enterprise | support/compliance |
| Rocky / Alma | ex-CentOS Linux | alternatives courantes :contentReference[oaicite:23]{index=23} |
Plan de migration (pro, sans panique)
1) Inventaire : OS, version, paquets clés, services, dépendances
2) Classer : prod critique / non critique / dev
3) Choisir cible : Stream vs RHEL vs Rocky/Alma
4) Faire un clone/staging : tests fonctionnels + perf
5) Automatiser : IaC + config management
6) Rollout : blue/green ou rolling
7) Observabilité : logs + metrics + alerting
8) Décommission : old nodes
Checklist âavant cutoverâ
- Backups + restore testés
- Ports/Firewall identiques
- SELinux policy validĂ©e (ou plan dâajustement)
- Monitoring OK (CPU/IO/disk, logs auth)
- Rollback prĂȘt (image prĂ©cĂ©dente, snapshots)

static/img/centos/migration_checklist.pngĂ quoi sert Cockpit ?
Cockpit est une interface web officielle Red Hat / CentOS pour administrer un serveur : services, logs, réseau, stockage, users, conteneurs, VMs.
Installation
sudo dnf -y install cockpit
sudo systemctl enable --now cockpit.socket
# accĂšs : https://server:9090
Ce que tu peux faire
| Services | start/stop, status systemd |
| Logs | journald graphique |
| Storage | LVM, partitions, mounts |
| Users | comptes, sudo |
| Perf | CPU, RAM, IO temps réel |
Pourquoi Ansible sur CentOS ?
Ansible est lâoutil standard de configuration management dans lâĂ©cosystĂšme EL.
Installation
sudo dnf -y install ansible-core
ansible --version
System Roles officiels
| network | interfaces, routes |
| timesync | chrony/NTP |
| firewall | firewalld |
| selinux | booleans, state |
| storage | LVM |
Installation
sudo dnf -y install nginx
sudo systemctl enable --now nginx
SELinux (classique)
setsebool -P httpd_can_network_connect on
semanage port -a -t http_port_t -p tcp 8080
Bonnes pratiques
- Reverse proxy + app isolée
- Timeouts maßtrisés
- Logs + rotation
Installation (repo PGDG)
sudo dnf -y install https://download.postgresql.org/pub/repos/yum/reporpms/EL-9-x86_64/pgdg-redhat-repo-latest.noarch.rpm
sudo dnf -y install postgresql15-server
Tuning OS essentiel
| IO scheduler | SSD â none |
| vm.swappiness | faible |
| /var/lib/pgsql | disk dédié |
RĂšgle dâor
Backup non testé = pas un backup
Stratégies
| Snapshots | rapides, pas suffisants seuls |
| rsync | simple, efficace |
| Cloud | S3, Glacier |
rsync -av --delete /data backup:/data
Installation
sudo dnf -y install qemu-kvm libvirt virt-install
sudo systemctl enable --now libvirtd
Cas dâusage
- Labs internes
- Legacy workloads
- Isolations fortes
RAID â Backup
RAID protĂšge contre panne disque, pas erreur humaine.
Types courants
| RAID 1 | miroir |
| RAID 5 | perf + tolérance |
| RAID 10 | perf + sécurité |
cat /proc/mdstat
mdadm --detail /dev/md0
Les 3 piliers SELinux
| Contexts | type, user, role, level |
| Booleans | switchs comportement |
| Policies | rĂšgles autorisation |
Commandes clés
ls -Z /var/www
semanage fcontext -l | head
getsebool -a | head
