Let's EncryptでSSL

| | コメント(0)

CentOS7.3

# yum install epel-release
はいってる

# cd /home/うさこの
# git clone https://github.com/certbot/certbot
# cd certbot/
# ./certbot-auto

ずらずらーと。途中でyおしつつ。

■複数ドメインで設定
# ./certbot-auto certonly --webroot -w /ディレクトリ -d ドメイン -w /ディレクトリ -d ドメイン -w /ディレクトリ -d ドメイン -w /ディレクトリ -d ドメイン -w /ディレクトリ -d ドメイン -w /ディレクトリ -d ドメイン -w /ディレクトリ -d ドメイン
Apacheにいれるかnginxに入れるか聞かれるのでApache
連絡先メール
Agreeする


ssl.confでそれぞれの設定に以下を追加
SSLCertificateFile /はいったとこ/ドメイン/cert.pem
SSLCertificateKeyFile /はいったとこ/ドメイン/privkey.pem
Include /はいったとこ/options-ssl-apache.conf
SSLCertificateChainFile/はいったとこ/ドメイン/chain.pem


Apacheを再起動して完了。


■自動更新のテスト
# /home/うさこの/certbot/certbot-auto renew --post-hook "sudo service httpd restart"

# emacs /etc/cron.d/letsencrypt
毎日午前2時にrenewしたいので以下を入力

******
SHELL=/bin/sh

# m h dom mon dow user command
00 2 * * * root /home/lulu/certbot/certbot-auto renew --post-hook "sudo service httpd restart"
******
# crontab /etc/cron.d/letsencrypt

コメントする