การเข้าถึง
- Open the CTFd URL:
https://<SERVER-IP> - ยืนยันคำเตือน self-signed certificate
- กรอกวิซาร์ดการตั้งค่าครั้งเดียวให้เสร็จ
- สร้างบัญชีผู้ดูแลระบบ
- กำหนดค่า CTF ของคุณ
ไฟล์และไดเรกทอรีที่สำคัญ
- เส้นทางการติดตั้ง:
/root/ctfd - ไฟล์ Compose:
/root/ctfd/docker-compose.yml - ไฟล์สภาพแวดล้อม:
/root/ctfd/.env - Uploads:
/root/ctfd/.data/CTFd/uploads - บันทึก:
/root/ctfd/.data/CTFd/logs - MariaDB Data:
/root/ctfd/.data/mysql - ข้อมูล Redis:
/root/ctfd/.data/redis - การตั้งค่า Nginx:
/etc/nginx/sites-available/ctfd - ใบรับรอง SSL:
/etc/nginx/ssl/ctfd.crt - คีย์ส่วนตัว SSL:
/etc/nginx/ssl/ctfd.key
การจัดการ Docker
ตรวจสอบคอนเทนเนอร์
docker ps
ดู logs:
cd /root/ctfd
docker compose logs -f
รีสตาร์ทบริการ:
cd /root/ctfd
docker compose restart
หยุดบริการ:
cd /root/ctfd
docker compose down
เริ่มบริการ:
cd /root/ctfd
docker compose up -d
การจัดการ Nginx
การตั้งค่าการทดสอบ:
nginx -t
รีสตาร์ท Nginx:
systemctl restart nginx
รีโหลด Nginx:
systemctl reload nginx
ตรวจสอบสถานะ Nginx:
systemctl status nginx
เปิดใช้งาน SSL กับโดเมน
1. ชี้โดเมนของคุณไปยัง IP ของ server
2. แก้ไขการตั้งค่า Nginx และแทนที่ server_name _; with your domain in both HTTP and HTTPS blocks:
vim /etc/nginx/sites-available/ctfd
3. ติดตั้ง 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. แทนที่ SSL paths ใน 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