เข้าถึงอินสแตนซ์ของคุณ
- เยี่ยม:
https://<SERVER-IP>/ - ยอมรับคำเตือน SSL (self-signed certificate)
- ปฏิบัติตามการตั้งค่าเริ่มต้น
Path ที่สำคัญ
- ติดตั้งไดเรกทอรี:
/root/actual - ข้อมูลถาวร:
/root/actual/actual-data - ไฟล์Dockerเขียน:
/root/actual/docker-compose.yml - การกำหนดค่า Nginx:
/etc/nginx/sites-available/actual - ใบรับรอง SSL:
/etc/nginx/ssl/
การจัดการบริการ
Docker:
cd /root/actual
docker compose ps
docker compose logs -f
docker compose restart
docker compose down
งิงซ์:
systemctl restart nginx
systemctl status 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/stirling-pdf
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/stirling-pdf
# 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