Accès
- Open the CTFd URL:
https://<SERVER-IP> - Acceptez l'avertissement concernant le certificat auto-signé.
- Terminez l'assistant de configuration unique.
- Créez le compte administrateur.
- Configurez votre CTF.
Fichiers et répertoires importants
- Chemin d'installation :
/root/ctfd - Fichier Compose :
/root/ctfd/docker-compose.yml - Fichier d'environnement :
/root/ctfd/.env - Uploads:
/root/ctfd/.data/CTFd/uploads - Journaux :
/root/ctfd/.data/CTFd/logs - MariaDB Data:
/root/ctfd/.data/mysql - Redis Données :
/root/ctfd/.data/redis - Config Nginx :
/etc/nginx/sites-available/ctfd - Certificat SSL :
/etc/nginx/ssl/ctfd.crt - Clé privée SSL :
/etc/nginx/ssl/ctfd.key
Gestion de Docker
Vérifier les conteneurs :
docker ps
Voir les logs :
cd /root/ctfd
docker compose logs -f
Redémarrer les services :
cd /root/ctfd
docker compose restart
Arrêter les services :
cd /root/ctfd
docker compose down
Démarrer les services :
cd /root/ctfd
docker compose up -d
Gestion de Nginx
Configuration de test :
nginx -t
Redémarrer Nginx :
systemctl restart nginx
Recharger Nginx :
systemctl reload nginx
Vérifier le statut de Nginx :
systemctl status nginx
Activer SSL avec un domaine
1. Faites pointer votre domaine vers l'IP du serveur.
2. Modifiez la configuration Nginx et remplacez server_name _; with your domain in both HTTP and HTTPS blocks:
vim /etc/nginx/sites-available/ctfd
3. Installez Certbot :
apt install -y certbot python3-certbot-nginx
4. Generate a Let's Encrypt certificate:
certbot certonly --nginx --non-interactive --agree-tos --email [email protected] -d yourdomain.com
5. Remplacez les chemins SSL dans la config Nginx :
vim /etc/nginx/sites-available/ctfd
# Before:
# ssl_certificate /etc/nginx/ssl/ctfd.crt;
# ssl_certificate_key /etc/nginx/ssl/ctfd.key;
# After:
# ssl_certificate /etc/letsencrypt/live/yourdomain.com/fullchain.pem;
# ssl_certificate_key /etc/letsencrypt/live/yourdomain.com/privkey.pem;
6. Reload Nginx:
systemctl reload nginx