การเข้าถึง
- เปิด browser ของคุณ:
https://<SERVER-IP> - ใบรับรอง TLS แบบ self-signed จะทำให้เบราว์เซอร์เตือน ให้ยอมรับเพื่อดำเนินการต่อ
- ข้อมูลรับรองการเข้าสู่ระบบถูกเก็บอย่างปลอดภัยที่:
/root/ocular/.env
ไฟล์และไดเรกทอรีที่สำคัญ
- เส้นทางการติดตั้ง:
/root/ocular - ไฟล์ Compose:
/root/ocular/compose.yml - ไฟล์สภาพแวดล้อม:
/root/ocular/.env - Volume ข้อมูล:
/var/lib/docker/volumes/ocular_ocular-data - การตั้งค่า Nginx:
/etc/nginx/sites-available/ocular - ใบรับรอง TLS:
/etc/nginx/ssl/ocular.crt - คีย์ส่วนตัว TLS:
/etc/nginx/ssl/ocular.key - ข้อมูลรับรองการเข้าสู่ระบบ:
/root/.cloudzy-creds
การจัดการบริการ
ดูคอนเทนเนอร์ที่กำลังทำงาน:
docker compose -f /root/ocular/compose.yml ps
รีสตาร์ท Ocular:
docker compose -f /root/ocular/compose.yml restart
ดูบันทึกของ Ocular:
cd /root/ocular && docker compose logs -f
หยุด Ocular:
docker compose -f /root/ocular/compose.yml stop
เริ่ม Ocular:
docker compose -f /root/ocular/compose.yml start
สร้าง Ocular ใหม่:
docker compose -f /root/ocular/compose.yml up -d
ตรวจสอบสถานะ Nginx:
systemctl status nginx
รีสตาร์ต Nginx:
systemctl restart nginx
รีโหลด Nginx:
systemctl reload nginx
ตรวจสอบความถูกต้องของการกำหนดค่า Nginx:
nginx -t
การเปิดใช้งาน HTTPS ด้วยโดเมน
1. ชี้โดเมนของคุณไปยัง IP ของ server
๒. แก้ไข /etc/nginx/sites-available/ocular และแทนที่ทั้งสอง server_name _; directive ด้วยโดเมนของคุณ (เช่น server_name yourdomain.com;).
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. แก้ไข /etc/nginx/sites-available/ocular และอัปเดต ssl_certificate และ ssl_certificate_key directive เพื่อใช้ใบรับรอง Let's Encrypt ของคุณ
Before:
ssl_certificate /etc/nginx/ssl/ocular.crt;
ssl_certificate_key /etc/nginx/ssl/ocualr.key;
After:
ssl_certificate /etc/letsencrypt/live/yourdomain.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/yourdomain.com/privkey.pem;
6. โหลด Nginx ใหม่เพื่อใช้การเปลี่ยนแปลง:
systemctl reload nginx
7. เข้าใช้ Ocular ที่ https://yourdomain.com.