0
2

More than 5 years have passed since last update.

CentOS7で無料SSL証明書 Let's Encrypt

Posted at

無料のSSL証明書Lets Encryptを入れてみました。

基本的には公式?の
https://letsencrypt.jp/
の説明が良く出来ているのでスムーズに設定することができました。

ただ
https://letsencrypt.jp/usage/install-certbot.html#CentOS7
で出てくる

yum install certbot python-certbot-apache
を実行すると
パッケージ python-pkg-resources-19.6.2-1.el7.noarch.rpm は署名されていません
と出てインストールできなかったので、とりあえず
yum install --nogpgcheck certbot python-certbot-apache
を実行。

インストールが完了したら
certbotコマンドを実行して鍵を取得
/etc/letsencrypt/live/ドメイン名
のディレクトリに鍵ができるので

apacheの設定ファイルに
SSLCertificateFile /etc/letsencrypt/live/www.hoge.com/cert.pem
SSLCertificateKeyFile /etc/letsencrypt/live/www.hoge.com/privkey.pem
SSLCertificateChainFile /etc/letsencrypt/live/www.hoge.com/chain.pem

な感じで追加してやる。

あとは鍵の寿命が90日とやや短いので自動更新用に
/bin/certbot renew --pre-hook "systemctl stop httpd" --post-hook "systemctl start httpd"
をcronに突っ込んでおく

今まではchromeでアクセスすると
無題1.png
だったのが
無題2.png
と安全な感じになりました

0
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
0
2