การเข้าถึง
- เปิด URL ของ Zipline:
https://<SERVER-IP> - คุณจะถูกนำไปยังหน้าตั้งค่าซึ่งสามารถกำหนดชื่อผู้ใช้และรหัสผ่านของผู้ดูแลระบบสูงสุดเริ่มต้นได้
ไฟล์และไดเรกทอรีที่สำคัญ
- เส้นทางการติดตั้ง:
/root/zipline - ไฟล์ Compose:
/root/zipline/docker-compose.yml - ไฟล์สภาพแวดล้อม:
/root/zipline/.env - ไดเรกทอรีอัปโหลด:
/root/zipline/uploads - ไฟล์สาธารณะ:
/root/zipline/public - ไดเรกทอรีธีม:
/root/zipline/themes - วอลุ่ม PostgreSQL:
/var/lib/docker/volumes/zipline_pgdata/_data - การตั้งค่า Nginx:
/etc/nginx/sites-available/zipline.conf - ใบรับรอง SSL:
/etc/nginx/ssl/zipline.crt - คีย์ส่วนตัว SSL:
/etc/nginx/ssl/zipline.key
การจัดการ Docker
ดูสถานะ:
cd /root/zipline
docker compose ps
ดู logs:
cd /root/zipline
docker compose logs -f
รีสตาร์ทบริการ:
cd /root/zipline
docker compose restart
หยุดบริการ:
cd /root/zipline
docker compose down
เริ่มบริการ:
cd /root/zipline
docker compose up -d
การจัดการ NGINX
การตั้งค่าการทดสอบ:
nginx -t
รีสตาร์ท NGINX:
systemctl restart nginx
โหลด NGINX ใหม่:
systemctl reload nginx
ตรวจสอบสถานะ NGINX:
systemctl status nginx
เปิดใช้งาน SSL กับโดเมน
1. ชี้โดเมนของคุณไปยัง IP ของ server
2. ติดตั้ง Certbot:
apt install -y certbot python3-certbot-nginx
3. รันคำสั่งต่อไปนี้เพื่อสร้างใบรับรอง Let's Encrypt ที่ถูกต้อง:
certbot certonly --nginx --non-interactive --agree-tos --email [email protected] -d yourdomain.com
4. แทนที่พาธ SSL ในการตั้งค่า Nginx:
vim /etc/nginx/sites-available/zipline.conf
# Before:
# ssl_certificate /etc/nginx/ssl/zipline.crt;
# ssl_certificate_key /etc/nginx/ssl/zipline.key;
# After:
# ssl_certificate /etc/letsencrypt/live/yourdomain.com/fullchain.pem;
# ssl_certificate_key /etc/letsencrypt/live/yourdomain.com/privkey.pem;
5. แก้ไขการตั้งค่า Nginx และแทนที่ทั้งสองจุดของ server_name _; กับโดเมนของคุณ (server_name <yourdomain.com>) สำหรับทั้ง HTTP (port 80) และ HTTPS (port 443) blocks:
vim /etc/nginx/sites-available/zipline.conf
# Before:
server_name: _;
# After:
server_name: yourdomain.com;
6. โหลด Nginx ใหม่เพื่อใช้การเปลี่ยนแปลง:
systemctl reload nginx
7. เปิด browser และไปที่: https://yourdomain.com
การอัปเดต Zipline
หากต้องการอัปเดต Zipline เพียงรันคำสั่งต่อไปนี้:
docker compose pull
docker compose up -d
การทำเช่นนี้จะดึงอิมเมจ Zipline ล่าสุดและรีสตาร์ทเซิร์ฟเวอร์
หมายเหตุ
- Zipline ทำงานอยู่หลัง Nginx โดยเปิดใช้งาน HTTPS
- ไฟล์ที่อัปโหลดถูกเก็บไว้ใน
/root/zipline/uploads. - ทรัพยากรสาธารณะถูกเก็บไว้ใน
/root/zipline/public. - ธีมที่กำหนดเองถูกเก็บไว้ใน
/root/zipline/themes. - ข้อมูลรับรองฐานข้อมูลและซีเคร็ตของแอปพลิเคชันถูกเก็บไว้ใน
/root/zipline/.env.