การเข้าถึงเว็บ
- เข้าถึง Poznote ในเบราว์เซอร์ของคุณ:
https://<SERVER-IP> - ยอมรับคำเตือน SSL (self-signed certificate)
- ข้อมูล credential ของ Poznote ถูกจัดเก็บอย่างปลอดภัยใน:
/root/poznote/.env
Path ที่สำคัญ
- ไดเรกทอรี่การติดตั้ง:
/root/poznote - ข้อมูลถาวร
/root/poznote/data - ไฟล์ Environment:
/root/poznote/.env - ไฟล์ docker-compose:
/root/poznote/docker-compose.yml - การตั้งค่า Nginx:
/etc/nginx/sites-available/poznote - ใบรับรอง SSL:
/etc/nginx/ssl/
การจัดการ Service
Docker:
cd /root/poznote
docker compose ps
docker compose logs -f
docker compose restart
Nginx :
systemctl status nginx
systemctl restart nginx
เปิดใช้งาน SSL กับโดเมน
1. ชี้โดเมนของคุณไปยัง IP ของ server
2. แก้ไข config ของ Nginx และเปลี่ยนทั้งคู่ server_name <IP>; กับโดเมนของคุณ (<your-domain>) สำหรับทั้ง HTTP (port 80) และ HTTPS (port 443) blocks:
vim /etc/nginx/sites-available/poznote
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/nginx/sites-available/poznote
# 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. เปิด browser และไปที่: https://yourdomain.com