Web Access
URL: https://<IP>/
HTTP port 80 redirects to HTTPS 443.
Default account:
- Username:
owner - Password:
owner123
สำคัญ: เปลี่ยนรหัสผ่านเริ่มต้นทันทีในหน้า web interface
Environment Configuration
File: /opt/zy/.env
หากต้องการอัปเดต environment variable ให้แก้ไขไฟล์ .env แล้ว restart service:
systemctl restart zy.service
ไฟล์และไดเรกทอรีสำคัญ
- Zy binary:
/opt/zy/zy - Environment variable (API token, public URL):
/opt/zy/.env - Systemd unit:
/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 ของเซิร์ฟเวอร์
2. แก้ไขไฟล์คอนฟิก Nginx และแทนที่ทั้งสองส่วน server_name <IP>; ด้วยโดเมนของคุณ (<your-domain>) สำหรับทั้งบล็อก HTTP (port 80) และ HTTPS (port 443):
vim /etc/nginx/sites-available/zy
3. Install 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 ในไฟล์คอนฟิก Nginx:
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. Update PUBLIC_BASE_URL in /opt/zy/env:
PUBLIC_BASE_URL=https://yourdomain.com
8. Restart Zy เพื่อนำการเปลี่ยนแปลงไปใช้งาน:
systemctl restart zy
9. เปิดเบราว์เซอร์และเข้าไปที่: https://yourdomain.com