インスタンスにアクセスする
- 訪問:
https://<SERVER-IP>/ - SSL の警告を承認する(自己署名証明書)。
- 初期セットアップを完了する。
重要なパス
- インストールディレクトリ:
/root/actual - 永続データ
/root/actual/actual-data - docker-compose ファイル:
/root/actual/docker-compose.yml - Nginxコンフィグ:
/etc/nginx/sites-available/actual - SSL証明書:
/etc/nginx/ssl/
サービスの管理
Docker:
cd /root/actual
docker compose ps
docker compose logs -f
docker compose restart
docker compose down
Nginx:
systemctl restart nginx
systemctl status nginx
ドメインを使った SSL の有効化
1. ドメインをサーバーのIPアドレスに向けてください。
2. Nginx の設定ファイルを開き、以下の両方を置き換えてください server_name <IP>; ドメイン(<your-domain>) は HTTP (ポート 80) と HTTPS (ポート 443) の両ブロックに適用されます:
vim /etc/nginx/sites-available/stirling-pdf
3. Certbotをインストールします:
apt install -y certbot python3-certbot-nginx
4. 次のコマンドを実行して、有効な Let's Encrypt 証明書を生成します:
certbot certonly --nginx --non-interactive --agree-tos --email [email protected] -d yourdomain.com
5. Nginx の設定ファイルで SSL のパスを置き換える:
vim /etc/apache2/sites-available/stirling-pdf
# 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. 変更を反映するために、Nginxを再起動します。
systemctl restart nginx
7. ブラウザを開いて、次のURLにアクセスしてください: https://yourdomain.com