Let’s Encryptで証明書取得
①mod_sslを有効にする
# a2enmod ssl |
②Gitをインストール
# apt-get install -y git |
③証明書取得ツールのインストール
# cd /usr/local/ # git clone https://github.com/certbot/certbot |
/usr/local/certbot以下に「Certbot」がインストールされました
④証明書のインストール
# certbot certonly –webroot -w /var/www/html/<ドキュメントルート> -d <ドメイン名> # 初回のみメールアドレスの登録と利用条件への同意が必要 # 受信可能なメールアドレスを指定 Enter email address (used for urgent notices and lost key recovery) <メールアドレス> < OK > <Cancel> # 利用条件に同意する Please read the Terms of Service at https://letsencrypt.org/documents/LE-SA-v1.2-November-15-2017.pdf. You must agree in order to register with the ACME server at https://acme-v01.api.letsencrypt.org/directory <Agree > <Cancel> IMPORTANT NOTES: – Congratulations! Your certificate and chain have been saved at /etc/letsencrypt/live/<ドメイン名>/fullchain.pem. Your cert will expire on 2018-07-27. To obtain a new version of the certificate in the future, simply run Let’s Encrypt again. – If you like Let’s Encrypt, please consider supporting our work by:
Donating to ISRG / Let’s Encrypt: https://letsencrypt.org/donate Donating to EFF: https://eff.org/don |
# [Congratulations] と表示さえれば成功
# メッセージ中に記載の通り [/etc/letsencrypt/live/ <ドメイン名>/] 配下に証明書が取得されている
# cert.pem ⇒ SSLサーバー証明書(公開鍵含む)
# chain.pem ⇒ 中間証明書
# fullchain.pem ⇒ cert.pem と chain.pem が結合されたファイル
# privkey.pem ⇒ 公開鍵に対する秘密鍵