# yum install -y git openssl mod_ssl # cd /opt # git clone https://github.com/certbot/certbot # cd certbot # ls # ./certbot-auto --help
最後の help 表示(certbotの初回起動)で、certbot が依存ライブラリをワシワシ取ってくる
plugin | note | Apache一時停止 |
apache | Debian ベースの Linux OS 上の Apache2.4 に対して証明書を自動設定 | 必要 |
webroot | 現在稼働中の Apache サーバを利用して、Let's Encrypt サーバが存在確認 | 不必要 |
standalone | 簡易Webサーバを起動して、Let's Encrypt サーバが存在確認 | 必要 |
manual | 手動で証明書を発行 | 不必要 |
nginx | 開発中 | 必要 |
# /opt/certbot/certbot-auto certonly --webroot -w /var/www/html/ -d hondou.homedns.org --test-cert/etc/letsencrypt/live/hondou.homedns.org/ 以下に鍵ができていたら成功
# /opt/certbot/certbot-auto certonly --webroot -w /var/www/html/ -d hondou.homedns.org ... IMPORTANT NOTES: - Congratulations! Your certificate and chain have been saved at /etc/letsencrypt/live/hondou.homedns.org/fullchain.pem. Your cert will expire on 2016-08-15. To obtain a new version of the certificate in the future, simply run Certbot again. - If you like Certbot, please consider supporting our work by:acme-challenge (Let's Encrypt からの存在確認)
# cat /var/log/httpd/access_log | grep acme-challenge 66.133.109.36 - - [17/May/2016:23:23:51 +0900] "GET /.well-known/acme-challenge/***** HTTP/1.1" 200 107 "-" "Mozilla/5.0 (compatible; Let's Encrypt validation server; +https://www.letsencrypt.org)"
SSLCertificateFile /etc/letsencrypt/live/hondou.homedns.org/cert.pem SSLCertificateKeyFile /etc/letsencrypt/live/hondou.homedns.org/privkey.pem SSLCertificateChainFile /etc/letsencrypt/live/hondou.homedns.org/chain.pem
# service httpd restart
#!/bin/bash
/bin/date >> /var/log/certbot.log
/opt/certbot/certbot-auto renew >> /var/log/certbot.log 2>&1
/var/log/certbot.log
{
monthly # 月初に100kを超えていたらローテート
minsize 100k
rotate 5 # 5 世代
missingok # ログファイルがなくてもエラーにしない
notifempty # 空ファイルの場合はローテートしない
compress # 古いログは圧縮
}
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
Had a problem while installing Python packages: DEPRECATION: Python 2.6 is no longer supported by the Python core team, please upgrade your Python. A future version of pip will drop support for Python 2.6
/root/.local/share/letsencrypt以下にある python で動く
# mv /root/.local/share/letsencrypt /root/.local/share/~letsencrypt
# scl enable python27 bash # python -V Python 2.7.8
# /opt/certbot/certbot-auto renewPython2.7 が /root/.local/share/letsencrypt にコピーされる
# ls /root/.local/share/letsencrypt/bin/ activate activate_this.py easy_install-2.7 ndg_httpclient pip2 python-config unit2 activate.csh certbot jws pbr pip2.7 python2 wheel activate.fish easy_install letsencrypt pip python python2.7
# exit # python -V Python 2.6.6 # /opt/certbot/certbot-auto renew ------------------------------------------------------------------------------- Processing /etc/letsencrypt/renewal/hondou.homedns.org.conf ------------------------------------------------------------------------------- The following certs are not due for renewal yet: /etc/letsencrypt/live/hondou.homedns.org/fullchain.pem (skipped) No renewals were attempted.
# rm -rf /root/.local/share/~letsencrypt