Hallo Nobbie,
erst mal tausend Dank für diese ausführliche Erläuterung und Geduld.
Ich bin vermutlich ein Stück weiter aber noch nicht bei der Lösung. Vielleicht kannst Du mir ja noch mal unter die Arme greifen, wäre toll, danke!
Erstmal zum Hintergrund:Ich möchte auf dem Server mehrere Anwendungen laufen lassen. Ggf. will ich die später auch mal auf mehrere Server im LAN aufteilen.
Wichtig ist mir wegen der Sicherheit, nach außen möglichst nur einen Port, den 443 für alle Anwendungen zu öffnen. Höchstens noch einen individuellen SSH-Port sowie einen Port für ausgehende Mails (Logging, etc.).
PortfreischaltungAktuell habe ich in der FritzBox und im Kabel-Modem (davor) folgende Ports freigeschaltet und entsprechend weitergeleitet:
22, 80, 443, 587, 10000
Installation der AnwendungenIch habe jetzt erst mal alle Anwendungen zum Laufen gebracht, konkret:
Webmin
Nextcloud
phpMyAdmin
Zusätzlich habe ich mir im Verzeichnis /var/www/html/ noch die Dateien index.html (Apache2 Debian Default Page) und info.php (PHP Info Seite) angelegt. Eher für Testzwecke und weil es wenig Aufwand ist.
Neben der Port 80 Konfiguration habe ich auch eine Port 443 Konfiguration mit Zertifikaten von letsencrypt hergestellt und natürlich den Sever über DynDNS erreichbar gemacht, da er an einem privaten Anschluss mit dynamischer IP hängt.
Die aus meiner Sicht relevanten Verzeichnisse sehen derzeit wie folgt aus:
- Code: Select all
root@raspi3-2:/var/www/html# ls
index.html info.php nextcloud
- Code: Select all
root@raspi3-2:/etc/apache2/sites-available# ls
000-default.conf 000-default-le-ssl.conf default-ssl.conf
root@raspi3-2:/etc/apache2/sites-available# nano 000-default.conf
- Code: Select all
<VirtualHost *:80>
ServerName jmrberlin.ddnss.eu
ServerAlias www.jmrberlin.ddnss.eu
ServerAdmin root@localhost
DocumentRoot /var/www/html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
#RewriteEngine on
#RewriteCond %{SERVER_NAME} =jmrberlin.ddnss.eu [OR]
#RewriteCond %{SERVER_NAME} =www.jmrberlin.ddnss.eu
#RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,QSA,R=permanent]
</VirtualHost>
Anmerkung: Die Rewrite* Kommandos will ich später auskommentieren, um immer SSL zu erzwingen.
root@raspi3-2:/etc/apache2/sites-available# nano 000-default-le-ssl.conf
- Code: Select all
<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerName jmrberlin.ddnss.eu
ServerAlias www.jmrberlin.ddnss.eu
ServerAdmin root@localhost
DocumentRoot /var/www/html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
SSLCertificateFile /etc/letsencrypt/live/jmrberlin.ddnss.eu/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/jmrberlin.ddnss.eu/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
</VirtualHost>
</IfModule>
Test der AnwendungenÜber folgende URL´s waren die drei Anwendungen sowie die index.html und die info.php erreichbar:
Webmin: https://jmrberlin.ddnss.eu:10000 und https://192.168.178.50/nextcloud (http lässt Webmin als Anwendung nicht zu, normal)
Nextcloud: http://jmrberlin.ddnss.eu/nextcloud/ und https://jmrberlin.ddnss.eu/nextcloud/ und http://192.168.178.50/nextcloud
phpMyAdmin: http://jmrberlin.ddnss.eu/phpmyadmin/ und https://jmrberlin.ddnss.eu/phpmyadmin/ und http://192.168.178.50/phpmyadmin
index.html: http://jmrberlin.ddnss.eu/index.html und https://jmrberlin.ddnss.eu/index.html und http://192.168.178.50/index.html
info.php: http://jmrberlin.ddnss.eu/info.php und https://jmrberlin.ddnss.eu/info.php und http://192.168.178.50/info.php
Ergebnis: LäuftAnpassung der KonfigurationJetzt habe ich die beiden *.conf-Dateien in /etc/apache2/sites-available editiert, auf Grundlage Deiner Hilfe, also wie folgt:
root@raspi3-2:/etc/apache2/sites-available# nano 000-default.conf
- Code: Select all
<VirtualHost *:80>
ServerName jmrberlin.ddnss.eu
ServerAlias www.jmrberlin.ddnss.eu
ServerAdmin root@localhost
DocumentRoot /var/www/html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
#RewriteEngine on
#RewriteCond %{SERVER_NAME} =jmrberlin.ddnss.eu [OR]
#RewriteCond %{SERVER_NAME} =www.jmrberlin.ddnss.eu
#RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,QSA,R=permanent]
ProxyPass /nextcloud/ http://192.168.178.50/nextcloud/
ProxyPassReverse /nextcloud/ http://192.168.178.50/nextcloud/
ProxyPass /phpmyadmin/ http://192.168.178.50/phpmyadmin/
ProxyPassReverse /phpmyadmin/ http://192.168.178.50/phpmyadmin/
ProxyPass /webmin/ http://192.168.178.50:10000/webmin/
ProxyPassReverse /webmin/ http://192.168.178.50:10000/webmin/
</VirtualHost>
root@raspi3-2:/etc/apache2/sites-available# nano 000-default-le-ssl.conf
- Code: Select all
<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerName jmrberlin.ddnss.eu
ServerAlias www.jmrberlin.ddnss.eu
ServerAdmin root@localhost
DocumentRoot /var/www/html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
SSLCertificateFile /etc/letsencrypt/live/jmrberlin.ddnss.eu/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/jmrberlin.ddnss.eu/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
ProxyPass /nextcloud/ https://192.168.178.50/nextcloud/
ProxyPassReverse /nextcloud/ https://192.168.178.50/nextcloud/
ProxyPass /phpmyadmin/ https://192.168.178.50/phpmyadmin/
ProxyPassReverse /phpmyadmin/ https://192.168.178.50/phpmyadmin/
ProxyPass /webmin/ https://192.168.178.50:10000/webmin/
ProxyPassReverse /webmin/ https://192.168.178.50:10000/webmin/
</VirtualHost>
</IfModule>
Test der neuen KonfigurationAnschließend Konfiguration getestet:
- Code: Select all
root@raspi3-2:/etc/apache2/sites-available# apache2 -configtest
[Thu May 10 23:54:35.058566 2018] [core:warn] [pid 4728] AH00111: Config variable ${APACHE_RUN_DIR} is not defined
apache2: Syntax error on line 80 of /etc/apache2/apache2.conf: DefaultRuntimeDir must be a valid directory, absolute or relative to ServerRoot
Anmerkung: Diesen Fehler kriege ich leider auch nicht in den Griff aber laut meiner Web-Recherche kann man den vernachlässigen.
Und natürlich den Apache neu gestartet:
- Code: Select all
root@raspi3-2:/etc/apache2/sites-available# systemctl restart apache2
Noch mal den Status geprüft:
- Code: Select all
root@raspi3-2:/etc/apache2/sites-available# systemctl status apache2
Grüner Punkt, Active: active (running)
Nun erneuter Test der Anwendungen in neuer Konfiguration:Webmin:
KEIN ZUGRIFF: https://jmrberlin.ddnss.eu/webmin/ und https://192.168.178.50/webmin/ (http lässt Webmin als Anwendung nicht zu, normal)
ZUGRIFF: https://jmr.ddnss.eu:10000/
ZUGRIFF: https://192.168.178.50:10000/
Nextcloud:
KEIN ZUGRIFF: http://jmrberlin.ddnss.eu/nextcloud/ und https://jmrberlin.ddnss.eu/nextcloud/ und http://192.168.178.50/nextcloud
phpMyAdmin:
KEIN ZUGRIFF: http://jmrberlin.ddnss.eu/phpmyadmin/ und https://jmrberlin.ddnss.eu/phpmyadmin/ und http://192.168.178.50/phpmyadmin
index.html:
KEIN ZUGRIFF: http://jmrberlin.ddnss.eu/index.html und https://jmrberlin.ddnss.eu/index.html und http://192.168.178.50/index.html
info.php:
KEIN ZUGRIFF: http://jmrberlin.ddnss.eu/info.php und https://jmrberlin.ddnss.eu/info.php und http://192.168.178.50/info.php
Fehlermeldungen:
500 Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
oder
ERR_TIMED_OUT
Hoffe, diese Details helfen etwas, mein Problem konkreter nachzuvollziehen.
Herzlichen Dank vorab für Hilfe!
Viele Grüße
Jörg
P.S.:
Domain-Name und IP-Adresse über Suchen/Ersetzen aus Gründen der Sicherheit verändert.