การเข้าถึง
- URL:
https://<SERVER_IP> - ป้องกันด้วย HTTP Basic Authentication
- ข้อมูลรับรองถูกเก็บไว้ใน:
/root/.adclaw-credentials - ดูได้ด้วย:
cat /root/.adclaw-credentials
ขั้นตอนแรก
- เปิด URL ในเบราว์เซอร์ของคุณ
- ยอมรับคำเตือน SSL แบบ self-signed
- กรอกชื่อผู้ใช้และรหัสผ่านจากไฟล์ข้อมูลรับรอง
- คุณจะถูกนำไปยังหน้าอินเทอร์เฟซ AdClaw
ไฟล์และไดเรกทอรีที่สำคัญ
- ไดเรกทอรีติดตั้ง:
/opt/adclaw - Docker Compose:
/opt/adclaw/docker-compose.yml - ไฟล์ environment:
/opt/adclaw/.env - ปริมาณข้อมูล:
/var/lib/docker/volumes/adclaw-data/_data - Secret volume:
/var/lib/docker/volumes/adclaw-secret/_data - Nginx config:
/etc/nginx/sites-available/adclaw.conf - ไฟล์ Auth:
/etc/nginx/auth/.htpasswd-adclaw - SSL certificates:
/etc/nginx/ssl/ - ข้อมูลประจำตัว:
/root/.adclaw-credentials
คำสั่งการจัดการ
เริ่มต้น:
docker compose -f /opt/adclaw/docker-compose.yml up -d
หยุด:
docker compose -f /opt/adclaw/docker-compose.yml down
เริ่มต้นใหม่:
docker compose -f /opt/adclaw/docker-compose.yml restart
ดู logs:
docker logs -f adclaw
การตั้งค่า
Web UI สามารถใช้ควบคุมและอัปเดตการตั้งค่าได้
หรือแก้ไข environment variables ด้วยตนเองภายใน /opt/adclaw/.env และปรับใช้การเปลี่ยนแปลง:
docker compose -f /opt/adclaw/docker-compose.yml up -d
เปิดใช้งาน SSL กับโดเมน
1. ชี้โดเมนของคุณไปยัง IP ของ server
2. แก้ไข config ของ Nginx และเปลี่ยนทั้งคู่ server_name <IP>; กับโดเมนของคุณ (<your-domain>) สำหรับทั้ง HTTP (port 80) และ HTTPS (port 443) blocks:
vim /etc/nginx/sites-available/adclaw.conf
3. ติดตั้ง Certbot:
apt install -y certbot python3-certbot-nginx
4. รันคำสั่งต่อไปนี้เพื่อสร้างใบรับรอง Let's Encrypt ที่ถูกต้อง:
certbot certonly --nginx --non-interactive --agree-tos --email [email protected] -d yourdomain.com
5. แทนที่ SSL paths ใน Nginx config:
vim /etc/nginx/sites-available/adclaw.conf
# Before:
# ssl_certificate /etc/nginx/ssl/fullchain.pem;
# ssl_certificate_key /etc/nginx/ssl/privkey.pem;
# After:
# ssl_certificate /etc/letsencrypt/live/yourdomain.com/fullchain.pem;
# ssl_certificate_key /etc/letsencrypt/live/yourdomain.com/privkey.pem;
6. รีสตาร์ท Nginx เพื่อใช้การเปลี่ยนแปลง:
systemctl restart nginx
7. เปิด browser และไปที่: https://yourdomain.com