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
本日のリンク元
その他のリンク元

トップ «前の日記(2016-07-29(Fri)) 最新 次の日記(2016-08-25(Thu))» 月表示 編集 設定
2006|01|06|12|
2007|06|09|
2008|01|03|04|06|07|08|09|10|12|
2009|01|02|05|06|07|08|10|11|12|
2010|03|04|05|06|07|08|09|10|11|
2011|01|02|03|04|05|06|07|08|09|11|12|
2012|01|02|04|06|07|08|10|11|12|
2013|01|02|03|07|08|10|11|12|
2014|01|02|04|05|06|07|08|09|10|11|
2015|01|02|07|11|12|
2016|01|03|05|07|08|09|