การเข้าถึงเว็บ
URL: https://<IP>/
พอร์ต HTTP 80 เปลี่ยนเส้นทางไปยัง HTTPS 443.
บัญชีเริ่มต้น:
- ชื่อผู้ใช้:
owner - รหัสผ่าน:
owner123
สำคัญ: เปลี่ยนรหัสผ่านเริ่มต้นทันทีในหน้า web interface
การตั้งค่าสภาพแวดล้อม
ไฟล์: /opt/zy/.env
หากต้องการอัปเดต environment variable ให้แก้ไขไฟล์ .env แล้ว restart service:
systemctl restart zy.service
ไฟล์และไดเรกทอรีที่สำคัญ
- Zy ไบนารี:
/opt/zy/zy - Environment variable (API token, public URL):
/opt/zy/.env - Systemd unit:
หน่วย Systemd
/etc/systemd/system/zy.service - การตั้งค่าไซต์ Nginx:
/etc/nginx/sites-available/zy - เปิดใช้งาน Nginx site แล้ว:
/etc/nginx/sites-enabled/zy - ใบรับรอง SSL แบบ self-signed:
/etc/nginx/ssl/
การจัดการ Systemd Service
# Restart the Zy service
systemctl restart zy.service
# Check Zy status
systemctl status zy.service
# Restart the Nginx service
systemctl restart nginx.service
# Check Nginx status
systemctl status nginx.service
เปิดใช้งาน SSL กับโดเมน
1. ชี้โดเมนของคุณไปยัง IP ของ server
2. แก้ไข config ของ Nginx และเปลี่ยนทั้งคู่ server_name <IP>; กับโดเมนของคุณ (<your-domain>) สำหรับทั้ง HTTP (port 80) และ HTTPS (port 443) blocks:
vim /etc/nginx/sites-available/zy
3. ติดตั้ง Certbot:
apt install -y certbot python3-certbot-nginx
4. รันคำสั่งต่อไปนี้เพื่อสร้างใบรับรอง Lets Encrypt ที่ใช้งานได้:
certbot certonly --nginx --non-interactive --agree-tos --email [email protected] -d yourdomain.com
5. แทนที่ SSL paths ใน Nginx config:
vim /etc/apache2/sites-available/zy
# 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. อัปเดต PUBLIC_BASE_URL in /opt/zy/env:
PUBLIC_BASE_URL=https://yourdomain.com
8. Restart Zy เพื่อนำการเปลี่ยนแปลงไปใช้งาน:
systemctl restart zy
9. เปิด browser และไปที่: https://yourdomain.com