無料SSL証明書の Let's Encrypt の設定

証明書取得更新ツール certbot のインストール

公式サイトの手順に従いインストール

# yum -y install certbot python2-certbot-nginx

証明書の発行

certbot certonly --agree-tos --nginx -m メールアドレス -d ドメイン名

# Nginx の設定ファイルに非推奨ディレクティブが ssl on; があるとエラー 
nginx: [warn] the "ssl" directive is deprecated, use the "listen ... ssl" directive instead in /etc/nginx/xxxx

# Nginx の設定ファイルに日本語とかが入っているとエラー
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe3 in position 4: ordinal not in range(128)

Nginx のリロード

systemctl reload nginx

証明書の自動更新設定

echo "0 0,12 * * * root python -c 'import random; import time; time.sleep(random.random() * 3600)' && certbot renew -q" | sudo tee -a /etc/crontab > /dev/null

centos/v7/無料ssl証明書の_let_s_encrypt_の設定.txt · 最終更新: 2020/04/11 05:15 by admin
 
特に明示されていない限り、本Wikiの内容は次のライセンスに従います: CC Attribution-Share Alike 4.0 International
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki