Probleme mit Apache2/ReverseProxy auf Ubuntu Server (xenial)

Begonnen von Tedious, 03 Januar 2017, 15:55:54

Vorheriges Thema - Nächstes Thema

Tedious

Hallo zusammen,

bei mir ist FHEM auf einen BRIX umgezogen, da der RPI performancetechnisch recht räge wurde (viele Devices), und ich die MySQL denn aus Performancegründen auch nicht mehr im Netzwerk laufen lassen muss. Es gab ein paar Klippen zu umschiffen (z.B. BT-Treiber für Presence, etc.), aber alles in allem läuft er jetzt soweit stabil und sauber. Allerdings wollte ich ihn per ReverseProxy wieder von extern erreichbar machen, aber hier scheint sich doch einiges geändert zu haben. Prinzipiell bin ich nach der Doku im Wiki vorgegangen, nur noch 8083 hat ein global Attribut (für internen Zugriff), 8085 soll extern erreichbar sein. Im Zuge dessen, als Info - weil ich mir die Finger wund gesucht habe - libapache2-mod-proxy-html gibts nicht mehr als Paket, ist schon integriert...

Apache ist installiert und läuft, Port 80 liefert die Startseite, soweit alles gut.

Der ReverseProxy hingegen liefert nur Müll und zeigt lapidar im Browser:

ï+Ù¸}µ9 úT Üy¿©ÒyDÎûüï™L7ÕðÖ ã¡ZƒAš7¬÷éÎÆ0êýý$õ.xšÛÁQeUÆé4Uw؍½Ñ*ÚØÞò0ðėŸuÞ ¼`§õ”^du?2Ãáh³·¡ Té`щ¶¹"Z;9Lj]¥¹ £û ¡]Æà b)ªnµ*&L5…Whcýz°RêÃÌXŒ,4ÔvÖ¨éZ}&بù¢®ÍñÚâSÁrE‰÷ÞJ³ ͌~Ȫ_K|kÀ±¡òÜTçÉ@Åfmóiì­AÍ'Bµ¸ÌÔÔÀbMs êa°/Ö@Ô÷e¤. uDå2lý> P|‘ Ô=…7³9o~·€—=>‘x1®‰61 „ѹ®Íå᣸ъ¡*l­”Gėv_Ê¡)y(Yë½|÷¹{9\ñÛàñðÌÀz ÇMKXxo36Ij‚—îè—˜MÒÚÞê¼nmuÚÂÝJkËï$ú²*ËTjâT•·] –XªÇ•ðìö!u”…Úó_øñD¥t‘õ7¯å>²BYFÀ¹Ð¹™q;Àž0MÃø¦…E‰‘'èGć=L`ŸNíÀÑJœÅ%ü3;|MJ;(”äVé@}†ØKÅ.À,©©š/–xШãÂy¦Q2T:c:‰¶1ì¸}Ì7pj(i†±ƒ-ϔ.HÁl®€¯TÆÂ.b˖þGÀeYÙ:âT'ê@‘EdBEÅêèPü€+ln´p® \:»ˆ~•»["G£k®êîøª7æÝPGåq¬ÓJs;s¡–ƒÃ!`à÷æôøüú˜>¦%95D*Þ¨”c8ö?¡¦ðÍÜӐL¹ÍɐžÂ…?o#—eB2ûŽÓ†ðê§02ñX¨!ól{îÜja¡Zòîìô’@‹ %’MIŠ- |DlÎH©8\n`ݱìÁÔ@#°ÞS»Ð V°ÄagÄ*pO2üšªÔÌ0ŠRpxæó ƒÃ}¤ûâŒÂþÁÃ

Das ist der Punkt an dem ich nicht mehr weiter weiß... haben sich Javasript-Parameter/Definitionen verändert? Leider finde ich auch nichts im Error.log was mir irgendeinen Hinweis geben könnte?! Hier sehe ich nur die letzten Änderungen an der fhem.conf bzw. die Neustarts bei meinen Versuchen das zum laufen zu bekommen.

Zitat[Tue Jan 03 15:32:54.467415 2017] [mpm_event:notice] [pid 2769:tid 140270207825792] AH00491: caught SIGTERM, shutting down
[Tue Jan 03 15:32:55.683221 2017] [mpm_event:notice] [pid 8285:tid 140296670394240] AH00489: Apache/2.4.18 (Ubuntu) configured -- resuming normal operations
[Tue Jan 03 15:32:55.683408 2017] [core:notice] [pid 8285:tid 140296670394240] AH00094: Command line: '/usr/sbin/apache2'
[Tue Jan 03 15:36:18.777384 2017] [mpm_event:notice] [pid 8285:tid 140296670394240] AH00491: caught SIGTERM, shutting down
[Tue Jan 03 15:40:14.145527 2017] [mpm_event:notice] [pid 8670:tid 140330903332736] AH00489: Apache/2.4.18 (Ubuntu) configured -- resuming normal operations
[Tue Jan 03 15:40:14.145731 2017] [core:notice] [pid 8670:tid 140330903332736] AH00094: Command line: '/usr/sbin/apache2'

Jemand eine Idee? Port 8083 mit global-Definition läuft ohne Probleme.

grüße Sascha
FHEM auf Proxmox-VM (Intel NUC) mit 4xMapleCUN (433,3x868) und Jeelink, HUE, MiLight, Max!, SonOff, Zigbee, Alexa, uvm...

Wernieman

Kurze Frage:
http oder https? Mir siet es nach https output über http aus ....
- Bitte um Input für Output
- When there is a Shell, there is a Way
- Wann war Dein letztes Backup?

Wie man Fragen stellt: https://tty1.net/smart-questions_de.html

Tedious

Hi,

an sich erst mal über Http - wenn das sauber laufen würde käme denn das Thema HTTPS hinterher.

grüße Sascha
FHEM auf Proxmox-VM (Intel NUC) mit 4xMapleCUN (433,3x868) und Jeelink, HUE, MiLight, Max!, SonOff, Zigbee, Alexa, uvm...

Wernieman

- Bitte um Input für Output
- When there is a Shell, there is a Way
- Wann war Dein letztes Backup?

Wie man Fragen stellt: https://tty1.net/smart-questions_de.html

Tedious

Alles Standard, also HTTP. Im ersten Schritt soll nur Port 8085 im internen Netz via Reverse Proxy erreicht werden. Also alles Standard, nur ohne global Device auf 8085, das denn via Reverse Proxy exakt nach Wiki.
FHEM auf Proxmox-VM (Intel NUC) mit 4xMapleCUN (433,3x868) und Jeelink, HUE, MiLight, Max!, SonOff, Zigbee, Alexa, uvm...

Wernieman

Gib uns bitte mal die Reverse-Proxy Config ...
Und Deine FHEM-web config

Lokal ist Dein FHEM erreichbar, nur "von außen" geht es nicht?
- Bitte um Input für Output
- When there is a Shell, there is a Way
- Wann war Dein letztes Backup?

Wie man Fragen stellt: https://tty1.net/smart-questions_de.html

Tedious

Richtig "lokal" ist relativ, der Kleine läuft Headless. Aber Port 8083 ist im internen Netz erreichbar, 8084 und 8085 wie sie sollen nicht (kein global Attribut).

#Definition Websites
define WEB FHEMWEB 8083 global
attr WEB JavaScripts codemirror/fhem_codemirror.js
attr WEB codemirrorParam { "theme":"blackboard", "lineNumbers":true }
attr WEB editConfig 1
attr WEB iconPath fhemSVG:openautomation:default:icons_small
attr WEB longpoll 1
attr WEB plotfork 1
attr WEB stylesheetPrefix dark
define WEBmobile FHEMWEB 8084
attr WEBmobile stylesheetPrefix darktouchpad
define WEBtablet FHEMWEB 8085
attr WEBtablet stylesheetPrefix darktouchpad


sascha@FHEMServer:/etc/apache2/conf-enabled$ cat fhem.conf
<Location /fhem>
  # ProxyPass/ProxyPassReverse leitet HTTP requests auf eine andere URL um
  ProxyPass http://localhost:8085/fhem
  ProxyPassReverse http://localhost:8085/fhem
  ProxyHTMLEnable On
  # ProxyHTMLURLMap passt Links im HTML/JavaScript Source an
  ProxyHTMLURLMap /        /fhem/
  ProxyHTMLURLMap /fhem/     /fhem/
  AuthType Basic
  AuthName "Password Required"
  AuthUserFile /etc/fhem-htpasswd
  Require valid-user
  Order deny,allow
  Allow from all


Also an sich alles in der Standardkonfig? Habs eben noch mal getestet, jetzt kommen keine kryptischen Zeichen mehr, sondern ein lapidares "nicht erreichbar"
FHEM auf Proxmox-VM (Intel NUC) mit 4xMapleCUN (433,3x868) und Jeelink, HUE, MiLight, Max!, SonOff, Zigbee, Alexa, uvm...

Wernieman

Also igrnedwie ist Deine proxy-Koniguration nicht komplett:
  ProxyPass http://localhost:8085/fhem
  ProxyPassReverse http://localhost:8085/fhem

Da fehlt ein 2. Parameter, z.B.
ProxyPass /fhem/ http://localhost:8085/fhem/

Hast Du überhaupt den "apache-Proxy" aktiviert?

