Toegang
- Open the CTFd URL:
https://<SERVER-IP> - Accepteer de waarschuwing over het zelfondertekende certificaat.
- Voltooi de eenmalige installatiewizard.
- Maak het beheerdersaccount aan.
- Configureer uw CTF.
Belangrijke bestanden en mappen
- Installatiepad:
/root/ctfd - Compose-bestand:
/root/ctfd/docker-compose.yml - Omgevingsbestand:
/root/ctfd/.env - Uploads:
/root/ctfd/.data/CTFd/uploads - Logboeken:
/root/ctfd/.data/CTFd/logs - MariaDB Data:
/root/ctfd/.data/mysql - Redis-gegevens:
/root/ctfd/.data/redis - Nginx Configuratie:
/etc/nginx/sites-available/ctfd - SSL-certificaat:
/etc/nginx/ssl/ctfd.crt - SSL privésleutel:
/etc/nginx/ssl/ctfd.key
Docker-beheer
Containers controleren:
docker ps
Logs bekijken:
cd /root/ctfd
docker compose logs -f
Services opnieuw starten:
cd /root/ctfd
docker compose restart
Services stoppen:
cd /root/ctfd
docker compose down
Services starten:
cd /root/ctfd
docker compose up -d
Nginx beheren
Testconfiguratie:
nginx -t
Nginx opnieuw starten:
systemctl restart nginx
Nginx herladen:
systemctl reload nginx
Nginx-status controleren:
systemctl status nginx
SSL inschakelen met een domein
1. Wijs je domein naar het server-IP.
2. Nginx-configuratie bewerken en vervangen server_name _; with your domain in both HTTP and HTTPS blocks:
vim /etc/nginx/sites-available/ctfd
3. Installeer 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. Vervang de SSL-paden in de Nginx-config:
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