Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revisionBoth sides next revision | ||
debian:proxy-server-debian:start [2017/03/16 11:00] – [Reverse Proxy Installation auf Debian / Ubuntu] michael | debian:proxy-server-debian:start [2017/09/19 15:26] – [Zusätzliche Konfigurationen] michael | ||
---|---|---|---|
Line 2: | Line 2: | ||
Als Grundlage für den Reverse Proxy wurde ein **Ubuntu 16.04** aufgesetzt. Im folgenden werden alle Schritte nach der fertigen OS Installation zum einrichten des Proxys beschrieben. | Als Grundlage für den Reverse Proxy wurde ein **Ubuntu 16.04** aufgesetzt. Im folgenden werden alle Schritte nach der fertigen OS Installation zum einrichten des Proxys beschrieben. | ||
- | **Was ist ein Reverse Proxy?** // | + | **Was ist ein Reverse Proxy?** // |
// | // | ||
+ | |||
<WRAP center round tip 70%> | <WRAP center round tip 70%> | ||
- | Eine ausführlichere Beschreibung hier: [[knowhow: | + | '' |
</ | </ | ||
- | **[[http:// | + | **[[http:// |
---- | ---- | ||
Line 21: | Line 22: | ||
</ | </ | ||
- | <WRAP center round box 100%> | + | <sxh bash; first-line: 1> |
- | < | + | |
# This file describes the network interfaces available on your system | # This file describes the network interfaces available on your system | ||
# and how to activate them. For more information, | # and how to activate them. For more information, | ||
Line 38: | Line 38: | ||
dns-nameservers 192.168.1.1 | dns-nameservers 192.168.1.1 | ||
- | </file> | + | </sxh> |
- | </WRAP> | + | |
Nach erfolgreicher Speicherung, | Nach erfolgreicher Speicherung, | ||
Line 47: | Line 46: | ||
---- | ---- | ||
- | |||
- | FIXME | ||
===== Installation der Grundkomponenten ===== | ===== Installation der Grundkomponenten ===== | ||
- | Zu Beginn werden erst einmal alle Grundpakete, | + | Zu Beginn werden erst einmal alle Grundpakete, |
< | < | ||
+ | UBUNTU 14.04: | ||
# apt-get install apache2 libapache2-mod-proxy-html libxml2-dev | # apt-get install apache2 libapache2-mod-proxy-html libxml2-dev | ||
+ | |||
+ | UBUNTU 16.04: | ||
+ | # apt-get install apache2 libxml2-dev | ||
</ | </ | ||
Aktivierung der Proxy Komponenten aus dem Apache2 Paket. | Aktivierung der Proxy Komponenten aus dem Apache2 Paket. | ||
< | < | ||
- | # a2enmod proxy proxy_ajp proxy_http rewrite deflate headers proxy_balancer proxy_connect proxy_html xml2enc vhost_alias ssl | + | # a2enmod proxy proxy_ajp proxy_http |
</ | </ | ||
Line 92: | Line 93: | ||
Nun werden alle nachfolgenden Virtual-Host-files, | Nun werden alle nachfolgenden Virtual-Host-files, | ||
- | <wrap em>// | + | <wrap em>// |
- | <file nsis blackgate.org.conf> | ||
+ | === blackgate.org.conf === | ||
+ | |||
+ | < | ||
+ | # vim / | ||
+ | </ | ||
+ | |||
+ | <sxh bash; first-line: 1> | ||
< | < | ||
# ServerName blackgate.org | # ServerName blackgate.org | ||
Line 101: | Line 108: | ||
# | # | ||
| | ||
- | | + | |
# | # | ||
</ | </ | ||
+ | </ | ||
- | </ | + | === proxy_http.conf === |
+ | < | ||
+ | # vim / | ||
+ | </ | ||
- | <file nsis proxy_http.conf> | + | <sxh bash; first-line: 1> |
# | # | ||
# | # | ||
Line 145: | Line 155: | ||
| | ||
- | | + | |
- | | + | |
| | ||
Line 198: | Line 207: | ||
</ | </ | ||
- | </file> | + | </sxh> |
- | <file nsis proxy_https_blackgate.conf> | + | === proxy_https_blackgate.conf === |
+ | |||
+ | <code> | ||
+ | # vim / | ||
+ | </ | ||
+ | |||
+ | <sxh bash; first-line: 1> | ||
< | < | ||
Line 240: | Line 255: | ||
< | < | ||
- | ServerName su-login.blackgate.org | + | ServerName su-login.blackgate.org |
- | # | + | |
| | ||
| | ||
Line 250: | Line 265: | ||
| | ||
| | ||
- | | + | |
- | | + | |
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | | ||
+ | | ||
| | ||
+ | |||
< | < | ||
Order deny,allow | Order deny,allow | ||
- | | + | Allow from all |
</ | </ | ||
</ | </ | ||
Line 612: | Line 636: | ||
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet | # vim: syntax=apache ts=4 sw=4 sts=4 sr noet | ||
- | </file> | + | </sxh> |
+ | |||
+ | |||
+ | |||
+ | === proxy_https_plexdash.conf === | ||
+ | |||
+ | < | ||
+ | # vim proxy_https_plexdash.conf | ||
+ | </code> | ||
- | <file nsis proxy_https_plexdash.conf> | + | <sxh bash; first-line: 1> |
# | # | ||
Line 661: | Line 693: | ||
| | ||
| | ||
- | | + | |
- | | + | |
+ | |||
+ | < | ||
+ | Order deny, | ||
+ | Allow from all | ||
+ | </ | ||
+ | < | ||
+ | Order deny, | ||
+ | Allow from all | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | | ||
+ | # | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | | ||
+ | | ||
+ | |||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
< | < | ||
Line 698: | Line 760: | ||
</ | </ | ||
- | </file> | + | </sxh> |
+ | |||
+ | |||
+ | |||
+ | |||
+ | === letsencript_dummy.conf === | ||
+ | |||
+ | < | ||
+ | # vim / | ||
+ | </code> | ||
- | <file nsis letsencript_dummy.conf> | + | <sxh bash; first-line: 1> |
< | < | ||
Line 731: | Line 802: | ||
</ | </ | ||
- | </file> | + | </sxh> |
---- | ---- | ||
Line 742: | Line 813: | ||
< | < | ||
# a2ensite letsencript_dummy.conf | # a2ensite letsencript_dummy.conf | ||
+ | # service apache2 reload | ||
</ | </ | ||
</ | </ | ||
Line 754: | Line 826: | ||
< | < | ||
- | # ./ | + | # ./ |
</ | </ | ||
Line 761: | Line 834: | ||
==== Automatisiertes Key Update ==== | ==== Automatisiertes Key Update ==== | ||
- | Da das Letsencript Zertifikat nur eine Gültigkeit von drei Wochen hat, wird hier eine automatische Aktualisierung des Zertifikates empfohlen. Dies wird über einen neuen Crontab | + | Da das Letsencript Zertifikat nur eine Gültigkeit von drei Wochen hat, wird hier eine automatische Aktualisierung des Zertifikates empfohlen. Dies wird bei mir über einen crontab |
< | < | ||
Line 767: | Line 840: | ||
</ | </ | ||
- | <WRAP center round box 100%> | + | <sxh bash; first-line: 1> |
- | <code> | + | |
# / | # / | ||
# Unlike any other crontab you don't have to run the `crontab' | # Unlike any other crontab you don't have to run the `crontab' | ||
Line 783: | Line 855: | ||
47 6 * * 7 root test -x / | 47 6 * * 7 root test -x / | ||
52 6 1 * * root test -x / | 52 6 1 * * root test -x / | ||
+ | |||
0 12 * * 6 | 0 12 * * 6 | ||
# | # | ||
- | </code> | + | </sxh> |
- | </WRAP> | + | |
Line 806: | Line 878: | ||
< | < | ||
# service apache2 reload | # service apache2 reload | ||
+ | # rm / | ||
</ | </ | ||
Line 816: | Line 889: | ||
Alle hier gemachten Konfigurationsänderungen, | Alle hier gemachten Konfigurationsänderungen, | ||
+ | <WRAP center round box 100%> | ||
==== Härten des Apache-Proxys | ==== Härten des Apache-Proxys | ||
Zum härten des Apache2 Webservers werden wir nun die security.conf Konfigurationsdatei folgendermassen anpassen: | Zum härten des Apache2 Webservers werden wir nun die security.conf Konfigurationsdatei folgendermassen anpassen: | ||
Line 823: | Line 897: | ||
</ | </ | ||
- | <file nsis security.conf> | + | <sxh bash; first-line: 1> |
# ServerTokens | # ServerTokens | ||
ServerTokens Prod | ServerTokens Prod | ||
Line 838: | Line 912: | ||
Header set X-Frame-Options: | Header set X-Frame-Options: | ||
- | </file> | + | </sxh> |
< | < | ||
Line 844: | Line 918: | ||
</ | </ | ||
+ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | <WRAP center round box 100%> | ||
==== Eigene ErrorPages definieren ==== | ==== Eigene ErrorPages definieren ==== | ||
- | Um eigene ErrorPages unter einem Apache Reverse Proxy einzubinden muss **folgendes snipped** in der Hauptkonfigurationsdatei von Apache2 //nach dem **letzten** </ | + | Um eigene ErrorPages unter einem Apache Reverse Proxy einzubinden muss **folgendes snipped** in der Hauptkonfigurationsdatei von Apache2 //nach dem letzten </ |
<file ini snippet> | <file ini snippet> | ||
Line 862: | Line 941: | ||
</ | </ | ||
- | Nach dem speichern, werden anschliessend die besagten ErrorDocs //(Gleiche Namensgebung wie oben; z.B: **BadRequest.html**)// **nach / | + | Nach dem speichern, werden anschliessend die besagten ErrorDocs //(Gleiche Namensgebung wie oben; z.B: BadRequest.html)// |
<WRAP center round download 60%> | <WRAP center round download 60%> | ||
Line 878: | Line 957: | ||
# service apache2 reload | # service apache2 reload | ||
</ | </ | ||
+ | </ | ||
+ | |||
---- | ---- | ||
+ | <WRAP center round box 100%> | ||
==== Zusätzliche Sub-Domains hinzufügen ==== | ==== Zusätzliche Sub-Domains hinzufügen ==== | ||
- | Sollen weitere | + | Sollen weitere |
- Anpassen der proxy-sites und neuer Sub-Domain Namen erfassen. < | - Anpassen der proxy-sites und neuer Sub-Domain Namen erfassen. < | ||
Line 888: | Line 970: | ||
# vim / | # vim / | ||
</ | </ | ||
- | - Zum letsencript Binary wechseln und den letzten certonly Befehl //(Suchen mit CTRL + R)// mit der am Schluss neu angehängter Domain z.B. "**-d NEU-DOM.DOMAIN.COM**" | + | - Zum letsencript Binary wechseln und den letzten certonly Befehl //(Suchen mit CTRL + R)// mit der am Schluss neu angehängter Domain z.B. "**-d NEU-SUBDOM.DOMAIN.COM**" |
# cd / | # cd / | ||
# ./ | # ./ | ||
Line 896: | Line 978: | ||
</ | </ | ||
+ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | <WRAP center round box 100%> | ||
+ | ==== Setzen der korrekten Timezone | ||
+ | - Die aktuelle Konfiguration kann mit **'' | ||
+ | # timedatectl | ||
+ | </ | ||
+ | Local time: Sun 2017-04-23 07:56:23 UTC | ||
+ | Universal time: Sun 2017-04-23 07:56:23 UTC | ||
+ | RTC time: Sun 2017-04-23 07:56:25 | ||
+ | Time zone: Etc/UTC (UTC, +0000) | ||
+ | | ||
+ | NTP synchronized: | ||
+ | RTC in local TZ: no | ||
+ | </ | ||
+ | - Auflisten aller verfügbaren Timezones.. < | ||
+ | # timedatectl list-timezones | ||
+ | </ | ||
+ | Africa/ | ||
+ | Africa/ | ||
+ | Africa/ | ||
+ | Africa/ | ||
+ | Africa/ | ||
+ | Africa/ | ||
+ | Africa/ | ||
+ | Africa/ | ||
+ | ... | ||
+ | </ | ||
+ | - **Setzen der neuen,** <wrap em> | ||
+ | # timedatectl set-timezone Europe/ | ||
+ | </ | ||
+ | Local time: Sun 2017-04-23 09:57:37 CEST | ||
+ | Universal time: Sun 2017-04-23 07:57:37 UTC | ||
+ | RTC time: Sun 2017-04-23 07:57:39 | ||
+ | Time zone: Europe/ | ||
+ | | ||
+ | NTP synchronized: | ||
+ | RTC in local TZ: no | ||
+ | </ | ||
+ | |||
+ | </ | ||
+ | |||
+ | |||
+ | ---- | ||
+ | |||
+ | ==== WakeOnLAN über Proxy automatisieren ==== | ||
+ | |||
+ | < | ||
+ | # apt-get update | ||
+ | # apt-get install etherwake | ||
+ | </ | ||
+ | |||
+ | Anschliessend, | ||
+ | |||
+ | < | ||
+ | # vim / | ||
+ | </ | ||
+ | |||
+ | <sxh bash; first-line: 1> | ||
+ | # / | ||
+ | # Unlike any other crontab you don't have to run the `crontab' | ||
+ | # command to install the new version when you edit this file | ||
+ | # and files in / | ||
+ | # that none of the other crontabs do. | ||
+ | |||
+ | SHELL=/ | ||
+ | PATH=/ | ||
+ | |||
+ | # m h dom mon dow user command | ||
+ | 17 * * * * | ||
+ | 25 6 * * * | ||
+ | 47 6 * * 7 | ||
+ | 52 6 1 * * | ||
+ | # | ||
+ | 0 12 * * 6 | ||
+ | |||
+ | 0 7 * * 1-5 | ||
+ | 0 9 * * 6-7 | ||
+ | |||
+ | #0 3 * * * | ||
+ | # | ||
+ | </ |