访问
- 打开 URL:
https://<SERVER_IP> - 接受浏览器证书警告(证书为自签名)
- 按照初始设置向导创建 root 用户
重要文件与目录
- Config File:
/etc/default/audiobookshelf - Service File:
/lib/systemd/system/audiobookshelf.service - Nginx 配置:
/etc/nginx/sites-available/audiobookshelf - SSL证书:
/etc/nginx/ssl/fullchain.pem - SSL 私钥:
/etc/nginx/ssl/privkey.pem - Access Log:
/var/log/nginx/audiobookshelf.access.log - Error Log:
/var/log/nginx/audiobookshelf.error.log
服务管理
检查服务状态:
systemctl status audiobookshelf
重启服务:
systemctl restart audiobookshelf
停止服务
systemctl stop audiobookshelf
启动服务:
systemctl start audiobookshelf
查看日志:
journalctl -u audiobookshelf -f
Nginx 管理
测试配置:
nginx -t
重启 Nginx:
systemctl restart nginx
重新加载 Nginx:
systemctl reload nginx
查看 Nginx 状态:
systemctl status nginx
为域名启用 SSL
1. 将域名解析到服务器 IP。
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
注意事项
- Audiobookshelf 作为原生 systemd 服务运行
- Nginx acts as a reverse proxy and TLS terminator
- 默认情况下 HTTPS 使用自签名证书启用
- Large uploads are supported (
client_max_body_size 10240M) - Audiobookshelf listens on
127.0.0.1:13378and is only accessible through Nginx