Dieser Beitrag soll zeigen, wie mit wenig Aufwand Zertifikate des Dienstes Let’s Encrypt unter Debian installiert werden können. Dazu muss natürlich selbst die Software noch installiert werden. Außerdem möchte ich auch noch die Benutzung und Konfiguration der Zertifikate im Apache Webserver zeigen. In einem weiteren Artikel werde ich auch noch die SSL-Konfiguration des Apache Webservers zeigen. Die Verlinkung dazu erfolgt dann später noch.
Installation von LetsEncrypt und CertBot
Erstmal clonen wir die Software aus dem GIT-Repo von Let’s Encrypt:
# Software installieren: # root werden: $ sudo su - # Pfad setzen, fuer letsencrypt: $ letsencrypt_path="/opt/letsencrypt" # git installieren: $ apt-get install git # git repo von letsencrypt clonen: $ git clone https://github.com/letsencrypt/letsencrypt $letsencrypt_path # nach /opt/letsencrypt wechseln: $ cd $letsencrypt_path
Hier das Listing aus /opt/letsencrypt:
$ ls -l insgesamt 236 drwxr-xr-x 5 root root 4096 Apr 19 21:37 acme drwxr-xr-x 5 root root 4096 Apr 19 21:37 certbot drwxr-xr-x 4 root root 4096 Apr 19 21:37 certbot-apache -rwxr-xr-x 1 root root 47164 Apr 19 21:37 certbot-auto drwxr-xr-x 5 root root 4096 Apr 19 21:37 certbot-compatibility-test drwxr-xr-x 5 root root 4096 Apr 19 21:37 certbot-nginx -rw-r--r-- 1 root root 16313 Apr 19 21:37 CHANGELOG.md -rw-r--r-- 1 root root 276 Apr 19 21:37 CHANGES.rst -rw-r--r-- 1 root root 1402 Apr 19 21:37 CONTRIBUTING.md -rw-r--r-- 1 root root 360 Apr 19 21:37 docker-compose.yml -rw-r--r-- 1 root root 635 Apr 19 21:37 Dockerfile -rw-r--r-- 1 root root 2945 Apr 19 21:37 Dockerfile-dev -rw-r--r-- 1 root root 2999 Apr 19 21:37 Dockerfile-old drwxr-xr-x 5 root root 4096 Apr 19 21:37 docs drwxr-xr-x 3 root root 4096 Apr 19 21:37 examples -rw-r--r-- 1 root root 428 Apr 19 21:37 ISSUE_TEMPLATE.md -rwxr-xr-x 1 root root 47164 Apr 19 21:37 letsencrypt-auto drwxr-xr-x 4 root root 4096 Apr 19 21:37 letsencrypt-auto-source drwxr-xr-x 4 root root 4096 Apr 19 21:37 letshelp-certbot -rw-r--r-- 1 root root 11456 Apr 19 21:37 LICENSE.txt -rw-r--r-- 1 root root 813 Apr 19 21:37 linter_plugin.py -rw-r--r-- 1 root root 205 Apr 19 21:37 MANIFEST.in -rw-r--r-- 1 root root 7576 Apr 19 21:37 README.rst -rw-r--r-- 1 root root 494 Apr 19 21:37 readthedocs.org.requirements.txt -rw-r--r-- 1 root root 139 Apr 19 21:37 setup.cfg -rw-r--r-- 1 root root 4090 Apr 19 21:37 setup.py drwxr-xr-x 4 root root 4096 Apr 19 21:37 tests drwxr-xr-x 2 root root 4096 Apr 19 21:37 tools -rwxr-xr-x 1 root root 1316 Apr 19 21:37 tox.cover.sh -rw-r--r-- 1 root root 5570 Apr 19 21:37 tox.ini
certbot-auto Script testen und aufrufen
Beim Erstaufruf des certbot-auto Scripts werden die Softwarevoraussetzungen geprüft und vom Script selbst werden div. Pakete nachinstalliert. Am besten benutzt man dafür den Befehl „certbot-auto certificates“
# Hier kann man wieder als User arbeiten und die Befehle mit sudo aufrufen: $ sudo /opt/letsencrypt/certbot-auto certificates # # Unter Debian Wheezy wird noch gefragt, ob das Backport Repository aktiviert werden darf: To use the Apache Certbot plugin, augeas needs to be installed from wheezy-backports. Would you like to enable the wheezy-backports repository [Y/n]? Y Suggested packages: augeas-doc augeas-tools The following NEW packages will be installed: augeas-lenses libaugeas0 # ansonsten werden die fehlenden Softwarepakete selbstständig installiert. # [...] The following NEW packages will be installed: binutils cpp cpp-4.7 gcc gcc-4.7 libc-dev-bin libc6-dev libexpat1-dev libffi-dev libgmp10 libitm1 libmpc2 libmpfr4 libpython2.7 libquadmath0 libssl-dev linux-libc-dev python-dev python-pkg-resources python-setuptools python-virtualenv python2.7-dev zlib1g-dev 0 upgraded, 23 newly installed, 0 to remove and 5 not upgraded. Need to get 52.2 MB of archives. After this operation, 109 MB of additional disk space will be used. Do you want to continue [Y/n]? Get:1 http://security.debian.org/ wheezy/updates/main binutils amd64 2.22-8+deb7u3 [4,780 kB] Setting up python-setuptools (0.6.24-1) ... Setting up python-virtualenv (1.7.1.2-2) ... Creating virtual environment... Installing Python packages... Installation succeeded. Saving debug log to /var/log/letsencrypt/letsencrypt.log # eigentliche Ausgabe des Scriptes: ------------------------------------------------------------------------------- No certs found. -------------------------------------------------------------------------------
Im folgenden Artikel wird der genaue Beantragungsprozeß und die Installation im Apache-Server beschrieben.