Im dritten Teil meiner Artikelserie wollen wir uns mit dem Webserver Apache und Let’s Encrypt beschäftigen.
Der Apache HTTP Server ist ein quelloffenes und freies Produkt der Apache Software Foundation und der meistbenutzte Webserver im Internet. Let’s Encrypt ist eine freie, automatische und offene Zertifizierungsstelle (CA) für Webseitenzertifikate, betrieben durch die Internet Security Research Group (ISRG). Mit diesen beiden Komponenten wollen wir eine Webpage aufsetzen, die ihre Inhalte verschlüsselt mit Hilfe des HyperText Transfer Protocol Secure (HTTPS) ausliefert.
Wenden wir uns zunächst dem HTTP Server Apache zu.
1 2 3 4 5 6 | $ dpkg -l | grep apache ii apache2 2.4.7-1ubuntu4.9 amd64 Apache HTTP Server ii apache2-bin 2.4.7-1ubuntu4.9 amd64 Apache HTTP Server (binary files and modules) ii apache2-data 2.4.7-1ubuntu4.9 all Apache HTTP Server (common files) ii apache2-mpm-prefork 2.4.7-1ubuntu4.9 amd64 transitional prefork MPM package for apache2 ii libapache2-mod-php5 5.5.9+dfsg-1ubuntu4.14 amd64 server-side, HTML-embedded scripting language (Apache 2 module) |
Wie das Paketlisting zeigt, ist der Apache in der Version 2.4.7 bereits installiert. Deshalb überprüfen wir, ob der Apache auch schon läuft.
1 2 | $ service apache2 status * apache2 is running |
Ja, der HTTP Server läuft bereits. Nun öffnen wir eine Webbrowser und geben unsere Domain in die Adresszeile ein. Tatsächlich der Server läuft bereits und gibt die Apache2 Ubuntu Default Page aus.
Die Seite enthält nützliche Informationen über das Konfigurationslayout und die Verwaltung des Webservers.
Zunächst werfen wir einen Blick in das Konfigurationsverzeichnis:
1 2 3 4 5 6 7 8 9 10 11 12 13 | $ cd /etc/apache2/ $ ls -l total 80 -rw-r--r-- 1 root root 7115 Jan 7 2014 apache2.conf drwxr-xr-x 2 root root 4096 Feb 17 12:35 conf-available/ drwxr-xr-x 2 root root 4096 Feb 17 12:35 conf-enabled/ -rw-r--r-- 1 root root 1782 Jan 3 2014 envvars -rw-r--r-- 1 root root 31063 Jan 3 2014 magic drwxr-xr-x 2 root root 12288 Feb 19 16:12 mods-available/ drwxr-xr-x 2 root root 4096 Feb 19 16:12 mods-enabled/ -rw-r--r-- 1 root root 320 Jan 7 2014 ports.conf drwxr-xr-x 2 root root 4096 Feb 18 20:43 sites-available/ drwxr-xr-x 2 root root 4096 Feb 17 12:35 sites-enabled/ |
Die Verzeichnisse conf-, mods- bzw. sites-available enthalten die vorhandenen Konfigurationen, Module bzw. Webseiten. Das Aktivieren und Deaktivieren von Konfigurationen, Modulen und Webseiten erfolgt mit den Kommandos a2enconf, a2disconf, a2enmod, a2dismod, a2ensite und a2dissite. Durch das Aktivieren werden logical links in den *-enabled Verzeichnissen angelegt, die auf die entsprechenden Einträge in den *-available Verzeichnissen verweisen. Beim Deaktivieren werden diese logical links wieder gelöscht.
Nun schauen wir uns das Verzeichnis sites-enabled an:
1 2 3 | $ ls -l sites-enabled/ total 0 lrwxrwxrwx 1 root root 35 Feb 17 12:35 000-default.conf -> ../sites-available/000-default.conf |
Dies ist die Konfiguration für die Apache2 Ubuntu Default Page.
Im Verzeichnis sites-available finden wir zusätzlich eine Konfiguration für eine default HTTPS Seite:
1 2 3 4 | $ ls -l sites-available/ total 12 -rw-r--r-- 1 root root 1342 Feb 18 20:43 000-default.conf -rw-r--r-- 1 root root 6447 Feb 18 20:43 default-ssl.conf |
Wir bearbeiten beide Dateien und ersetzen die E-Mail-Adresse des ServerAdmin in der Zeile ServerAdmin webmaster@example.com mit unserer Webmaster E-Mail-Adresse.
Anschließend müssen wir noch dafür sorgen, dass der Apache die Änderungen der Konfiguration übernimmt. Dies erreichen wir mit dem folgenden Befehl:
1 2 3 | $ service apache2 reload * Reloading web server apache2 * |
Okay, nun wollen wir uns zunächst Let’s Encrypt zuwenden. Um die gewünschten Zertifikate zu erhalten und zu verwalten müssen wir den Let’s Encrypt Client installieren, siehe auch die Client Dokumentation auf der Let’s Encrypt Webpage. Zur Zeit gibt es kein Ubuntu 14.04 package für den Let’s Encrypt client, weshalb wir ihn manuell aus dem github repository installieren müssen. Um die Auflösung der Abhängigkeiten müssen wir uns nicht kümmern, da es mit dem letsencrypt-auto wrapper script eine Lösung gibt, die das für uns erledigt. Dieses wrapper script löst einige Abhängigkeiten auf und packt andere, die nicht als Ubuntu 14.04 packete vorhanden sind in ein python virtual environment. Da ich allerdings für zukünftige Projekte ebenfalls das python-virtualenv Paket brauche installieren wir es hier zunächst. Dabei werden eine ganze Reihe weiterer Pakete installiert.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 | $ apt-get install python-virtualenv Reading package lists... Done Building dependency tree Reading state information... Done The following extra packages will be installed: binutils build-essential cpp cpp-4.8 dpkg-dev fakeroot g++ g++-4.8 gcc gcc-4.8 libalgorithm-diff-perl libalgorithm-diff-xs-perl libalgorithm-merge-perl libasan0 libatomic1 libc-dev-bin libc6-dev libcloog-isl4 libdpkg-perl libfakeroot libfile-fcntllock-perl libgcc-4.8-dev libgmp10 libgomp1 libisl10 libitm1 libmpc3 libmpfr4 libquadmath0 libstdc++-4.8-dev libtsan0 linux-libc-dev make manpages-dev python-chardet-whl python-colorama python-colorama-whl python-distlib python-distlib-whl python-html5lib python-html5lib-whl python-pip python-pip-whl python-requests-whl python-setuptools python-setuptools-whl python-six-whl python-urllib3-whl python-wheel python3-pkg-resources Suggested packages: binutils-doc cpp-doc gcc-4.8-locales debian-keyring g++-multilib g++-4.8-multilib gcc-4.8-doc libstdc++6-4.8-dbg gcc-multilib autoconf automake1.9 libtool flex bison gdb gcc-doc gcc-4.8-multilib libgcc1-dbg libgomp1-dbg libitm1-dbg libatomic1-dbg libasan0-dbg libtsan0-dbg libquadmath0-dbg glibc-doc libstdc++-4.8-doc make-doc python-genshi python-lxml python3-setuptools Recommended packages: python-dev-all The following NEW packages will be installed: binutils build-essential cpp cpp-4.8 dpkg-dev fakeroot g++ g++-4.8 gcc gcc-4.8 libalgorithm-diff-perl libalgorithm-diff-xs-perl libalgorithm-merge-perl libasan0 libatomic1 libc-dev-bin libc6-dev libcloog-isl4 libdpkg-perl libfakeroot libfile-fcntllock-perl libgcc-4.8-dev libgmp10 libgomp1 libisl10 libitm1 libmpc3 libmpfr4 libquadmath0 libstdc++-4.8-dev libtsan0 linux-libc-dev make manpages-dev python-chardet-whl python-colorama python-colorama-whl python-distlib python-distlib-whl python-html5lib python-html5lib-whl python-pip python-pip-whl python-requests-whl python-setuptools python-setuptools-whl python-six-whl python-urllib3-whl python-virtualenv python-wheel python3-pkg-resources 0 upgraded, 51 newly installed, 0 to remove and 0 not upgraded. Need to get 42.9 MB of archives. After this operation, 121 MB of additional disk space will be used. Do you want to continue? [Y/n] Get:1 http://us.archive.ubuntu.com/ubuntu/ trusty-updates/main libasan0 amd64 4.8.4-2ubuntu1~14.04.1 [63.1 kB] Get:2 http://us.archive.ubuntu.com/ubuntu/ trusty-updates/main libatomic1 amd64 4.8.4-2ubuntu1~14.04.1 [8,640 B] Get:3 http://us.archive.ubuntu.com/ubuntu/ trusty/main libgmp10 amd64 2:5.1.3+dfsg-1ubuntu1 [218 kB] Get:4 http://us.archive.ubuntu.com/ubuntu/ trusty/main libisl10 amd64 0.12.2-1 [419 kB] Get:5 http://us.archive.ubuntu.com/ubuntu/ trusty/main libcloog-isl4 amd64 0.18.2-1 [57.5 kB] Get:6 http://us.archive.ubuntu.com/ubuntu/ trusty-updates/main libgomp1 amd64 4.8.4-2ubuntu1~14.04.1 [23.1 kB] Get:7 http://us.archive.ubuntu.com/ubuntu/ trusty-updates/main libitm1 amd64 4.8.4-2ubuntu1~14.04.1 [28.5 kB] Get:8 http://us.archive.ubuntu.com/ubuntu/ trusty/main libmpfr4 amd64 3.1.2-1 [203 kB] Get:9 http://us.archive.ubuntu.com/ubuntu/ trusty-updates/main libquadmath0 amd64 4.8.4-2ubuntu1~14.04.1 [126 kB] Get:10 http://us.archive.ubuntu.com/ubuntu/ trusty-updates/main libtsan0 amd64 4.8.4-2ubuntu1~14.04.1 [94.9 kB] Get:11 http://us.archive.ubuntu.com/ubuntu/ trusty/main libmpc3 amd64 1.0.1-1ubuntu1 [38.4 kB] Get:12 http://us.archive.ubuntu.com/ubuntu/ trusty-updates/main binutils amd64 2.24-5ubuntu14 [2,076 kB] Get:13 http://us.archive.ubuntu.com/ubuntu/ trusty-updates/main libc-dev-bin amd64 2.19-0ubuntu6.7 [69.0 kB] Get:14 http://us.archive.ubuntu.com/ubuntu/ trusty-updates/main linux-libc-dev amd64 3.13.0-77.121 [776 kB] Get:15 http://us.archive.ubuntu.com/ubuntu/ trusty-updates/main libc6-dev amd64 2.19-0ubuntu6.7 [1,910 kB] Get:16 http://us.archive.ubuntu.com/ubuntu/ trusty-updates/main cpp-4.8 amd64 4.8.4-2ubuntu1~14.04.1 [4,595 kB] Get:17 http://us.archive.ubuntu.com/ubuntu/ trusty/main cpp amd64 4:4.8.2-1ubuntu6 [27.5 kB] Get:18 http://us.archive.ubuntu.com/ubuntu/ trusty-updates/main libgcc-4.8-dev amd64 4.8.4-2ubuntu1~14.04.1 [1,688 kB] Get:19 http://us.archive.ubuntu.com/ubuntu/ trusty-updates/main gcc-4.8 amd64 4.8.4-2ubuntu1~14.04.1 [5,056 kB] Get:20 http://us.archive.ubuntu.com/ubuntu/ trusty/main gcc amd64 4:4.8.2-1ubuntu6 [5,098 B] Get:21 http://us.archive.ubuntu.com/ubuntu/ trusty-updates/main libstdc++-4.8-dev amd64 4.8.4-2ubuntu1~14.04.1 [1,051 kB] Get:22 http://us.archive.ubuntu.com/ubuntu/ trusty-updates/main g++-4.8 amd64 4.8.4-2ubuntu1~14.04.1 [18.1 MB] Get:23 http://us.archive.ubuntu.com/ubuntu/ trusty/main g++ amd64 4:4.8.2-1ubuntu6 [1,490 B] Get:24 http://us.archive.ubuntu.com/ubuntu/ trusty/main make amd64 3.81-8.2ubuntu3 [119 kB] Get:25 http://us.archive.ubuntu.com/ubuntu/ trusty-updates/main libdpkg-perl all 1.17.5ubuntu5.5 [179 kB] Get:26 http://us.archive.ubuntu.com/ubuntu/ trusty-updates/main dpkg-dev all 1.17.5ubuntu5.5 [726 kB] Get:27 http://us.archive.ubuntu.com/ubuntu/ trusty/main build-essential amd64 11.6ubuntu6 [4,838 B] Get:28 http://us.archive.ubuntu.com/ubuntu/ trusty/main libfakeroot amd64 1.20-3ubuntu2 [25.4 kB] Get:29 http://us.archive.ubuntu.com/ubuntu/ trusty/main fakeroot amd64 1.20-3ubuntu2 [55.0 kB] Get:30 http://us.archive.ubuntu.com/ubuntu/ trusty/main libalgorithm-diff-perl all 1.19.02-3 [50.0 kB] Get:31 http://us.archive.ubuntu.com/ubuntu/ trusty/main libalgorithm-diff-xs-perl amd64 0.04-2build4 [12.6 kB] Get:32 http://us.archive.ubuntu.com/ubuntu/ trusty/main libalgorithm-merge-perl all 0.08-2 [12.7 kB] Get:33 http://us.archive.ubuntu.com/ubuntu/ trusty/main libfile-fcntllock-perl amd64 0.14-2build1 [15.9 kB] Get:34 http://us.archive.ubuntu.com/ubuntu/ trusty/main manpages-dev all 3.54-1ubuntu1 [1,820 kB] Get:35 http://us.archive.ubuntu.com/ubuntu/ trusty-updates/main python3-pkg-resources all 3.3-1ubuntu2 [31.7 kB] Get:36 http://us.archive.ubuntu.com/ubuntu/ trusty-updates/universe python-chardet-whl all 2.2.1-2~ubuntu1 [170 kB] Get:37 http://us.archive.ubuntu.com/ubuntu/ trusty-updates/universe python-colorama all 0.2.5-0.1ubuntu2 [18.4 kB] Get:38 http://us.archive.ubuntu.com/ubuntu/ trusty-updates/universe python-colorama-whl all 0.2.5-0.1ubuntu2 [18.2 kB] Get:39 http://us.archive.ubuntu.com/ubuntu/ trusty-updates/universe python-distlib all 0.1.8-1ubuntu1 [113 kB] Get:40 http://us.archive.ubuntu.com/ubuntu/ trusty-updates/universe python-distlib-whl all 0.1.8-1ubuntu1 [140 kB] Get:41 http://us.archive.ubuntu.com/ubuntu/ trusty-updates/main python-html5lib all 0.999-3~ubuntu1 [83.5 kB] Get:42 http://us.archive.ubuntu.com/ubuntu/ trusty-updates/main python-html5lib-whl all 0.999-3~ubuntu1 [109 kB] Get:43 http://us.archive.ubuntu.com/ubuntu/ trusty-updates/main python-six-whl all 1.5.2-1ubuntu1 [10.5 kB] Get:44 http://us.archive.ubuntu.com/ubuntu/ trusty-updates/main python-urllib3-whl all 1.7.1-1ubuntu4 [64.0 kB] Get:45 http://us.archive.ubuntu.com/ubuntu/ trusty-updates/main python-requests-whl all 2.2.1-1ubuntu0.3 [227 kB] Get:46 http://us.archive.ubuntu.com/ubuntu/ trusty-updates/main python-setuptools-whl all 3.3-1ubuntu2 [244 kB] Get:47 http://us.archive.ubuntu.com/ubuntu/ trusty-updates/universe python-pip-whl all 1.5.4-1ubuntu3 [111 kB] Get:48 http://us.archive.ubuntu.com/ubuntu/ trusty-updates/main python-setuptools all 3.3-1ubuntu2 [230 kB] Get:49 http://us.archive.ubuntu.com/ubuntu/ trusty-updates/universe python-pip all 1.5.4-1ubuntu3 [97.2 kB] Get:50 http://us.archive.ubuntu.com/ubuntu/ trusty-updates/universe python-virtualenv all 1.11.4-1ubuntu1 [1,485 kB] Get:51 http://us.archive.ubuntu.com/ubuntu/ trusty-updates/main python-wheel all 0.24.0-1~ubuntu1 [44.7 kB] Fetched 42.9 MB in 10s (4,007 kB/s) Extracting templates from packages: 100% Selecting previously unselected package libasan0:amd64. (Reading database ... 89341 files and directories currently installed.) Preparing to unpack .../libasan0_4.8.4-2ubuntu1~14.04.1_amd64.deb ... Unpacking libasan0:amd64 (4.8.4-2ubuntu1~14.04.1) ... Selecting previously unselected package libatomic1:amd64. Preparing to unpack .../libatomic1_4.8.4-2ubuntu1~14.04.1_amd64.deb ... Unpacking libatomic1:amd64 (4.8.4-2ubuntu1~14.04.1) ... Selecting previously unselected package libgmp10:amd64. Preparing to unpack .../libgmp10_2%3a5.1.3+dfsg-1ubuntu1_amd64.deb ... Unpacking libgmp10:amd64 (2:5.1.3+dfsg-1ubuntu1) ... Selecting previously unselected package libisl10:amd64. Preparing to unpack .../libisl10_0.12.2-1_amd64.deb ... Unpacking libisl10:amd64 (0.12.2-1) ... Selecting previously unselected package libcloog-isl4:amd64. Preparing to unpack .../libcloog-isl4_0.18.2-1_amd64.deb ... Unpacking libcloog-isl4:amd64 (0.18.2-1) ... Selecting previously unselected package libgomp1:amd64. Preparing to unpack .../libgomp1_4.8.4-2ubuntu1~14.04.1_amd64.deb ... Unpacking libgomp1:amd64 (4.8.4-2ubuntu1~14.04.1) ... Selecting previously unselected package libitm1:amd64. Preparing to unpack .../libitm1_4.8.4-2ubuntu1~14.04.1_amd64.deb ... Unpacking libitm1:amd64 (4.8.4-2ubuntu1~14.04.1) ... Selecting previously unselected package libmpfr4:amd64. Preparing to unpack .../libmpfr4_3.1.2-1_amd64.deb ... Unpacking libmpfr4:amd64 (3.1.2-1) ... Selecting previously unselected package libquadmath0:amd64. Preparing to unpack .../libquadmath0_4.8.4-2ubuntu1~14.04.1_amd64.deb ... Unpacking libquadmath0:amd64 (4.8.4-2ubuntu1~14.04.1) ... Selecting previously unselected package libtsan0:amd64. Preparing to unpack .../libtsan0_4.8.4-2ubuntu1~14.04.1_amd64.deb ... Unpacking libtsan0:amd64 (4.8.4-2ubuntu1~14.04.1) ... Selecting previously unselected package libmpc3:amd64. Preparing to unpack .../libmpc3_1.0.1-1ubuntu1_amd64.deb ... Unpacking libmpc3:amd64 (1.0.1-1ubuntu1) ... Selecting previously unselected package binutils. Preparing to unpack .../binutils_2.24-5ubuntu14_amd64.deb ... Unpacking binutils (2.24-5ubuntu14) ... Selecting previously unselected package libc-dev-bin. Preparing to unpack .../libc-dev-bin_2.19-0ubuntu6.7_amd64.deb ... Unpacking libc-dev-bin (2.19-0ubuntu6.7) ... Selecting previously unselected package linux-libc-dev:amd64. Preparing to unpack .../linux-libc-dev_3.13.0-77.121_amd64.deb ... Unpacking linux-libc-dev:amd64 (3.13.0-77.121) ... Selecting previously unselected package libc6-dev:amd64. Preparing to unpack .../libc6-dev_2.19-0ubuntu6.7_amd64.deb ... Unpacking libc6-dev:amd64 (2.19-0ubuntu6.7) ... Selecting previously unselected package cpp-4.8. Preparing to unpack .../cpp-4.8_4.8.4-2ubuntu1~14.04.1_amd64.deb ... Unpacking cpp-4.8 (4.8.4-2ubuntu1~14.04.1) ... Selecting previously unselected package cpp. Preparing to unpack .../cpp_4%3a4.8.2-1ubuntu6_amd64.deb ... Unpacking cpp (4:4.8.2-1ubuntu6) ... Selecting previously unselected package libgcc-4.8-dev:amd64. Preparing to unpack .../libgcc-4.8-dev_4.8.4-2ubuntu1~14.04.1_amd64.deb ... Unpacking libgcc-4.8-dev:amd64 (4.8.4-2ubuntu1~14.04.1) ... Selecting previously unselected package gcc-4.8. Preparing to unpack .../gcc-4.8_4.8.4-2ubuntu1~14.04.1_amd64.deb ... Unpacking gcc-4.8 (4.8.4-2ubuntu1~14.04.1) ... Selecting previously unselected package gcc. Preparing to unpack .../gcc_4%3a4.8.2-1ubuntu6_amd64.deb ... Unpacking gcc (4:4.8.2-1ubuntu6) ... Selecting previously unselected package libstdc++-4.8-dev:amd64. Preparing to unpack .../libstdc++-4.8-dev_4.8.4-2ubuntu1~14.04.1_amd64.deb ... Unpacking libstdc++-4.8-dev:amd64 (4.8.4-2ubuntu1~14.04.1) ... Selecting previously unselected package g++-4.8. Preparing to unpack .../g++-4.8_4.8.4-2ubuntu1~14.04.1_amd64.deb ... Unpacking g++-4.8 (4.8.4-2ubuntu1~14.04.1) ... Selecting previously unselected package g++. Preparing to unpack .../g++_4%3a4.8.2-1ubuntu6_amd64.deb ... Unpacking g++ (4:4.8.2-1ubuntu6) ... Selecting previously unselected package make. Preparing to unpack .../make_3.81-8.2ubuntu3_amd64.deb ... Unpacking make (3.81-8.2ubuntu3) ... Selecting previously unselected package libdpkg-perl. Preparing to unpack .../libdpkg-perl_1.17.5ubuntu5.5_all.deb ... Unpacking libdpkg-perl (1.17.5ubuntu5.5) ... Selecting previously unselected package dpkg-dev. Preparing to unpack .../dpkg-dev_1.17.5ubuntu5.5_all.deb ... Unpacking dpkg-dev (1.17.5ubuntu5.5) ... Selecting previously unselected package build-essential. Preparing to unpack .../build-essential_11.6ubuntu6_amd64.deb ... Unpacking build-essential (11.6ubuntu6) ... Selecting previously unselected package libfakeroot:amd64. Preparing to unpack .../libfakeroot_1.20-3ubuntu2_amd64.deb ... Unpacking libfakeroot:amd64 (1.20-3ubuntu2) ... Selecting previously unselected package fakeroot. Preparing to unpack .../fakeroot_1.20-3ubuntu2_amd64.deb ... Unpacking fakeroot (1.20-3ubuntu2) ... Selecting previously unselected package libalgorithm-diff-perl. Preparing to unpack .../libalgorithm-diff-perl_1.19.02-3_all.deb ... Unpacking libalgorithm-diff-perl (1.19.02-3) ... Selecting previously unselected package libalgorithm-diff-xs-perl. Preparing to unpack .../libalgorithm-diff-xs-perl_0.04-2build4_amd64.deb ... Unpacking libalgorithm-diff-xs-perl (0.04-2build4) ... Selecting previously unselected package libalgorithm-merge-perl. Preparing to unpack .../libalgorithm-merge-perl_0.08-2_all.deb ... Unpacking libalgorithm-merge-perl (0.08-2) ... Selecting previously unselected package libfile-fcntllock-perl. Preparing to unpack .../libfile-fcntllock-perl_0.14-2build1_amd64.deb ... Unpacking libfile-fcntllock-perl (0.14-2build1) ... Selecting previously unselected package manpages-dev. Preparing to unpack .../manpages-dev_3.54-1ubuntu1_all.deb ... Unpacking manpages-dev (3.54-1ubuntu1) ... Selecting previously unselected package python3-pkg-resources. Preparing to unpack .../python3-pkg-resources_3.3-1ubuntu2_all.deb ... Unpacking python3-pkg-resources (3.3-1ubuntu2) ... Selecting previously unselected package python-chardet-whl. Preparing to unpack .../python-chardet-whl_2.2.1-2~ubuntu1_all.deb ... Unpacking python-chardet-whl (2.2.1-2~ubuntu1) ... Selecting previously unselected package python-colorama. Preparing to unpack .../python-colorama_0.2.5-0.1ubuntu2_all.deb ... Unpacking python-colorama (0.2.5-0.1ubuntu2) ... Selecting previously unselected package python-colorama-whl. Preparing to unpack .../python-colorama-whl_0.2.5-0.1ubuntu2_all.deb ... Unpacking python-colorama-whl (0.2.5-0.1ubuntu2) ... Selecting previously unselected package python-distlib. Preparing to unpack .../python-distlib_0.1.8-1ubuntu1_all.deb ... Unpacking python-distlib (0.1.8-1ubuntu1) ... Selecting previously unselected package python-distlib-whl. Preparing to unpack .../python-distlib-whl_0.1.8-1ubuntu1_all.deb ... Unpacking python-distlib-whl (0.1.8-1ubuntu1) ... Selecting previously unselected package python-html5lib. Preparing to unpack .../python-html5lib_0.999-3~ubuntu1_all.deb ... Unpacking python-html5lib (0.999-3~ubuntu1) ... Selecting previously unselected package python-html5lib-whl. Preparing to unpack .../python-html5lib-whl_0.999-3~ubuntu1_all.deb ... Unpacking python-html5lib-whl (0.999-3~ubuntu1) ... Selecting previously unselected package python-six-whl. Preparing to unpack .../python-six-whl_1.5.2-1ubuntu1_all.deb ... Unpacking python-six-whl (1.5.2-1ubuntu1) ... Selecting previously unselected package python-urllib3-whl. Preparing to unpack .../python-urllib3-whl_1.7.1-1ubuntu4_all.deb ... Unpacking python-urllib3-whl (1.7.1-1ubuntu4) ... Selecting previously unselected package python-requests-whl. Preparing to unpack .../python-requests-whl_2.2.1-1ubuntu0.3_all.deb ... Unpacking python-requests-whl (2.2.1-1ubuntu0.3) ... Selecting previously unselected package python-setuptools-whl. Preparing to unpack .../python-setuptools-whl_3.3-1ubuntu2_all.deb ... Unpacking python-setuptools-whl (3.3-1ubuntu2) ... Selecting previously unselected package python-pip-whl. Preparing to unpack .../python-pip-whl_1.5.4-1ubuntu3_all.deb ... Unpacking python-pip-whl (1.5.4-1ubuntu3) ... Selecting previously unselected package python-setuptools. Preparing to unpack .../python-setuptools_3.3-1ubuntu2_all.deb ... Unpacking python-setuptools (3.3-1ubuntu2) ... Selecting previously unselected package python-pip. Preparing to unpack .../python-pip_1.5.4-1ubuntu3_all.deb ... Unpacking python-pip (1.5.4-1ubuntu3) ... Selecting previously unselected package python-virtualenv. Preparing to unpack .../python-virtualenv_1.11.4-1ubuntu1_all.deb ... Unpacking python-virtualenv (1.11.4-1ubuntu1) ... Selecting previously unselected package python-wheel. Preparing to unpack .../python-wheel_0.24.0-1~ubuntu1_all.deb ... Unpacking python-wheel (0.24.0-1~ubuntu1) ... Processing triggers for man-db (2.6.7.1-1ubuntu1) ... Setting up libasan0:amd64 (4.8.4-2ubuntu1~14.04.1) ... Setting up libatomic1:amd64 (4.8.4-2ubuntu1~14.04.1) ... Setting up libgmp10:amd64 (2:5.1.3+dfsg-1ubuntu1) ... Setting up libisl10:amd64 (0.12.2-1) ... Setting up libcloog-isl4:amd64 (0.18.2-1) ... Setting up libgomp1:amd64 (4.8.4-2ubuntu1~14.04.1) ... Setting up libitm1:amd64 (4.8.4-2ubuntu1~14.04.1) ... Setting up libmpfr4:amd64 (3.1.2-1) ... Setting up libquadmath0:amd64 (4.8.4-2ubuntu1~14.04.1) ... Setting up libtsan0:amd64 (4.8.4-2ubuntu1~14.04.1) ... Setting up libmpc3:amd64 (1.0.1-1ubuntu1) ... Setting up binutils (2.24-5ubuntu14) ... Setting up libc-dev-bin (2.19-0ubuntu6.7) ... Setting up linux-libc-dev:amd64 (3.13.0-77.121) ... Setting up libc6-dev:amd64 (2.19-0ubuntu6.7) ... Setting up cpp-4.8 (4.8.4-2ubuntu1~14.04.1) ... Setting up cpp (4:4.8.2-1ubuntu6) ... Setting up libgcc-4.8-dev:amd64 (4.8.4-2ubuntu1~14.04.1) ... Setting up gcc-4.8 (4.8.4-2ubuntu1~14.04.1) ... Setting up gcc (4:4.8.2-1ubuntu6) ... Setting up libstdc++-4.8-dev:amd64 (4.8.4-2ubuntu1~14.04.1) ... Setting up g++-4.8 (4.8.4-2ubuntu1~14.04.1) ... Setting up g++ (4:4.8.2-1ubuntu6) ... update-alternatives: using /usr/bin/g++ to provide /usr/bin/c++ (c++) in auto mode Setting up make (3.81-8.2ubuntu3) ... Setting up libdpkg-perl (1.17.5ubuntu5.5) ... Setting up dpkg-dev (1.17.5ubuntu5.5) ... Setting up build-essential (11.6ubuntu6) ... Setting up libfakeroot:amd64 (1.20-3ubuntu2) ... Setting up fakeroot (1.20-3ubuntu2) ... update-alternatives: using /usr/bin/fakeroot-sysv to provide /usr/bin/fakeroot (fakeroot) in auto mode Setting up libalgorithm-diff-perl (1.19.02-3) ... Setting up libalgorithm-diff-xs-perl (0.04-2build4) ... Setting up libalgorithm-merge-perl (0.08-2) ... Setting up libfile-fcntllock-perl (0.14-2build1) ... Setting up manpages-dev (3.54-1ubuntu1) ... Setting up python3-pkg-resources (3.3-1ubuntu2) ... Setting up python-chardet-whl (2.2.1-2~ubuntu1) ... Setting up python-colorama (0.2.5-0.1ubuntu2) ... Setting up python-colorama-whl (0.2.5-0.1ubuntu2) ... Setting up python-distlib (0.1.8-1ubuntu1) ... Setting up python-distlib-whl (0.1.8-1ubuntu1) ... Setting up python-html5lib (0.999-3~ubuntu1) ... Setting up python-html5lib-whl (0.999-3~ubuntu1) ... Setting up python-six-whl (1.5.2-1ubuntu1) ... Setting up python-urllib3-whl (1.7.1-1ubuntu4) ... Setting up python-requests-whl (2.2.1-1ubuntu0.3) ... Setting up python-setuptools-whl (3.3-1ubuntu2) ... Setting up python-pip-whl (1.5.4-1ubuntu3) ... Setting up python-setuptools (3.3-1ubuntu2) ... Setting up python-pip (1.5.4-1ubuntu3) ... Setting up python-virtualenv (1.11.4-1ubuntu1) ... Setting up python-wheel (0.24.0-1~ubuntu1) ... Processing triggers for libc-bin (2.19-0ubuntu6.7) ... |
Anschließend installieren wir noch git:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | $ apt-get install git Reading package lists... Done Building dependency tree Reading state information... Done The following extra packages will be installed: git-man liberror-perl Suggested packages: git-daemon-run git-daemon-sysvinit git-doc git-el git-email git-gui gitk gitweb git-arch git-bzr git-cvs git-mediawiki git-svn The following NEW packages will be installed: git git-man liberror-perl 0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded. Need to get 3,421 kB of archives. After this operation, 21.9 MB of additional disk space will be used. Do you want to continue? [Y/n] Get:1 http://us.archive.ubuntu.com/ubuntu/ trusty/main liberror-perl all 0.17-1.1 [21.1 kB] Get:2 http://us.archive.ubuntu.com/ubuntu/ trusty-updates/main git-man all 1:1.9.1-1ubuntu0.2 [699 kB] Get:3 http://us.archive.ubuntu.com/ubuntu/ trusty-updates/main git amd64 1:1.9.1-1ubuntu0.2 [2,701 kB] Fetched 3,421 kB in 1s (2,984 kB/s) Selecting previously unselected package liberror-perl. (Reading database ... 94580 files and directories currently installed.) Preparing to unpack .../liberror-perl_0.17-1.1_all.deb ... Unpacking liberror-perl (0.17-1.1) ... Selecting previously unselected package git-man. Preparing to unpack .../git-man_1%3a1.9.1-1ubuntu0.2_all.deb ... Unpacking git-man (1:1.9.1-1ubuntu0.2) ... Selecting previously unselected package git. Preparing to unpack .../git_1%3a1.9.1-1ubuntu0.2_amd64.deb ... Unpacking git (1:1.9.1-1ubuntu0.2) ... Processing triggers for man-db (2.6.7.1-1ubuntu1) ... Setting up liberror-perl (0.17-1.1) ... Setting up git-man (1:1.9.1-1ubuntu0.2) ... Setting up git (1:1.9.1-1ubuntu0.2) ... |
Nun klonen wir den Let’s Encrypt client aus dem Repository:
1 2 3 4 5 6 7 8 9 | $ cd ~ $ git clone https://github.com/letsencrypt/letsencrypt Cloning into 'letsencrypt'... remote: Counting objects: 31740, done. remote: Compressing objects: 100% (43/43), done. remote: Total 31740 (delta 18), reused 0 (delta 0), pack-reused 31697 Receiving objects: 100% (31740/31740), 8.21 MiB | 7.49 MiB/s, done. Resolving deltas: 100% (22497/22497), done. Checking connectivity... done. |
Nachdem wir das Repository geklont haben wechseln wir in das neu angelegt letsencrypt Verzeichnis und rufen das letsencrypt wrapper script zunächst mit dem Argument –help auf. Das wrapper script wird dabei die übrigen Abhängigkeiten auflösen ein python virtual environment erzeugen und uns zum Schluss die Hilfe zum script anteigen.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 | $ cd letsencrypt/ $ ./letsencrypt-auto --help Bootstrapping dependencies for Debian-based OSes... Ign http://us.archive.ubuntu.com trusty InRelease Hit http://security.ubuntu.com trusty-security InRelease Get:1 http://us.archive.ubuntu.com trusty-updates InRelease [65.9 kB] Hit http://security.ubuntu.com trusty-security/main Sources Hit http://security.ubuntu.com trusty-security/restricted Sources Hit http://security.ubuntu.com trusty-security/universe Sources Get:2 http://us.archive.ubuntu.com trusty-backports InRelease [65.9 kB] Hit http://security.ubuntu.com trusty-security/multiverse Sources Hit http://us.archive.ubuntu.com trusty Release.gpg Hit http://security.ubuntu.com trusty-security/main amd64 Packages Get:3 http://us.archive.ubuntu.com trusty-updates/main Sources [260 kB] Hit http://security.ubuntu.com trusty-security/restricted amd64 Packages Hit http://security.ubuntu.com trusty-security/universe amd64 Packages Get:4 http://us.archive.ubuntu.com trusty-updates/restricted Sources [5,352 B] Hit http://security.ubuntu.com trusty-security/multiverse amd64 Packages Get:5 http://us.archive.ubuntu.com trusty-updates/universe Sources [150 kB] Hit http://security.ubuntu.com trusty-security/main i386 Packages Get:6 http://us.archive.ubuntu.com trusty-updates/multiverse Sources [5,547 B] Hit http://security.ubuntu.com trusty-security/restricted i386 Packages Get:7 http://us.archive.ubuntu.com trusty-updates/main amd64 Packages [706 kB] Hit http://security.ubuntu.com trusty-security/universe i386 Packages Hit http://security.ubuntu.com trusty-security/multiverse i386 Packages Get:8 http://us.archive.ubuntu.com trusty-updates/restricted amd64 Packages [15.9 kB] Hit http://security.ubuntu.com trusty-security/main Translation-en Get:9 http://us.archive.ubuntu.com trusty-updates/universe amd64 Packages [338 kB] Hit http://security.ubuntu.com trusty-security/multiverse Translation-en Get:10 http://us.archive.ubuntu.com trusty-updates/multiverse amd64 Packages [13.2 kB] Hit http://security.ubuntu.com trusty-security/restricted Translation-en Get:11 http://us.archive.ubuntu.com trusty-updates/main i386 Packages [684 kB] Hit http://security.ubuntu.com trusty-security/universe Translation-en Get:12 http://us.archive.ubuntu.com trusty-updates/restricted i386 Packages [15.6 kB] Get:13 http://us.archive.ubuntu.com trusty-updates/universe i386 Packages [339 kB] Get:14 http://us.archive.ubuntu.com trusty-updates/multiverse i386 Packages [13.4 kB] Hit http://us.archive.ubuntu.com trusty-updates/main Translation-en Hit http://us.archive.ubuntu.com trusty-updates/multiverse Translation-en Hit http://us.archive.ubuntu.com trusty-updates/restricted Translation-en Hit http://us.archive.ubuntu.com trusty-updates/universe Translation-en Get:15 http://us.archive.ubuntu.com trusty-backports/main Sources [8,672 B] Get:16 http://us.archive.ubuntu.com trusty-backports/restricted Sources [28 B] Get:17 http://us.archive.ubuntu.com trusty-backports/universe Sources [33.2 kB] Get:18 http://us.archive.ubuntu.com trusty-backports/multiverse Sources [1,898 B] Get:19 http://us.archive.ubuntu.com trusty-backports/main amd64 Packages [9,787 B] Get:20 http://us.archive.ubuntu.com trusty-backports/restricted amd64 Packages [28 B] Get:21 http://us.archive.ubuntu.com trusty-backports/universe amd64 Packages [39.8 kB] Get:22 http://us.archive.ubuntu.com trusty-backports/multiverse amd64 Packages [1,571 B] Get:23 http://us.archive.ubuntu.com trusty-backports/main i386 Packages [9,814 B] Get:24 http://us.archive.ubuntu.com trusty-backports/restricted i386 Packages [28 B] Get:25 http://us.archive.ubuntu.com trusty-backports/universe i386 Packages [39.8 kB] Get:26 http://us.archive.ubuntu.com trusty-backports/multiverse i386 Packages [1,552 B] Hit http://us.archive.ubuntu.com trusty-backports/main Translation-en Hit http://us.archive.ubuntu.com trusty-backports/multiverse Translation-en Hit http://us.archive.ubuntu.com trusty-backports/restricted Translation-en Hit http://us.archive.ubuntu.com trusty-backports/universe Translation-en Hit http://us.archive.ubuntu.com trusty Release Hit http://us.archive.ubuntu.com trusty/main Sources Hit http://us.archive.ubuntu.com trusty/restricted Sources Hit http://us.archive.ubuntu.com trusty/universe Sources Hit http://us.archive.ubuntu.com trusty/multiverse Sources Hit http://us.archive.ubuntu.com trusty/main amd64 Packages Hit http://us.archive.ubuntu.com trusty/restricted amd64 Packages Hit http://us.archive.ubuntu.com trusty/universe amd64 Packages Hit http://us.archive.ubuntu.com trusty/multiverse amd64 Packages Hit http://us.archive.ubuntu.com trusty/main i386 Packages Hit http://us.archive.ubuntu.com trusty/restricted i386 Packages Hit http://us.archive.ubuntu.com trusty/universe i386 Packages Hit http://us.archive.ubuntu.com trusty/multiverse i386 Packages Hit http://us.archive.ubuntu.com trusty/main Translation-en Hit http://us.archive.ubuntu.com trusty/multiverse Translation-en Hit http://us.archive.ubuntu.com trusty/restricted Translation-en Hit http://us.archive.ubuntu.com trusty/universe Translation-en Ign http://us.archive.ubuntu.com trusty/main Translation-en_US Ign http://us.archive.ubuntu.com trusty/multiverse Translation-en_US Ign http://us.archive.ubuntu.com trusty/restricted Translation-en_US Ign http://us.archive.ubuntu.com trusty/universe Translation-en_US Fetched 2,823 kB in 8s (335 kB/s) Reading package lists... Done Reading package lists... Done Building dependency tree Reading state information... Done gcc is already the newest version. gcc set to manually installed. python is already the newest version. ca-certificates is already the newest version. python-virtualenv is already the newest version. The following extra packages will be installed: libexpat1-dev libpython-dev libpython2.7-dev python2.7-dev zlib1g-dev Suggested packages: augeas-doc augeas-tools Recommended packages: libssl-doc The following NEW packages will be installed: augeas-lenses dialog libaugeas0 libexpat1-dev libffi-dev libpython-dev libpython2.7-dev libssl-dev python-dev python2.7-dev zlib1g-dev 0 upgraded, 11 newly installed, 0 to remove and 0 not upgraded. Need to get 24.4 MB of archives. After this operation, 45.2 MB of additional disk space will be used. Get:1 http://us.archive.ubuntu.com/ubuntu/ trusty-updates/main libexpat1-dev amd64 2.1.0-4ubuntu1.1 [115 kB] Get:2 http://us.archive.ubuntu.com/ubuntu/ trusty-updates/main libpython2.7-dev amd64 2.7.6-8ubuntu0.2 [22.0 MB] Get:3 http://us.archive.ubuntu.com/ubuntu/ trusty-updates/main augeas-lenses all 1.2.0-0ubuntu1.1 [230 kB] Get:4 http://us.archive.ubuntu.com/ubuntu/ trusty/main dialog amd64 1.2-20130928-1 [300 kB] Get:5 http://us.archive.ubuntu.com/ubuntu/ trusty-updates/main libaugeas0 amd64 1.2.0-0ubuntu1.1 [135 kB] Get:6 http://us.archive.ubuntu.com/ubuntu/ trusty/main libpython-dev amd64 2.7.5-5ubuntu3 [7,078 B] Get:7 http://us.archive.ubuntu.com/ubuntu/ trusty/main zlib1g-dev amd64 1:1.2.8.dfsg-1ubuntu1 [183 kB] Get:8 http://us.archive.ubuntu.com/ubuntu/ trusty-updates/main libssl-dev amd64 1.0.1f-1ubuntu2.16 [1,072 kB] Get:9 http://us.archive.ubuntu.com/ubuntu/ trusty-updates/main python2.7-dev amd64 2.7.6-8ubuntu0.2 [269 kB] Get:10 http://us.archive.ubuntu.com/ubuntu/ trusty/main python-dev amd64 2.7.5-5ubuntu3 [1,166 B] Get:11 http://us.archive.ubuntu.com/ubuntu/ trusty-updates/main libffi-dev amd64 3.1~rc1+r3.0.13-12ubuntu0.1 [99.8 kB] Fetched 24.4 MB in 3s (6,962 kB/s) Selecting previously unselected package libexpat1-dev:amd64. (Reading database ... 95328 files and directories currently installed.) Preparing to unpack .../libexpat1-dev_2.1.0-4ubuntu1.1_amd64.deb ... Unpacking libexpat1-dev:amd64 (2.1.0-4ubuntu1.1) ... Selecting previously unselected package libpython2.7-dev:amd64. Preparing to unpack .../libpython2.7-dev_2.7.6-8ubuntu0.2_amd64.deb ... Unpacking libpython2.7-dev:amd64 (2.7.6-8ubuntu0.2) ... Selecting previously unselected package augeas-lenses. Preparing to unpack .../augeas-lenses_1.2.0-0ubuntu1.1_all.deb ... Unpacking augeas-lenses (1.2.0-0ubuntu1.1) ... Selecting previously unselected package dialog. Preparing to unpack .../dialog_1.2-20130928-1_amd64.deb ... Unpacking dialog (1.2-20130928-1) ... Selecting previously unselected package libaugeas0. Preparing to unpack .../libaugeas0_1.2.0-0ubuntu1.1_amd64.deb ... Unpacking libaugeas0 (1.2.0-0ubuntu1.1) ... Selecting previously unselected package libpython-dev:amd64. Preparing to unpack .../libpython-dev_2.7.5-5ubuntu3_amd64.deb ... Unpacking libpython-dev:amd64 (2.7.5-5ubuntu3) ... Selecting previously unselected package zlib1g-dev:amd64. Preparing to unpack .../zlib1g-dev_1%3a1.2.8.dfsg-1ubuntu1_amd64.deb ... Unpacking zlib1g-dev:amd64 (1:1.2.8.dfsg-1ubuntu1) ... Selecting previously unselected package libssl-dev:amd64. Preparing to unpack .../libssl-dev_1.0.1f-1ubuntu2.16_amd64.deb ... Unpacking libssl-dev:amd64 (1.0.1f-1ubuntu2.16) ... Selecting previously unselected package python2.7-dev. Preparing to unpack .../python2.7-dev_2.7.6-8ubuntu0.2_amd64.deb ... Unpacking python2.7-dev (2.7.6-8ubuntu0.2) ... Selecting previously unselected package python-dev. Preparing to unpack .../python-dev_2.7.5-5ubuntu3_amd64.deb ... Unpacking python-dev (2.7.5-5ubuntu3) ... Selecting previously unselected package libffi-dev:amd64. Preparing to unpack .../libffi-dev_3.1~rc1+r3.0.13-12ubuntu0.1_amd64.deb ... Unpacking libffi-dev:amd64 (3.1~rc1+r3.0.13-12ubuntu0.1) ... Processing triggers for man-db (2.6.7.1-1ubuntu1) ... Processing triggers for install-info (5.2.0.dfsg.1-2) ... Setting up libexpat1-dev:amd64 (2.1.0-4ubuntu1.1) ... Setting up libpython2.7-dev:amd64 (2.7.6-8ubuntu0.2) ... Setting up augeas-lenses (1.2.0-0ubuntu1.1) ... Setting up dialog (1.2-20130928-1) ... Setting up libaugeas0 (1.2.0-0ubuntu1.1) ... Setting up libpython-dev:amd64 (2.7.5-5ubuntu3) ... Setting up zlib1g-dev:amd64 (1:1.2.8.dfsg-1ubuntu1) ... Setting up libssl-dev:amd64 (1.0.1f-1ubuntu2.16) ... Setting up python2.7-dev (2.7.6-8ubuntu0.2) ... Setting up python-dev (2.7.5-5ubuntu3) ... Setting up libffi-dev:amd64 (3.1~rc1+r3.0.13-12ubuntu0.1) ... Processing triggers for libc-bin (2.19-0ubuntu6.7) ... Checking for new version... Upgrading letsencrypt-auto 0.5.0.dev0 to 0.4.0... Replacing letsencrypt-auto... cp /tmp/tmp.PnmHcUMbws/letsencrypt-auto ./letsencrypt-auto Creating virtual environment... Installing Python packages... Requesting root privileges to run letsencrypt... /root/.local/share/letsencrypt/bin/letsencrypt --no-self-upgrade --help letsencrypt-auto [SUBCOMMAND] [options] [-d domain] [-d domain] ... The Let's Encrypt agent can obtain and install HTTPS/TLS/SSL certificates. By default, it will attempt to use a webserver both for obtaining and installing the cert. Major SUBCOMMANDS are: (default) run Obtain & install a cert in your current webserver certonly Obtain cert, but do not install it (aka "auth") install Install a previously obtained cert in a server renew Renew previously obtained certs that are near expiry revoke Revoke a previously obtained certificate rollback Rollback server configuration changes made during install config_changes Show changes made to server config during installation plugins Display information about installed plugins Choice of server plugins for obtaining and installing cert: --apache Use the Apache plugin for authentication & installation --standalone Run a standalone webserver for authentication (nginx support is experimental, buggy, and not installed by default) --webroot Place files in a server's webroot folder for authentication OR use different plugins to obtain (authenticate) the cert and then install it: --authenticator standalone --installer apache More detailed help: -h, --help [topic] print this message, or detailed help on a topic; the available topics are: all, automation, paths, security, testing, or any of the subcommands or plugins (certonly, install, nginx, apache, standalone, webroot, etc) |
Nun können wir bereits ein Zertifikat beantragen:
1 | $ ./letsencrypt-auto --apache -d mysubdomain.mydomain.tld |
Dabei sind mysubdomain, mydomain und tld entsprechend unserer gewählten Domäne zu ersetzen. Das Script startet eine einfache ncurses GUI, zunächst müssen wir für die Erstellung eines Accounts bei Let’S Encrypt unsere E-Mail-Adresse eingeben:
Nachdem wir ein E-Mail-Adresse eingegeben und die Return-Taste gedrückt haben, kommen wir zur nächsten Seite.
Hier müssen wir durch drücken der Return-Taste bestätigen, dass wir mit den Bedingungen einverstanden sind. Danach sehen wir die folgende Seite:
Wir übernehmen hier die default Einstellung Easy und drücken die Return-Taste. Damit ist die Erstellung der Zertifikate und die erste Konfiguration beendet.
Später werden wir uns noch dem Hinweis zum Testen unserer Konfiguration auf der Qualys SSL Labs Seite zuwenden.
Das letsencrypt wrapper script gibt uns zum Abschluss noch ein paar Hinweise:
1 2 3 4 5 6 7 8 9 10 11 12 | IMPORTANT NOTES: - If you lose your account credentials, you can recover through e-mails sent to whoever@whereever.de. - Congratulations! Your certificate and chain have been saved at /etc/letsencrypt/live/mysubdomain.mydomain.tld/fullchain.pem. Your cert will expire on 2016-05-22. To obtain a new version of the certificate in the future, simply run Let's Encrypt again. - Your account credentials have been saved in your Let's Encrypt configuration directory at /etc/letsencrypt. You should make a secure backup of this folder now. This configuration directory will also contain certificates and private keys obtained by Let's Encrypt so making regular backups of this folder is ideal. |
Den Hinweis zum Backup nehmen wir ernst und nehmen das Let’s Encrypt Konfigurationsverzeichniss in unsere Backupkonfiguration mit auf und führen ein Backup durch.
1 2 3 4 5 | $ cd /opt/1UND1EU/bin $ ./ClientTool control.selection.modify -datasource FileSystem -include /etc/letsencrypt Backup selection successfully modified. $ ./ClientTool control.backup.start -datasource FileSystem Starting backup for FileSystem datasource. |
Jetzt wollen wir noch eine permanente Weiterleitung unserer HTTP Seite auf die HTTPS Seite einrichten. Hierzu brauchen wir das Apache Module Rewrite. Die folgenden Befehle zeigen, dass das Modul zur Verfügung steht aber nicht aktiviert ist.
1 2 3 | $ ls /etc/apache2/mods-available/ | grep rewrite rewrite.load $ ls /etc/apache2/mods-enabled/ | grep rewrite |
Wir aktivieren das Rewrite Modul mit dem folgenden Kommando:
1 2 3 4 | $ a2enmod rewrite Enabling module rewrite. To activate the new configuration, you need to run: service apache2 restart |
Bevor wir den Apache restarten tragen wir in unserer Konfiguration für die Default HTTP Seite die Weiterleitung ein. Dazu tragen wir in der Datei /etc/apache2/sites-available/000-default.conf hinter der Zeile
1 | DocumentRoot /var/www/html |
die folgenden Zeilen ein:
1 2 3 | RewriteEngine On RewriteCond %{HTTPS} off RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L] |
Nun müssen wir den Apache noch restarten:
1 2 | $ service apache2 restart * Restarting web server apache2 |
Nun starten wir unseren Webbrowser, ich benutze Mozilla Firefox, und geben unsere URL mit http:// prefix in die Adresszeile ein. Die folgende Abbildung zeigt uns unsere Default Seite im Browser.
In der Adresszeile sehen wir zwei Dinge. Erstens, statt http:// prefix steht dort jetzt https://, d.h. die Umleitung funktioniert. Zweitens, Vor der URL wird nun ein Schlosssymbol angezeigt allerdings mit einem gelben Warndreieck. Wenn wir darauf klicken, erhalten wir die folgende Erläuterung:
Wenn wir uns die html Datei /var/www/html/index.html für die Seite anschauen, sehen wir dass der Verursacher tatsächlich eine Grafik ist. In der fünftletzten Zeile der Datei werden das Icon und der zugehörige Link des XHTML 1.0 Validators gesetzt:
1 | <a href="http://validator.w3.org/check?uri=referer"><img src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0 Transitional" width="88" height="31" /></a> |
Wir ändern diese Zeile und tragen für Link und Icon jeweils die https URL ein:
1 | <a href="https://validator.w3.org/check?uri=referer"><img src="https://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0 Transitional" width="88" height="31" /></a> |
Wenn wir nun unsere Webpage im Browser neu laden sehen wir, dass in der Adresszeile vor der URL nun ein grünes Schlosssymbol abgebildet ist.
Wenn wir auf das grüne Schlosssymbol klicken erhalten wir die folgende Information:
Wenn wir dort auf das > Symbol klicken, wird uns der folgende Dialog angezeigt:
Unser Zertifikat ist, wie nicht anders zu erwarten, von Let’s Encrypt verifiziert. Klicken auf den Button Weitere Infomationen startet schliesslich den folgenden Dialog:
Hier können wir uns nun auch Details des Zertifikats ansehen:
Auf dem Details Tab sind noch weitere Details zu sehen, die wir uns hier jetzt nicht anschauen.
Zum Abschluss wollen wir noch das Apache Konfigurationverzeichniss in unser Backup mitaufnehmen. Wir ergänzen das Konfigurationverzeichnis in der Backup Selection List und starten ein Backup:
1 2 3 4 5 | $ cd /opt/1UND1EU/bin/ $ ./ClientTool control.selection.modify -datasource FileSystem -include /etc/apache2 Backup selection successfully modified. $ ./ClientTool control.backup.start -datasource FileSystem Starting backup for FileSystem datasource. |
Im 4. Teil der Artikelserie wollen wir uns noch ein wenig mit den Sicherheitseinstellungen unseres Apache servers und der Konfiguration des Let’s Encrypt Clients beschäftigen und eine automatische Erneuerung unserer Zertifikate einrichten.