เข้าถึง Huginn
เปิด browser และไปที่: https://<SERVER_IP>
ยอมรับคำเตือนใบรับรอง SSL ที่ลงนามด้วยตนเอง
ข้อมูลรับรองผู้ดูแลระบบเริ่มต้น:
- ชื่อผู้ใช้:
admin - รหัสผ่าน:
password(เปลี่ยนทันที)
ไฟล์และตำแหน่งที่สำคัญ
- ติดตั้ง Huginn:
/root/huginn - Dockerเขียน:
/root/huginn/docker-compose.yml - ตัวแปร Env:
/root/huginn/.env - SSL certificates:
/etc/nginx/ssl - Nginx config:
/etc/nginx/sites-available/huginn
คำสั่งทั่วไป
ตรวจสอบบันทึก:
docker logs huginn -f
docker logs huginn_mysql -f
รีสตาร์ทคอนเทนเนอร์:
cd /root/huginn
docker compose restart huginn
docker compose restart huginn_mysql
docker compose restart # restart all
ดูคอนเทนเนอร์ที่ทำงานอยู่:
docker ps
การจัดการ Nginx:
systemctl restart nginx
systemctl status nginx
เปิดใช้งาน SSL กับโดเมน
1. ชี้โดเมนของคุณไปยัง IP ของ server
2. แก้ไข config ของ Nginx และเปลี่ยนทั้งคู่ server_name <IP>; กับโดเมนของคุณ (<your-domain>) สำหรับทั้ง HTTP (port 80) และ HTTPS (port 443) blocks:
vim /etc/nginx/sites-available/huginn
3. ติดตั้ง Certbot:
apt install -y certbot python3-certbot-nginx
4. รันคำสั่งต่อไปนี้เพื่อสร้าง 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/huginn
# 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