การเข้าถึงเว็บ
URL: https://<IP>/
พอร์ต HTTP 80 เปลี่ยนเส้นทางไปยัง HTTPS 443.
บัญชีเริ่มต้น:
- ชื่อผู้ใช้:
owner - รหัสผ่าน:
owner123
สำคัญ: โปรดเปลี่ยนรหัสผ่านเริ่มต้นในเว็บอินเตอร์เฟสทันที
การกำหนดค่าสภาพแวดล้อม
ไฟล์: /opt/zy/.env
หากต้องการอัปเดตตัวแปรสภาพแวดล้อม ให้แก้ไข .env และรีสตาร์ทบริการ:
systemctl restart zy.service
ไฟล์และไดเร็กทอรีที่สำคัญ
- ไซ ไบนารี:
/opt/zy/zy - ตัวแปรสภาพแวดล้อม (โทเค็น API, URL สาธารณะ):
/opt/zy/.env - หน่วย Systemd:
/etc/systemd/system/zy.service - การตั้งค่าเว็บไซต์ Nginx:
/etc/nginx/sites-available/zy - เปิดใช้งานเว็บไซต์ Nginx แล้ว:
/etc/nginx/sites-enabled/zy - ใบรับรอง SSL ที่ลงนามด้วยตนเอง:
/etc/nginx/ssl/
การจัดการบริการ Systemd
# 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 (พอร์ต 80) และ HTTPS (พอร์ต 443):
vim /etc/nginx/sites-available/zy
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 ในไฟล์การตั้งค่า 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. อัปเดต PUBLIC_BASE_URL ใน /opt/zy/env:
PUBLIC_BASE_URL=https://yourdomain.com
8. รีสตาร์ท Zy เพื่อให้การเปลี่ยนแปลงมีผล:
systemctl restart zy
9. เปิดเบราว์เซอร์ของคุณและไปที่: https://yourdomain.com