1
2

More than 1 year has passed since last update.

【Rocky Linux 9】12.SSL取得(Let's Encrypt)

Posted at

SSL証明書取得

ApacheのSSL化、メールサーバーのSSL化のためにSSLを取得する
Let's Encryptでは無料でサーバー証明書を発行してくれるため、これを利用する

Certbotインストール

CertbotはEPELパッケージに含まれるため、EPELを使用することを明示し、インストールする

dnf --enablerepo=epel install certbot

サーバー証明書取得

パラメーター 内容
-w ドキュメントルート
-m メールアドレス
-d ドメイン名
-n ユーザー入力を求めない
--agree-tos ACME利用規約に同意する
certbot certonly --webroot -w /var/www/example.com -m server@example.com -d example.com -n --agree-tos

取得した証明書の確認

4ファイルが作成されていることを確認する

ls /etc/letsencrypt/live/example.com/
cert.pem
chain.pem
fullchain.pem
privkey.pem

証明書更新自動化サービスの設定

証明書が自動的に更新された際にApacheを再起動するようにする

/etc/sysconfig/certbot
POST_HOOK="--post-hook 'systemctl restart httpd'"

証明書更新の自動化

systemctl enable --now certbot-renew.timer
1
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
2