&tag(Let's Encrypt);
# yum install centos-release-SCL # yum install python27 python27-python-tools
# curl https://dl.eff.org/certbot-auto -o /usr/local/bin/certbot-auto # chmod a+x /usr/local/bin/certbot-auto # scl enable python27 bash #CentOS 6の場合 # /usr/local/bin/certbot-auto
# certbot-auto certonly --webroot --webroot-path=/home/tanaka/www -d www.softantenna.com
NameVirtualHost *:80 NameVirtualHost *:443
<VirtualHost *:443>
ServerName www.softantenna.com
DocumentRoot /home/tanaka/www
SSLEngine on
# 追加
SSLCertificateFile /etc/letsencrypt/live/www.softantenna.com/cert.pem
SSLCertificateKeyFile /etc/letsencrypt/live/www.softantenna.com/privkey.pem
SSLCertificateChainFile /etc/letsencrypt/live/www.softantenna.com/chain.pem
<Directory /home/tanaka/www>
# This relaxes Apache security settings.
AllowOverride all
# MultiViews must be turned off.
Options -MultiViews
</Directory>
</VirtualHost>
CERTBOT=/usr/local/bin/certbot-auto WEBROOT_PATH=/home/tanaka/www DOMAIN=www.softantenna.com EMAIL=admin@softantenna.com LOGFILE=/home/tanaka/bin/update_cert_log.txt today=`date +%F-%a-%T` echo "Let's Encrypt update start $today" >$LOGFILE scl enable python27 "$CERTBOT renew --force-renewal" >>$LOGFILE /etc/init.d/httpd restart today=`date +%F-%a-%T` echo "Let's Encrypt update end $today" >>$LOGFILE cat -v $LOGFILE | mail -s "[Let's Encrypt Auto Update] Update Report for $DOMAIN" $EMAIL
10 1 1 * * sudo /home/tanaka/bin/update_cert.sh &> /home/tanaka/bin/update_cert_cron_log.txt