Documentation Technique Proxmox (Work in progress)
Publié le 17 mars 2026
Sommaire :
- 1. Présentation générale
- 1.1 Objectif
- 2. Architecture Technique.
- 2.1 Architecture Générale.
- 3. Environnement Technique.
- 4. Installation de Proxmox.
- 5. Configuration Réseau.
- 5.1 Interface réseau Proxmox.
- 6. Création des Containers.
- 6.1 Container WEB.
- 6.2 Container SQL.
- 7. Tests de Connectivité.
- 7.1 Test Internet
- 7.2 Test SQL. 4
- 7.3 Test Accès WEB. 4
- 8. Sécurité. 4
- 9. Conclusion. 5
1. Présentation Générale
1.1 Objectif
L’objectif de ce projet est de mettre en place une infrastructure virtualisée permettant l’hébergement d’un serveur WEB (Front-end) et d’un serveur SQL (Back-end). Ces deux services sont déployés dans des containers LXC hébergés sur un hyperviseur Proxmox VE, lui-même installé dans une machine virtuelle sous Oracle VirtualBox.
L’infrastructure permet :
- Accès Internet aux containers
- Accès du serveur WEB à la base de données
- Accès client au serveur WEB
- Isolation des services via le réseau
2. Architecture Technique
2.1 Architecture Générale
Machine Physique > Oracle VirtualBox > VM Proxmox VE > Container LXC WEB (Front-end) / Container LXC SQL (Base de données)
3. Environnement Technique
- Hyperviseur : Proxmox VE
- Virtualisation : Oracle VirtualBox
- Containers : LXC
- Serveur WEB : Nginx
- OS du serveur WEB : Debian
- Base de données : MySQL
- OS du serveur SGBDR : Ubuntu
4. Installation de Proxmox
Proxmox VE a été installé sur une machine virtuelle créée sous Oracle VirtualBox avec les caractéristiques suivantes :
- 16 Go RAM
- 4 CPU
- 65 Go de stockage
- Carte réseau en mode Accès par pont (Bridge)
5. Configuration Réseau
5.1 Interface réseau Proxmox
Le bridge réseau vmbr0 a été configuré dans le fichier /etc/network/interfaces
| Configuration : auto lo iface lo inet loopback iface nic0 inet manual iface nic1 inet manual auto vmbr0 iface vmbr0 inet static address 10.0.99.X/24 gateway 10.0.255.254 bridge-ports nic0 bridge-stp off bridge-fd 0 auto vmbr1 iface vmbr1 inet static address 192.168.1.254/24 bridge-ports none bridge-stp off bridge-fd 0 # Active le foward IP post-up echo 1 > /proc/sys/net/ipv4/ip_forward # Masquerading (Permet aux conteneur d’avoir internet sortant via vmbr0) post-up iptables -t nat -A POSTROUTING -s ‘192.168.1.0/24’ -o vmbr0 -j MASQUERADE post-down iptables -t nat -D POSTROUTING -s ‘192.168.1.0/24’ -o vmbr0 -j MASQUERADE # Règle pour le WEB (port 80) vers le conteneur 102 # CORRECTION ICI : on pointe vers 192.168.1.102, par 10.0.99.102 post-up iptables -t nat -A PREROUTING -p tcp –dport 80 -d 10.0.99.X -j DNAT –to-destination 192.168.1.X:80 post-down iptables -t nat -A PREROUTING -p tcp –dport 80 -d 10.0.99.X -j DNAT –to-destination 192.168.1.X:80 # Règle connection en SSH en port 2222 # post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp –dport 2222 -d 10.0.99.101 -j DNAT –to-destination 192.168.1.X:22 post-down iptables -t nat -D PREROUTING -i vmbr0 -p tcp –dport 2222 -d 10.0.99.101 -j DNAT –to-destination 192.168.1.X:22 source /etc/network/interfaces.d/* |
6. Création des Containers
6.1 Container WEB
- Nom : CT-WEB
- IP : 192.168.1.102/24
- Gateway : 192.168.1.254
- OS : Debian
- RAM : 2048 Mo
| Installation du serveur WEB (ajouter sudo si vous n’êtes pas root) : $ apt update && apt upgrade $ apt install nginx -y $ apt install php php-fpm php-cli php-mysql php-curl php-gd php-mbstring php-xml php-zip -y $ nano /etc/nginx/site-available/default CONFIG NGINX : ## # You should look at the following URL’s in order to grasp a solid understanding # of Nginx configuration files in order to fully unleash the power of Nginx. # https://www.nginx.com/resources/wiki/start/ # https://www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/ # https://wiki.debian.org/Nginx/DirectoryStructure # # In most cases, administrators will remove this file from sites-enabled/ and # leave it as reference inside of sites-available where it will continue to be # updated by the nginx packaging team. # # This file will automatically load configuration files provided by other # applications, such as Drupal or WordPress. These applications will be made # available underneath a path with that package name, such as /drupal8. # # Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples. ## # Default server configuration # server { listen 80 default_server; listen [::]:80 default_server; # SSL configuration # # listen 443 ssl default_server; # listen [::]:443 ssl default_server; # # Note: You should disable gzip for SSL traffic. # See: https://bugs.debian.org/773332 # # Read up on ssl_ciphers to ensure a secure configuration. # See: https://bugs.debian.org/765782 # # Self signed certs generated by the ssl-cert package # Don’t use them in a production server! # # include snippets/snakeoil.conf; root /var/www/html; # Add index.php to the list if you are using PHP index index.php index.html index.htm index.nginx-debian.html; server_name _; location / { # First attempt to serve request as file, then # as directory, then fall back to displaying a 404. try_files $uri $uri/ =404; } # pass PHP scripts to FastCGI server # location ~ \.php$ { include snippets/fastcgi-php.conf; # # # With php-fpm (or other unix sockets): fastcgi_pass unix:/run/php/php8.2-fpm.sock; # # With php-cgi (or other tcp sockets): # fastcgi_pass 127.0.0.1:9000; } # deny access to .htaccess files, if Apache’s document root # concurs with nginx’s one # location ~ /\.ht { deny all; } } # Virtual Host configuration for example.com # # You can move that to a different file under sites-available/ and symlink that # to sites-enabled/ to enable it. # #server { # listen 80; # listen [::]:80; # # server_name example.com; # # root /var/www/example.com; # index index.html; # # location / { # try_files $uri $uri/ =404; # } #} Ne pas oublier de recharger et de relancer nginx avec ces commandes : $ systemctl reload nginx $ systemctl restart nginx |
6.2 Container SQL
- Nom : CT-SQL
- IP : 192.168.1.103/24
- Gateway : 192.168.1.254
- OS : Ubuntu
- RAM : 2048Mo
| Installation du serveur SQL : $ apt update && apt upgrade $ apt install mariadb-server |
7. Tests de Connectivité
7.1 Test Internet
ping 8.8.8.8
7.2 Test SQL
mysql -h 192.168.100.20 -u root -p
7.3 Test Accès WEB
http://192.168.100.10
8. Sécurité
- Isolation des services WEB et SQL
- Communication SQL uniquement autorisée depuis le WEB
- NAT pour accès Internet sécurisé
- Accès aux ports limités via IPTABLES
9. Conclusion
Cette infrastructure virtualisée permet le déploiement de services isolés, la communication sécurisée entre les composants, l’accès externe au serveur WEB et l’accès interne à la base de données via l’hyperviseur Proxmox installé dans un environnement virtualisé.