Truy cập giao diện Web UI
- Mở trình duyệt:
https://SERVER_IP - Chấp nhận cảnh báo SSL (chứng chỉ tự ký).
- Thông tin đăng nhập được lưu tại:
/root/peanut/.env
Quản lý Dịch vụ
Docker:
cd /root/peanut
docker compose ps
docker compose restart
docker compose logs -f
Nginx:
systemctl status nginx
systemctl restart nginx
Các tệp và thư mục quan trọng
- Thư mục gốc ứng dụng:
/root/peanut/ - Tệp Docker Compose:
/root/peanut/docker-compose.yml - Biến môi trường (thông tin xác thực):
/root/peanut/.env - Dữ liệu cấu hình ứng dụng:
/root/peanut/config/ - Cấu hình site Nginx:
/etc/nginx/sites-available/peanut - Đã bật site Nginx:
/etc/nginx/sites-enabled/peanut - Chứng chỉ TLS:
/etc/nginx/ssl/fullchain.pem - Khóa riêng tư TLS:
/etc/nginx/ssl/privkey.pem - Nhật ký Nginx:
/var/log/nginx/
Kích hoạt SSL với tên miền
1. Trỏ tên miền của bạn về địa chỉ IP của máy chủ.
2. Chỉnh sửa cấu hình Nginx và thay thế cả hai server_name <IP>; với tên miền của bạn (<your-domain>) cho cả HTTP (cổng 80) và HTTPS (cổng 443) như sau:
vim /etc/nginx/sites-available/trilium
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ế đường dẫn SSL trong cấu hình Nginx:
vim /etc/apache2/sites-available/trilium
# 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 các thay đổi:
systemctl restart nginx
7. Trình duyệt của bạn và truy cập: https://yourdomain.com