Adgang
- Open the CTFd URL:
https://<SERVER-IP> - Acceptér advarslen om det selvsignerede certifikat.
- Gennemfør den engangsvise opsætningsguide.
- Opret administratorkontoen.
- Konfigurér dit CTF.
Vigtige filer og mapper
- Installationssti:
/root/ctfd - Compose-fil:
/root/ctfd/docker-compose.yml - Miljøfil:
/root/ctfd/.env - Uploads:
/root/ctfd/.data/CTFd/uploads - Logfiler:
/root/ctfd/.data/CTFd/logs - MariaDB Data:
/root/ctfd/.data/mysql - Redis Data:
/root/ctfd/.data/redis - Nginx-konfiguration:
/etc/nginx/sites-available/ctfd - SSL-certifikat:
/etc/nginx/ssl/ctfd.crt - SSL privat nøgle:
/etc/nginx/ssl/ctfd.key
Docker-administration
Kontroller containere:
docker ps
Se logs:
cd /root/ctfd
docker compose logs -f
Genstart tjenester:
cd /root/ctfd
docker compose restart
Stop services: Luk tjenester:
cd /root/ctfd
docker compose down
Start tjenester:
cd /root/ctfd
docker compose up -d
Nginx-administration
Testkonfiguration:
nginx -t
Genstart Nginx:
systemctl restart nginx
Genindlæs Nginx:
systemctl reload nginx
Tjek Nginx-status:
systemctl status nginx
Aktivering af SSL med et domæne
1. Peg dit domæne mod serverens IP.
2. Redigér Nginx-konfigurationen og erstat server_name _; with your domain in both HTTP and HTTPS blocks:
vim /etc/nginx/sites-available/ctfd
3. Installer 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. Erstat SSL-stier i 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