Create and automatically renew Letsencrypt certificate

Veröffentlicht von philipp am

Originally found here https://decatec.de/home-server/owncloud-9-auf-ubuntu-server-16-04-lts-mit-nginx-mariadb-php-7-und-lets-encrypt/.
Thanks for the great setup guide!
But due to a problem with my nginx setup I have to update my nginx config every time I want to renew the certificate.

On SurServ

  • sudo su
  • cd /etc/nginx/conf.d
  • nano surrouter.asuscomm.com
  • comment out: return 301 https://$server_addr$request_uri;
  • CTRL+O and CTRL+X
  • service nginx restart
  • letsencrypt certonly –webroot -w /var/www/letsencrypt -d surrouter.asuscomm.com –rsa-key-size 4096 (beware: two „-“ for ‚webroot‘ and ‚rsa-key-size‘)
  • rm -v /etc/letsencrypt/archive/surrouter.asuscomm.com/*5.pem
  • cp -v /etc/letsencrypt/archive/surrouter.asuscomm.com/*6.pem /home/surserv/Server/
  • revert changes made in /etc/nginx/conf.d/surrouter.asuscomm.com

SFTP to surserv and copy them to raspberry pi

On the Pi

  • rm -v /etc/letsencrypt/surrouter.asuscomm.com/*
  • mv -v *6.pem /etc/letsencrypt/surrouter.asuscomm.com/
  • chmod 600 /etc/letsencrypt/surrouter.asuscomm.com/*
  • mv -v /etc/letsencrypt/surrouter.asuscomm.com/cert* /etc/letsencrypt/surrouter.asuscomm.com/cert.pem
  • mv -v /etc/letsencrypt/surrouter.asuscomm.com/chain* /etc/letsencrypt/surrouter.asuscomm.com/chain.pem
  • mv -v /etc/letsencrypt/surrouter.asuscomm.com/fullchain* /etc/letsencrypt/surrouter.asuscomm.com/fullchain.pem
  • mv -v /etc/letsencrypt/surrouter.asuscomm.com/privkey* /etc/letsencrypt/surrouter.asuscomm.com/privkey.pem

 

Raspberry Pi SSL Zertifikat kostenlos mit Let’s Encrypt erstellen

Kategorien: Linux

0 Kommentare

Schreibe einen Kommentar

Avatar-Platzhalter

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert