Erişim
- Open the CTFd URL:
https://<SERVER-IP> - Kendinden imzalı sertifika uyarısını kabul edin.
- Tek seferlik kurulum sihirbazını tamamlayın.
- Yönetici hesabını oluşturun.
- CTF'nizi yapılandırın.
Önemli Dosyalar ve Dizinler
- Kurulum yolu:
/root/ctfd - Compose Dosyası:
/root/ctfd/docker-compose.yml - Ortam Dosyası:
/root/ctfd/.env - Uploads:
/root/ctfd/.data/CTFd/uploads - Günlükler:
/root/ctfd/.data/CTFd/logs - MariaDB Data:
/root/ctfd/.data/mysql - Redis Verileri:
/root/ctfd/.data/redis - Nginx Yapılandırması:
/etc/nginx/sites-available/ctfd - SSL Sertifikası:
/etc/nginx/ssl/ctfd.crt - SSL Özel Anahtarı:
/etc/nginx/ssl/ctfd.key
Docker Yönetimi
Konteynerları kontrol et:
docker ps
Logları göster:
cd /root/ctfd
docker compose logs -f
Hizmetleri yeniden başlatın:
cd /root/ctfd
docker compose restart
Hizmetleri Durdur:
cd /root/ctfd
docker compose down
Hizmetleri başlat:
cd /root/ctfd
docker compose up -d
Nginx yönetimi
Test yapılandırması:
nginx -t
Nginx'i Yeniden Başlat:
systemctl restart nginx
Nginx'i yeniden yükle:
systemctl reload nginx
Nginx durumunu kontrol et:
systemctl status nginx
Bir Alan Adı ile SSL Etkinleştirme
1. Alan adını sunucu IP'sine yönlendir.
2. Nginx yapılandırmasını düzenleyin ve şunu değiştirin server_name _; with your domain in both HTTP and HTTPS blocks:
vim /etc/nginx/sites-available/ctfd
3. Certbot'u kur:
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. Nginx config'inde SSL yollarını değiştir:
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