Truy cập Web
- Truy cập Poznote trong trình duyệt web của bạn:
https://<SERVER-IP> - Chấp nhận cảnh báo SSL (chứng chỉ tự ký).
- Thông tin đăng nhập Poznote được lưu trữ an toàn tại:
/root/poznote/.env
Các đường dẫn quan trọng
- Thư mục cài đặt:
/root/poznote - Dữ liệu Bền vững:
/root/poznote/data - Tệp Environment:
/root/poznote/.env - File docker-compose:
/root/poznote/docker-compose.yml - Cấu hình Nginx:
/etc/nginx/sites-available/poznote - Chứng chỉ SSL:
/etc/nginx/ssl/
Quản lý dịch vụ
Docker:
cd /root/poznote
docker compose ps
docker compose logs -f
docker compose restart
Nginx:
systemctl status nginx
systemctl restart nginx
Kích hoạt SSL với một tên miền
1. Trỏ tên miền của bạn về IP máy chủ.
2. Sửa cấu hình Nginx và thay thế cả server_name <IP>; với tên miền của bạn (<your-domain>) cho cả block HTTP (cổng 80) và HTTPS (cổng 443):
vim /etc/nginx/sites-available/poznote
3. Cài đặt Certbot:
apt install -y certbot python3-certbot-nginx
4. Chạy lệnh sau để tạo chứng chỉ Let’s Encrypt hợp lệ:
certbot certonly --nginx --non-interactive --agree-tos --email [email protected] -d yourdomain.com
5. Thay thế các đường dẫn SSL trong cấu hình Nginx:
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. Khởi động lại Nginx để áp dụng thay đổi:
systemctl restart nginx
7. Mở trình duyệt và truy cập: https://yourdomain.com