Truy cập
- Mở URL:
https://<SERVER_IP> - Chấp nhận cảnh báo chứng chỉ của trình duyệt (chứng chỉ tự ký)
- Làm theo trình hướng dẫn cài đặt ban đầu để tạo người dùng root
File và thư mục quan trọng
- Config File:
/etc/default/audiobookshelf - Service File:
/lib/systemd/system/audiobookshelf.service - Cấu hình Nginx:
/etc/nginx/sites-available/audiobookshelf - Chứng chỉ SSL:
/etc/nginx/ssl/fullchain.pem - Khóa riêng SSL:
/etc/nginx/ssl/privkey.pem - Access Log:
/var/log/nginx/audiobookshelf.access.log - Error Log:
/var/log/nginx/audiobookshelf.error.log
Quản lý dịch vụ
Kiểm tra trạng thái dịch vụ:
systemctl status audiobookshelf
Khởi động lại dịch vụ:
systemctl restart audiobookshelf
Dừng dịch vụ:
systemctl stop audiobookshelf
Bắt đầu dịch vụ:
systemctl start audiobookshelf
Xem log:
journalctl -u audiobookshelf -f
Quản lý Nginx
Cấu hình kiểm thử:
nginx -t
Khởi động lại Nginx:
systemctl restart nginx
Tải lại Nginx:
systemctl reload nginx
Kiểm tra trạng thái Nginx:
systemctl status 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. Install Certbot:
apt install -y certbot python3-certbot-nginx
3. Generate a Let's Encrypt certificate:
certbot certonly --nginx --non-interactive --agree-tos --email [email protected] -d yourdomain.com
4. Replace SSL paths in Nginx config:
vim /etc/nginx/sites-available/audiobookshelf
# 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;
5. Replace server_name _; with your domain in both HTTP and HTTPS blocks:
vim /etc/nginx/sites-available/audiobookshelf
# Before:
server_name: _;
# After:
server_name: yourdomain.com;
6. Reload Nginx:
systemctl reload nginx
Ghi chú
- Audiobookshelf chạy như một dịch vụ systemd gốc
- Nginx acts as a reverse proxy and TLS terminator
- HTTPS được bật bằng chứng chỉ tự ký theo mặc định
- Large uploads are supported (
client_max_body_size 10240M) - Audiobookshelf listens on
127.0.0.1:13378and is only accessible through Nginx