LetsEncrypt (Ubuntu 18.04): Unterschied zwischen den Versionen

Aus Tutorials
Zur Navigation springen Zur Suche springen
 
(14 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt)
Zeile 1: Zeile 1:
== Installation ==
== Installation ==


=== Ubuntu ===
=== Raspbian ===
 
<pre>
sudo apt-get install certbot python-certbot-apache
</pre>


=== Raspbian ===
{{note|Deprecated: Mittlerweile selbe Prozedur wie unter Ubuntu beschrieben.}}


<pre>
<pre>
Zeile 28: Zeile 24:
</pre>
</pre>


== Zertifikate erstellen ==
==== Zertifikate erstellen ====


{{note|Die DNS-Namen müssen existieren und auf den Server zeigen, auf dem das Skript ausgeführt wird.}}
{{note|Die DNS-Namen müssen existieren und auf den Server zeigen, auf dem das Skript ausgeführt wird.}}
Zeile 36: Zeile 32:
</pre>
</pre>


== Wildcard Zertifikate ==
=== Ubuntu ===


[[LetsEncrypt Wildcards (Ubuntu 18.04)|LetsEncrypt Wildcards]]
<pre>
sudo apt-get install certbot python-certbot-apache
</pre>


=== rfc2136 ===
==== Zertifikate erstellen ====


