FHEM Forum

FHEM => Frontends => Thema gestartet von: AET_FHEM am 15 Juni 2018, 22:13:16

Titel: Webview nur ohne https ....?
Beitrag von: AET_FHEM am 15 Juni 2018, 22:13:16
Nabend ....

ich versuche mein Webview über Apache zu erreichen,
das klappt eigentlich auch aber sobald ich versuche Verschlüsselt über SSL darauf zugreifen will bekomme ich eine Verbindung aber nur als Text oberfläche...

http://IP/fhem => Geht  :)
http://IP:8083 => Geht  ;D
https://IP/fhem => nur Text  :o

an was kann das liegen, hat jemand eine Idee...? => ich weiß das das schon mal geklappt hat  ::)
Titel: Antw:Webview nur ohne https ....?
Beitrag von: rudolfkoenig am 15 Juni 2018, 22:55:00
Fuer https muss man eine weitere FHEMWEB Instanz anlegen, und mit dem Attribut HTTPS versehen.
Vorher muss noch ein Zertifikat bereitgestellt werden (siehe commandref Eintrag (https://fhem.de/commandref_modular.html#HTTPS)), und fuer den defaultport 443 muss FHEM als root gestartet werden (nicht empfohlen, bitte anderen Port verwenden).
Titel: Antw:Webview nur ohne https ....?
Beitrag von: AET_FHEM am 16 Juni 2018, 09:58:02
Ja ...
mein Fehler, ich greiff ja nicht direkt auf https:// oder Port 443 zu

das mach ich ja mit
<VirtualHost *:80>
       ServerName nix.de
       #immer auf https ausweichen
       #Redirect permanent / https://nix.de/

  <Directory />
        RedirectPermanent / /fhem
  </Directory>


    <Location /fhem>
        ProxyPass http://localhost:8083/fhem
        ProxyPassReverse http://localhost:8083/fhem
    </Location>

</VirtualHost>


<IfModule mod_ssl.c>
<VirtualHost *:443>
    ServerName nix.de

    ServerAdmin blablub@nix.de
    DocumentRoot /var/www/html

    ErrorLog /var/log/nix.de.error.log
    CustomLog /var/log/nix.de.access.log combined

    SSLCertificateFile /etc/letsencrypt/live/nix.de/fullchain.pem
    SSLCertificateKeyFile /etc/letsencrypt/live/nix.de/privkey.pem

    Include /etc/letsencrypt/options-ssl-apache.conf

    ProxyRequests Off
    ProxyVia Off
    ProxyPreserveHost On

    <Location /fhem>
        ProxyPass http://localhost:8083/fhem/
        ProxyPassReverse http://localhost:8083/fhem/
    </Location>

#  <Directory />
#        RedirectPermanent / /fhem
#  </Directory>


            <Proxy *>
                AuthType Basic
                AuthName "Password for FHEM Required"
                AuthUserFile /etc/fhem-htpasswd
                Require valid-user
                Order deny,allow
                Allow from all
            </Proxy>
</VirtualHost>
</IfModule>


hier im Frorum wird das so beschrieben, aber leider hab ich nur text über  SSL --> was mach ich falsch?
Titel: Antw:Webview nur ohne https ....?
Beitrag von: amenomade am 16 Juni 2018, 10:33:36
Hast Du schon mit der Apache Konfiguration vom Wiki (genau wie die beschrieben ist) probiert?

Ich finde folgende Directives merkwürdig
DocumentRoot /var/www/htmlLiegen deine Fhem Seiten unter /var/www/html?
<Location /fhem>Brauchst du das wirklich? Probier mal erstmal ohne.

Sonst was sagen die Apache Logs? Und was sagt dein Browser in Debug Mode?
Titel: Antw:Webview nur ohne https ....?
Beitrag von: AET_FHEM am 16 Juni 2018, 12:35:38
Hey,

ach manchmal steht man auf dem schlauch....

geht wieder meine .conf

<IfModule mod_ssl.c>
<VirtualHost *:443>
    ServerName meine.homepa.ge

    ServerAdmin info@meine.homepa.ge
    DocumentRoot /var/www/html

    ErrorLog ${APACHE_LOG_DIR}/meine.homepa.ge.error.log
    CustomLog ${APACHE_LOG_DIR}/meine.homepa.ge.access.log combined

    SSLCertificateFile /etc/letsencrypt/live/meine.homepa.ge/fullchain.pem
    SSLCertificateKeyFile /etc/letsencrypt/live/meine.homepa.ge/privkey.pem

    Include /etc/letsencrypt/options-ssl-apache.conf

    ProxyRequests Off
    ProxyVia Off
    ProxyPreserveHost On

    <Location /fhem>
        ProxyPass http://localhost:8083/fhem
        ProxyPassReverse http://localhost:8083/fhem
    </Location>

    <Directory />
        RedirectPermanent / /fhem
    </Directory>

    <Proxy *>
        AuthType Basic
        AuthName "Password for FHEM Required"
        AuthUserFile /etc/fhem-htpasswd
        Require valid-user
        Order deny,allow
        Allow from all
    </Proxy>
</VirtualHost>
</IfModule>


jetzt komm ich wieder intern und von extern von 443 extern und intern mit port 80 wieder drauf
ich dachte der Port 80 brauch separat eine Umleitung  ::) aber das klappt :-) alles
:)