FTUI über Apache laufen lassen

Begonnen von aeronaut, 11 Dezember 2020, 16:52:05

Vorheriges Thema - Nächstes Thema

aeronaut

Hi,

FTUI ist erreichbar und funktionstüchtig unter http://192.168.10.82:8083/fhem/tablet/index.html

Nun möchte ich es über einen Apache unter http://192.168.10.82/fhem erreichbar haben. Also nach diesem Vorbild die Apache-Config angepasst: https://forum.fhem.de/index.php/topic,78156.msg701882.html#msg701882:
<VirtualHost 192.168.10.82:80>

    ServerAdmin webmaster@localhost
    DocumentRoot /opt/fhem/www/tablet

    <Directory /opt/fhem/www/tablet>
        Order allow,deny
        Allow from all
        Require all granted

        Options +Indexes
    </Directory>
    LogLevel alert rewrite:trace2
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
<Location /fhem>

  RewriteEngine On
    ProxyPass http://localhost:8083/fhem/tablet/
    ProxyPassReverse http://localhost:8083/fhem/tablet

</Location>
</VirtualHost>


Der Aufruf von http://192.168.10.82/fhem/ bringt HTTP Status 500 - Internal Server Error

Apache access.log:
192.168.10.21 - - [11/Dec/2020:16:45:47 +0100] "GET /fhem/ HTTP/1.1" 500 803 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:83.0) Gecko/20100101 Firefox/83.0"
192.168.10.21 - - [11/Dec/2020:16:45:47 +0100] "GET /favicon.ico HTTP/1.1" 403 495 "http://192.168.10.82/fhem/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:83.0) Gecko/20100101 Firefox/83.0"