[https://bbs.archlinux.org/viewtopic.php?id=240847 https://bbs.archlinux.org/viewtopic.php?id=240847]
{{note|Die DNS-Namen müssen existieren und auf den Server zeigen, auf dem das Skript ausgeführt wird.}}


[https://doc.powerdns.com/authoritative/dnsupdate.html https://doc.powerdns.com/authoritative/dnsupdate.html]
<pre>
 
sudo certbot certonly --apache -d example.com -d www.example.com
[https://wiki.archlinux.org/index.php/Certbot https://wiki.archlinux.org/index.php/Certbot]
</pre>


=== Docker ===
== Zertifikat hinzufügen ==
 
Um das [https://hub.docker.com/r/certbot/dns-nsone certbot/dns-nsone]-Image zu benützen, folgenden Befehl ausführen:


<pre>
<pre>
sudo docker run -it --rm --name certbot \
sudo certbot --expand -d existing.com,example.com,newdomain.com
            -v "/etc/letsencrypt:/etc/letsencrypt" \
            -v "/var/lib/letsencrypt:/var/lib/letsencrypt" \
            certbot/dns-nsone certonly
</pre>
</pre>


==== Links ====
=== Links ===


[https://certbot.eff.org/docs/install.html#running-with-docker https://certbot.eff.org/docs/install.html#running-with-docker]
[https://eff-certbot.readthedocs.io/en/stable/using.html#certbot-command-line-options https://eff-certbot.readthedocs.io/en/stable/using.html#certbot-command-line-options]


[https://hub.docker.com/u/certbot https://hub.docker.com/u/certbot]
== Wildcard Zertifikate ==


[https://medium.com/faun/docker-letsencrypt-dns-validation-75ba8c08a0d https://medium.com/faun/docker-letsencrypt-dns-validation-75ba8c08a0d]
[[LetsEncrypt Wildcards (Ubuntu 18.04)|LetsEncrypt Wildcards]]


== Migration bestehender Zertifikate ==
== Migration bestehender Zertifikate ==
Zeile 92: Zeile 85:
</pre>
</pre>


<pre>
sudo tar -chvzf certs_raspberry2.tar.gz /etc/letsencrypt/archive/tutorials-rasp.kirner.or.at \
/etc/letsencrypt/renewal/tutorials-rasp.kirner.or.at.conf
</pre>
Update 12.03.2020:
<pre>
<pre>
sudo su
sudo su
Zeile 123: Zeile 110:


[https://ivanderevianko.com/2019/03/migrate-letsencrypt-certificates-certbot-to-new-server https://ivanderevianko.com/2019/03/migrate-letsencrypt-certificates-certbot-to-new-server]
[https://ivanderevianko.com/2019/03/migrate-letsencrypt-certificates-certbot-to-new-server https://ivanderevianko.com/2019/03/migrate-letsencrypt-certificates-certbot-to-new-server]
== Mergen bestehender Zertifikate ==
=== Links ===
[https://community.letsencrypt.org/t/moving-and-merging-certs-from-server-a-to-b/19015/3 https://community.letsencrypt.org/t/moving-and-merging-certs-from-server-a-to-b/19015/3]
== Hooks ==
Ablauf:
# pre-hook
# Authorization
# post-hook
# deploy-hook, if there is a new certificate
=== Links ===
[https://certbot.eff.org/docs/using.html?highlight=hook#renewing-certificates https://certbot.eff.org/docs/using.html?highlight=hook#renewing-certificates]
[https://community.letsencrypt.org/t/certbot-hook-directories/42505 https://community.letsencrypt.org/t/certbot-hook-directories/42505]
[https://advancedweb.hu/lets-encrypt-hooks-use-cases/ https://advancedweb.hu/lets-encrypt-hooks-use-cases/]
== Services deaktivieren ==
{{note|Noch in Bearbeitung}}
<pre>
sudo systemctl status certbot.service
sudo systemctl status certbot.timer
</pre>


== Probleme ==
== Probleme ==
Zeile 143: Zeile 162:
== Links ==
== Links ==


[https://certbot.eff.org/lets-encrypt/debianother-apache https://certbot.eff.org/lets-encrypt/debianother-apache]
[https://certbot.eff.org/instructions https://certbot.eff.org/instructions]




Zurück zu [[LetsEncrypt (Linux)|LetsEncrypt]]
Zurück zu [[LetsEncrypt (Linux)|LetsEncrypt]]

Aktuelle Version vom 14. Mai 2023, 19:53 Uhr

Installation

Raspbian

Deprecated: Mittlerweile selbe Prozedur wie unter Ubuntu beschrieben.

wget https://dl.eff.org/certbot-auto
sudo mv certbot-auto /usr/local/bin/certbot-auto
sudo chown root /usr/local/bin/certbot-auto
sudo chmod 0755 /usr/local/bin/certbot-auto

Folgender Befehl fügt einen Cron-Job zu den systemweiten Cronjobs hinzu:

echo "0 0,12 * * * root python -c 'import random; import time; time.sleep(random.random() * 3600)' && /usr/local/bin/certbot-auto renew -q" | sudo tee -a /etc/crontab > /dev/null

Systemweiten Cronjobs auflisten:

less /etc/crontab

Zertifikate erstellen

Die DNS-Namen müssen existieren und auf den Server zeigen, auf dem das Skript ausgeführt wird.

sudo /usr/local/bin/certbot-auto certonly --apache -d example.com -d www.example.com

Ubuntu

sudo apt-get install certbot python-certbot-apache

Zertifikate erstellen

Die DNS-Namen müssen existieren und auf den Server zeigen, auf dem das Skript ausgeführt wird.

sudo certbot certonly --apache -d example.com -d www.example.com

Zertifikat hinzufügen

sudo certbot --expand -d existing.com,example.com,newdomain.com

Links

https://eff-certbot.readthedocs.io/en/stable/using.html#certbot-command-line-options

Wildcard Zertifikate

LetsEncrypt Wildcards

Migration bestehender Zertifikate

Backup

sudo ls -l /etc/letsencrypt/live/tutorials-rasp.kirner.or.at
insgesamt 0
lrwxrwxrwx 1 root root 52 Jän 11 10:31 cert.pem -> ../../archive/tutorials-rasp.kirner.or.at/cert20.pem
lrwxrwxrwx 1 root root 53 Jän 11 10:31 chain.pem -> ../../archive/tutorials-rasp.kirner.or.at/chain20.pem
lrwxrwxrwx 1 root root 57 Jän 11 10:31 fullchain.pem -> ../../archive/tutorials-rasp.kirner.or.at/fullchain20.pem
lrwxrwxrwx 1 root root 55 Jän 11 10:31 privkey.pem -> ../../archive/tutorials-rasp.kirner.or.at/privkey20.pem
sudo ls -l /etc/letsencrypt/renewal
insgesamt 4
-rw-r--r-- 1 root root 594 Jän 11 10:31 tutorials-rasp.kirner.or.at.conf
sudo su
cd /etc/letsencrypt
sudo tar -cvzf 2020_03_12__LetsEncryptFullBackupRaspberry2.tgz accounts/ archive/ renewal/
sudo exit

Restore

cd /
sudo tar -xvf ~/temp/certs_raspberry2.tar.gz 
sudo mkdir -p /etc/letsencrypt/live/tutorials-rasp.kirner.or.at
sudo ln -s /etc/letsencrypt/archive/tutorials-rasp.kirner.or.at/cert20.pem /etc/letsencrypt/live/tutorials-rasp.kirner.or.at/cert.pem
sudo ln -s /etc/letsencrypt/archive/tutorials-rasp.kirner.or.at/chain20.pem /etc/letsencrypt/live/tutorials-rasp.kirner.or.at/chain.pem
sudo ln -s /etc/letsencrypt/archive/tutorials-rasp.kirner.or.at/fullchain20.pem /etc/letsencrypt/live/tutorials-rasp.kirner.or.at/fullchain.pem
sudo ln -s /etc/letsencrypt/archive/tutorials-rasp.kirner.or.at/privkey20.pem /etc/letsencrypt/live/tutorials-rasp.kirner.or.at/privkey.pem

Links

https://ivanderevianko.com/2019/03/migrate-letsencrypt-certificates-certbot-to-new-server

Mergen bestehender Zertifikate

Links

https://community.letsencrypt.org/t/moving-and-merging-certs-from-server-a-to-b/19015/3

Hooks

Ablauf:

  1. pre-hook
  2. Authorization
  3. post-hook
  4. deploy-hook, if there is a new certificate

Links

https://certbot.eff.org/docs/using.html?highlight=hook#renewing-certificates

https://community.letsencrypt.org/t/certbot-hook-directories/42505

https://advancedweb.hu/lets-encrypt-hooks-use-cases/

Services deaktivieren

Noch in Bearbeitung

sudo systemctl status certbot.service
sudo systemctl status certbot.timer

Probleme

We were not be able to guess the right solution from your pip output.

Beim Ausführen des Befehls

sudo /usr/local/bin/certbot-auto renew -q

Löschen der Datei

sudo rm /etc/pip.conf

und nochmaliges Ausführen von certbot-auto hat das Problem gelöst.

Links

https://certbot.eff.org/instructions


Zurück zu LetsEncrypt