Siehe auch:
https://www.digitalocean.com/community/tutorials/how-to-use-apache-http-server-as-reverse-proxy-using-mod_proxy-extension
- Bitte um Input für Output
- When there is a Shell, there is a Way
- Wann war Dein letztes Backup?

Wie man Fragen stellt: https://tty1.net/smart-questions_de.html

Tedious

Hi, guten Morgen.

Die Module sind aktiviert:

sascha@FHEMServer:~$ apache2ctl -t -D DUMP_MODULES
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
Loaded Modules:
core_module (static)
so_module (static)
watchdog_module (static)
http_module (static)
log_config_module (static)
logio_module (static)
version_module (static)
unixd_module (static)
access_compat_module (shared)
alias_module (shared)
auth_basic_module (shared)
authn_core_module (shared)
authn_file_module (shared)
authz_core_module (shared)
authz_host_module (shared)
authz_user_module (shared)
autoindex_module (shared)
deflate_module (shared)
dir_module (shared)
env_module (shared)
filter_module (shared)
mime_module (shared)
mpm_event_module (shared)
negotiation_module (shared)
proxy_module (shared)
proxy_html_module (shared)
proxy_http_module (shared)
setenvif_module (shared)
status_module (shared)
xml2enc_module (shared)


Füge ich Deine angegebene Zeile hinzu scheitert es:

sascha@FHEMServer:~$ apachectl configtest
AH00526: Syntax error on line 4 of /etc/apache2/conf-enabled/fhem.conf:
ProxyPass|ProxyPassMatch can not have a path when defined in a location.
Action 'configtest' failed.


FHEM auf Proxmox-VM (Intel NUC) mit 4xMapleCUN (433,3x868) und Jeelink, HUE, MiLight, Max!, SonOff, Zigbee, Alexa, uvm...

Wernieman

Stimmt .. ich habe es außerhalb definiert .... hatte das "Lokation" übersehen ...

Ist wirklich komisch .. kannst DU mir bitte mal geben:
wget -vS localhost/fhem

Eventuell das "localhost" bitte anpassen
- Bitte um Input für Output
- When there is a Shell, there is a Way
- Wann war Dein letztes Backup?

Wie man Fragen stellt: https://tty1.net/smart-questions_de.html

Tedious

Hi,

erst mal Dankf für Deine Hilfe. Habe jetzt mal testweise die Guideline hier genommen:

https://haus-automatisierung.com/hardware/fhem/2016/12/30/fhem-tutorial-reihe-part-21-zugriff-auf-fhem-ueber-das-internet

Passt wunderbar, und die Verschlüsselung mit LetsEncrypt ist auch implementiert. Ich habe leider keinen Zugriff aufs Wiki, sonst würde ich da eine Note hinterlassen. Hat sich ja inzwischen doch einiges geändert, zumindest wenn man eine aktuelle Distri benutzt.

Grüße Sascha
FHEM auf Proxmox-VM (Intel NUC) mit 4xMapleCUN (433,3x868) und Jeelink, HUE, MiLight, Max!, SonOff, Zigbee, Alexa, uvm...

Wernieman

Das einzig blöde beim "Standard letsencrypt" ist, das es unter root laufen muss :o(
- Bitte um Input für Output
- When there is a Shell, there is a Way
- Wann war Dein letztes Backup?

Wie man Fragen stellt: https://tty1.net/smart-questions_de.html

dk3572

Hallo,
ich versuche nach dieser Anleitung
https://haus-automatisierung.com/hardware/fhem/2016/12/30/fhem-tutorial-reihe-part-21-zugriff-auf-fhem-ueber-das-internet.html
einen Reverse Proxy einzurichten.
Leider scheitere ich schon bei der Erstellung des Zertifikates.
(Domain bei Strato, Portfreigabe in FritzBox eingerichtet, ping auf Konsole funktioniert.)
Nach
./letsencrypt-auto certonly --rsa-key-size 4096 -d <domain>
bekomme ich diese Meldung
Could not bind TCP port 443 because it is already in use by another process on
this system (such as a web server). Please stop the program in question and then
try again.

Ich weiß nicht was den Port belegt.
Kann mir jemand bitte weiter helfen?
Danke und Gruß
Dieter

Tedious

Was hast Du denn alles installiert? Irgendwas blockt ja...
FHEM auf Proxmox-VM (Intel NUC) mit 4xMapleCUN (433,3x868) und Jeelink, HUE, MiLight, Max!, SonOff, Zigbee, Alexa, uvm...

Wernieman

Vorher apache/nginx runterfahren ... oder letsencrypt umstellen, das der Webserver verwendet wird
- Bitte um Input für Output
- When there is a Shell, there is a Way
- Wann war Dein letztes Backup?

Wie man Fragen stellt: https://tty1.net/smart-questions_de.html