yuu_nkjm blog
2016-08-24(Wed) [長年日記] 編集
[letsencrypt][SSL][https][cron][openSUSE][Apache] Letsencrypt
How to set up letsencrypt on OpenSUSE 13.2 (Tutorial) - Server - Let's Encrypt Community Supportの通りでほぼOKだった.
差分
エラー
Directory '/etc/apache2/sites-enabled' does not exist. Please ensure that the values for --apache-handle-sites and --apache-server-root are correct for your environment.
というエラーが出たときは,"ln -s /etc/apache2/vhost /etc/apache2/sites-enabled"で,解消した.
VirtualHost設定の重複を削除
重複部分を切り出して,includeすればOK
SSLEngine on SSLCertificateFile /etc/letsencrypt/live/.... SSLCertificateKeyFile /etc/letsencrypt/.... Include /etc/apache2/vhosts.d/nkjmlab.org.ini Include /etc/apache2/vhosts.d/nkjmlab.org.ini
コマンドログ
cd /root zypper in git git clone https://github.com/letsencrypt/letsencrypt emacs /etc/letsencrypt/conf/nkjmlab.org.ini rsa-key-size = 4096 email = myaddress@example.com authenticator = webroot webroot-path = /srv/www/vhosts/nkjmlab.org domain = nkjmlab.org cd /root/letsencrypt /root/letsencrypt/letsencrypt-auto certonly -c /etc/letsencrypt/conf/nkjmlab.org.ini cp -a /etc/apache2/vhosts.d/nkjmlab.org.conf /etc/apache2/vhosts.d/nkjmlab.org-ssl.conf emacs /etc/apache2/vhosts.d/nkjmlab.org-ssl.conf SSLEngine on SSLCertificateFile /etc/letsencrypt/live/nkjmlab.org/fullchain.pem SSLCertificateKeyFile /etc/letsencrypt/live/nkjmlab.org/privkey.pem yast -> sysconfig editor APACHE_MODULES="[...] ssl [...]" APACHE_SERVER_FLAGS="SSL" service apache2 restart # 全ドメインの証明書を更新するスクリプトををcronで回す. emacs /etc/cron.monthly/letsencrypt.sh /root/letsencrypt/letsencrypt-auto renew --force-renew /usr/sbin/service apache2 restart chmod +x /etc/cron.monthly/letsencrypt.sh