Truy cập
- Open the CTFd URL:
https://<SERVER-IP> - Chấp nhận cảnh báo chứng chỉ tự ký.
- Hoàn thành trình hướng dẫn cài đặt một lần.
- Tạo tài khoản quản trị viên.
- Cấu hình CTF của bạn.
File và thư mục quan trọng
- Đường dẫn cài đặt:
/root/ctfd - Tệp Compose:
/root/ctfd/docker-compose.yml - Tệp môi trường:
/root/ctfd/.env - Uploads:
/root/ctfd/.data/CTFd/uploads - Nhật ký:
/root/ctfd/.data/CTFd/logs - MariaDB Data:
/root/ctfd/.data/mysql - Dữ liệu Redis:
/root/ctfd/.data/redis - Cấu hình Nginx:
/etc/nginx/sites-available/ctfd - Chứng chỉ SSL:
/etc/nginx/ssl/ctfd.crt - Khóa riêng SSL:
/etc/nginx/ssl/ctfd.key
Quản lý Docker
Kiểm tra các container:
docker ps
Xem log:
cd /root/ctfd
docker compose logs -f
Khởi động lại các dịch vụ:
cd /root/ctfd
docker compose restart
Dừng dịch vụ:
cd /root/ctfd
docker compose down
Bắt đầu dịch vụ:
cd /root/ctfd
docker compose up -d
Quản lý Nginx
Cấu hình kiểm thử:
nginx -t
Khởi động lại Nginx:
systemctl restart nginx
Tải lại Nginx:
systemctl reload nginx
Kiểm tra trạng thái Nginx:
systemctl status nginx
Kích hoạt SSL với một tên miền
1. Trỏ tên miền của bạn về IP máy chủ.
2. Chỉnh sửa cấu hình Nginx và thay thế server_name _; with your domain in both HTTP and HTTPS blocks:
vim /etc/nginx/sites-available/ctfd
3. Cài đặt 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. Thay thế các đường dẫn SSL trong cấu hình 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