アクセス
- 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