Apache error.log:
[Fri Dec 11 16:45:47.746138 2020] [rewrite:trace2] [pid 2899] mod_rewrite.c(483): [client 192.168.10.21:51378] 192.168.10.21 - - [192.168.10.82/sid#ffff816c0110][rid#ffff843540a0/initial] init rewrite engine with requested uri /fhem/
[Fri Dec 11 16:45:47.746314 2020] [rewrite:trace1] [pid 2899] mod_rewrite.c(483): [client 192.168.10.21:51378] 192.168.10.21 - - [192.168.10.82/sid#ffff816c0110][rid#ffff843540a0/initial] pass through /fhem/
[Fri Dec 11 16:45:47.746434 2020] [rewrite:trace1] [pid 2899] mod_rewrite.c(483): [client 192.168.10.21:51378] 192.168.10.21 - - [192.168.10.82/sid#ffff816c0110][rid#ffff843540a0/initial] [perdir /fhem/] pass through proxy:http://localhost:8083/fhem/tablet//


Reichlich wenig Fleisch in den Logs  :-\  woran könnte das liegen?

lg
aeronaut

amenomade

#1
"/" am Ende immer kohärent halten.

Wenn Du Location /fhem (ohen Slash am Ende) nach ...fhem/tablet/ (mit Slash am Ende) proxiest, dann wird eine URL ...fhem/xxx zu ...fhem/tablet//xxx übersetzt. Das Doppelslash sieht man sogar in deiner ErrorLog.

EDIT: im von dir hieroben verlinkten Post ist es korrekt eingestellt. Schau mal nach.
Pi 3B, Alexa, CUL868+Selbstbau 1/2λ-Dipol-Antenne, USB Optolink / Vitotronic, Debmatic und HM / HmIP Komponenten, Rademacher Duofern Jalousien, Fritz!Dect Thermostaten, Proteus

aeronaut

Habe den / entfernt, leider bringt das nichts.

Der Proxy sieht nun so aus:
<Location /fhem>

    RewriteEngine On
    ProxyPass http://localhost:8083/fhem/tablet
    ProxyPassReverse http://localhost:8083/fhem/tablet

</Location>


error.log:
[Fri Dec 11 21:54:43.109923 2020] [rewrite:trace2] [pid 14968] mod_rewrite.c(483): [client 192.168.10.21:54106] 192.168.10.21 - - [192.168.10.82/sid#ffffa1d95168][rid#ffffa4a150a0/initial] init rewrite engine with requested uri /fhem
[Fri Dec 11 21:54:43.110120 2020] [rewrite:trace1] [pid 14968] mod_rewrite.c(483): [client 192.168.10.21:54106] 192.168.10.21 - - [192.168.10.82/sid#ffffa1d95168][rid#ffffa4a150a0/initial] pass through /fhem
[Fri Dec 11 21:54:43.110267 2020] [rewrite:trace1] [pid 14968] mod_rewrite.c(483): [client 192.168.10.21:54106] 192.168.10.21 - - [192.168.10.82/sid#ffffa1d95168][rid#ffffa4a150a0/initial] [perdir /fhem/] pass through proxy:http://localhost:8083/fhem/tablet

aeronaut

Gerade ist mir aufgefallen, dass bei Eingabe von http://192.168.10.82:8083/fhem/tablet in FHEM lande, aber bei http://192.168.10.82:8083/fhem/tablet/index.html in FTUI lande ...  :o

amenomade

#4
Hast Du apache "gracefully" (oder sogar komplett) neu gestartet?
EDIT: ja, sieht so aus
Pi 3B, Alexa, CUL868+Selbstbau 1/2λ-Dipol-Antenne, USB Optolink / Vitotronic, Debmatic und HM / HmIP Komponenten, Rademacher Duofern Jalousien, Fritz!Dect Thermostaten, Proteus

aeronaut

Habe ihn neu gestartet mit systemctl restart

amenomade

Pi 3B, Alexa, CUL868+Selbstbau 1/2λ-Dipol-Antenne, USB Optolink / Vitotronic, Debmatic und HM / HmIP Komponenten, Rademacher Duofern Jalousien, Fritz!Dect Thermostaten, Proteus

aeronaut

Das ist mir klar. Ich hatte kurz überlegt, ob die Angabe der index.html damit was zu tun hat. Hier ist beschrieben, dass sie bei Benutzung über WEB angegeben werden muss: https://wiki.fhem.de/wiki/FHEM_Tablet_UI

Der Apache wirft weiterhin den 500, egal ob mit oder ohne index.html

amenomade

Und was sagen jetzt genau die Logs (auch Fhem Log)?
Pi 3B, Alexa, CUL868+Selbstbau 1/2λ-Dipol-Antenne, USB Optolink / Vitotronic, Debmatic und HM / HmIP Komponenten, Rademacher Duofern Jalousien, Fritz!Dect Thermostaten, Proteus

aeronaut

Nichts neues bei Apache:
[Fri Dec 11 22:23:02.171579 2020] [rewrite:trace2] [pid 2823] mod_rewrite.c(483): [client 192.168.10.21:64680] 192.168.10.21 - - [192.168.10.82/sid#ffff906ef168][rid#ffff9336f0a0/initial] init rewrite engine with requested uri /fhem
[Fri Dec 11 22:23:02.171771 2020] [rewrite:trace1] [pid 2823] mod_rewrite.c(483): [client 192.168.10.21:64680] 192.168.10.21 - - [192.168.10.82/sid#ffff906ef168][rid#ffff9336f0a0/initial] pass through /fhem
[Fri Dec 11 22:23:02.171915 2020] [rewrite:trace1] [pid 2823] mod_rewrite.c(483): [client 192.168.10.21:64680] 192.168.10.21 - - [192.168.10.82/sid#ffff906ef168][rid#ffff9336f0a0/initial] [perdir /fhem/] pass through proxy:http://localhost:8083/fhem/tablet


Aber bei fhem:
2020.12.11 22:23:48 3: FHEMWEB WEB CSRF error: csrf_16886882175852 ne csrf_58045058297708 for client WEB_192.168.10.21_64253 / command jsonlist2 GartenLicht STATE. For details see the csrfToken FHEMWEB attribute.

Habe jetzt das Attribut csrfToken auf none gesetzt. Damit verschwinden die Einträge im fhem.log, aber der 500er kommt noch immer.

amenomade

Hmm. Langsam bin ich ratlos.

Versuch mal LogLevel auf "debug rewrite:trace2" zu setzen. Vielleicht sieht man da mehr.
Pi 3B, Alexa, CUL868+Selbstbau 1/2λ-Dipol-Antenne, USB Optolink / Vitotronic, Debmatic und HM / HmIP Komponenten, Rademacher Duofern Jalousien, Fritz!Dect Thermostaten, Proteus

aeronaut

Das war eine gute Idee:
[Fri Dec 11 23:21:38.193823 2020] [rewrite:trace1] [pid 3486] mod_rewrite.c(483): [client 192.168.10.21:57283] 192.168.10.21 - - [192.168.10.82/sid#ffff8aa0a168][rid#ffff8d68a0a0/initial] pass through /fhem
[Fri Dec 11 23:21:38.193940 2020] [authz_core:debug] [pid 3486] mod_authz_core.c(843): [client 192.168.10.21:57283] AH01628: authorization result: granted (no directives)
[Fri Dec 11 23:21:38.194049 2020] [rewrite:trace1] [pid 3486] mod_rewrite.c(483): [client 192.168.10.21:57283] 192.168.10.21 - - [192.168.10.82/sid#ffff8aa0a168][rid#ffff8d68a0a0/initial] [perdir /fhem/] pass through proxy:http://localhost:8083/fhem/tablet
[Fri Dec 11 23:21:38.194163 2020] [proxy:debug] [pid 3486] mod_proxy.c(1251): [client 192.168.10.21:57283] AH01143: Running scheme http handler (attempt 0)
[Fri Dec 11 23:21:38.194213 2020] [proxy_fcgi:debug] [pid 3486] mod_proxy_fcgi.c(1030): [client 192.168.10.21:57283] AH01076: url: http://localhost:8083/fhem/tablet proxyname: (null) proxyport: 0
[Fri Dec 11 23:21:38.194309 2020] [proxy_fcgi:debug] [pid 3486] mod_proxy_fcgi.c(1035): [client 192.168.10.21:57283] AH01077: declining URL http://localhost:8083/fhem/tablet
[Fri Dec 11 23:21:38.194355 2020] [proxy_wstunnel:debug] [pid 3486] mod_proxy_wstunnel.c(304): [client 192.168.10.21:57283] AH02450: declining URL http://localhost:8083/fhem/tablet
[Fri Dec 11 23:21:38.194395 2020] [proxy:warn] [pid 3486] [client 192.168.10.21:57283] AH01144: No protocol handler was valid for the URL /fhem (scheme 'http'). If you are using a DSO version of mod_proxy, make sure the proxy submodules are included in the configuration using LoadModule.


Scheinbar fehlt beim mod_proxy irgendwas ....

aeronaut

Es funktioniert so:

ProxyPass http://localhost:8083/fhem/tablet/
    ProxyPassReverse http://localhost:8083/fhem/tablet/


Scheinbar werden die abschließenden Schrägstriche vom proxy-Modul benötigt.

Danke  :D

amenomade

Wie sieht jetzt die gesamte Apache config aus?
Pi 3B, Alexa, CUL868+Selbstbau 1/2λ-Dipol-Antenne, USB Optolink / Vitotronic, Debmatic und HM / HmIP Komponenten, Rademacher Duofern Jalousien, Fritz!Dect Thermostaten, Proteus

aeronaut

Die apache2.conf ist unangetastet. Die ftui.conf:
<VirtualHost 192.168.10.82:80>

    ServerAdmin webmaster@localhost
    DocumentRoot /opt/fhem/www/tablet

    <Directory /opt/fhem/www/tablet>
        Order allow,deny
        Allow from all
        Require all granted

        Options +Indexes
    </Directory>
    LogLevel debug rewrite:trace2
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
<Location /fhem>

    RewriteEngine On
    ProxyPass http://localhost:8083/fhem/tablet/
    ProxyPassReverse http://localhost:8083/fhem/tablet/

</Location>
</VirtualHost>


Es gibt aber Merkwürdigkeiten:
Unter http://192.168.10.82/ ist FTUI ebenfalls erreichbar. Das sollte so nicht sein, bzw. sagt die Config das gar nicht aus. Und von dort wird auch PHP interpretiert. Der Aufruf von http://192.168.10.82/fhem/index.php startet den Download der php-Datei.