Pi-Hole und Dump1090 - Lighttpd Problem

Hallo Community,

seit Tagen hatte ich ein Problem mit lighttpd in Verbindung mit Pi-Hole und Dump1090 (ADSB-Empfang mit Webinterface).

Ich hatte auf meinem Raspberry Pi 3 b+ zuerst Dump1090 laufen, womit ich auch problemlos das Webinterface über 192.168.0.10/dump1090/gmap.html aufrufen konnte.
Dann habe ich zusätzlich Pi-Hole installiert und als das erledigt war, konnte ich das Interface von Dump1090 nicht mehr aufrufen, sondern nur noch das Interface von Pi-Hole.

Als ich dann http://192.168.0.10/dump1090/gmap.html eingegeben habe, wurde ich auf die Startseite von Pi-Hole geleitet.

Unter "/etc/lighttpd/conf-enabled" befindet sich die Datei "89-dump1090.conf" mit folgenden Inhalt:

# Allows access to the static files that provide the dump1090 map view,
# and also to the dynamically-generated json parts that contain aircraft
# data and are periodically written by the dump1090 daemon.
url.redirect += (
  "^/dump1090/$" => "/dump1090/gmap.html",
  "^/dump1090$" => "/dump1090/gmap.html"
)
alias.url += (
  "/dump1090/data/" => "/run/dump1090-mutability/",
  "/dump1090/" => "/usr/share/dump1090-mutability/html/"
)
# The stat cache must be disabled, as aircraft.json changes
# frequently and lighttpd's stat cache often ends up with the
# wrong content length.
server.stat-cache-engine    = "disable"

Die "lighttpd.conf" sah so aus:

# Pi-hole: A black hole for Internet advertisements
# (c) 2017 Pi-hole, LLC (https://pi-hole.net)
# Network-wide ad blocking via your own hardware.
#
# Lighttpd config for Pi-hole
#
# This file is copyright under the latest version of the EUPL.
# Please see LICENSE file for your rights under this license.
###############################################################################
#     FILE AUTOMATICALLY OVERWRITTEN BY PI-HOLE INSTALL/UPDATE PROCEDURE.     #
# ANY CHANGES MADE TO THIS FILE AFTER INSTALL WILL BE LOST ON THE NEXT UPDATE #
#                                                                             #
#              CHANGES SHOULD BE MADE IN A SEPARATE CONFIG FILE:              #
#                         /etc/lighttpd/external.conf                         #
###############################################################################
server.modules = (
    "mod_access",
    "mod_accesslog",
    "mod_auth",
    "mod_expire",
    "mod_compress",
    "mod_redirect",
    "mod_setenv",
    "mod_rewrite"
)
server.document-root        = "/var/www/html"
server.error-handler-404    = "pihole/index.php"
server.upload-dirs          = ( "/var/cache/lighttpd/uploads" )
server.errorlog             = "/var/log/lighttpd/error.log"
server.pid-file             = "/var/run/lighttpd.pid"
server.username             = "www-data"
server.groupname            = "www-data"
server.port                 = 80
accesslog.filename          = "/var/log/lighttpd/access.log"
accesslog.format            = "%{%s}t|%V|%r|%s|%b"
index-file.names            = ( "index.php", "index.html", "index.lighttpd.html" )
url.access-deny             = ( "~", ".inc", ".md", ".yml", ".ini" )
static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" )
compress.cache-dir          = "/var/cache/lighttpd/compress/"
compress.filetype           = ( "application/javascript", "text/css", "text/html", "text/plain" )
# default listening port for IPv6 falls back to the IPv4 port
include_shell "/usr/share/lighttpd/use-ipv6.pl " + server.port
include_shell "/usr/share/lighttpd/create-mime.assign.pl"
# Prevent Lighttpd from enabling Let's Encrypt SSL for every blocked domain
#include_shell "/usr/share/lighttpd/include-conf-enabled.pl"
include_shell "find /etc/lighttpd/conf-enabled -name '*.conf' -a ! -name 'letsencrypt.conf' -printf 'include \"%p\"\n' 2>/dev/null"
# If the URL starts with /admin, it is the Web interface
$HTTP["url"] =~ "^/admin/" {
    # Create a response header for debugging using curl -I
    setenv.add-response-header = (
        "X-Pi-hole" => "The Pi-hole Web interface is working!",
        "X-Frame-Options" => "DENY"
    )
    $HTTP["url"] =~ ".ttf$" {
        # Allow Block Page access to local fonts
        setenv.add-response-header = ( "Access-Control-Allow-Origin" => "*" )
    }
}
# Block . files from being served, such as .git, .github, .gitignore
$HTTP["url"] =~ "^/admin/\.(.*)" {
     url.access-deny = ("")
}
# Add user chosen options held in external file
# This uses include_shell instead of an include wildcard for compatibility
include_shell "cat external.conf 2>/dev/null"

Nun bin ich auf eine Lösung gestoßen und hab folgendes ausgeführt:

#Remove & purge
sudo apt-get remove lighttpd
sudo apt-get purge lighttpd
#Reinstall
sudo apt-get install lighttpd
#Configure to enable dump1090 module in lighttpd & restart lighttpd
sudo lighty-enable-mod dump1090
sudo /etc/init.d/lighttpd force-reload
#Reboot RPi (optional)
sudo reboot

Die Lighttpd sah danach folgendermaßen aus:

server.modules = (
    "mod_access",
    "mod_alias",
    "mod_compress",
     "mod_redirect",
)
server.document-root        = "/var/www/html"
server.upload-dirs          = ( "/var/cache/lighttpd/uploads" )
server.errorlog             = "/var/log/lighttpd/error.log"
server.pid-file             = "/var/run/lighttpd.pid"
server.username             = "www-data"
server.groupname            = "www-data"
server.port                 = 80
index-file.names            = ( "index.php", "index.html", "index.lighttpd.html" )
url.access-deny             = ( "~", ".inc" )
static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" )
compress.cache-dir          = "/var/cache/lighttpd/compress/"
compress.filetype           = ( "application/javascript", "text/css", "text/html", "text/plain" )
# default listening port for IPv6 falls back to the IPv4 port
include_shell "/usr/share/lighttpd/use-ipv6.pl " + server.port
include_shell "/usr/share/lighttpd/create-mime.assign.pl"
include_shell "/usr/share/lighttpd/include-conf-enabled.pl"

Als ich den Raspberry Pi 3 b+ neu gestartet habe, konnte ich nun endlich das Interface von Pi-Hole UND Dump1090 aufrufen.

Aber nun weiß ich leider nicht, was genau das Problem war und wollte fragen, ob von Euch jemand anhand der Config sehen kann, welcher Befehl nun eingefügt werden musste, damit ich das Webinterface von Pi-Hole und Dump1090 aufrufen kann.

Denn tagelang hab ich probiert und getüftelt und würde deshalb gerne wissen wie man das problem auch selbst lösen kann.

Ich hoffe, dass ihr mir dazu etwas mitteilen könnt.

Vielen Dank bereits für die Hilfestellung!

Beste Grüße!

Hi,
das Problem wird wohl nach dem nächsten pihole Update wieder bestehen, denn die Datei /etc/lighttpd/lighttpd.conf enthält explizit den Hinweis, dass die Konfiguration von pihole erstellt wird und bei einem Update auch überschrieben wird.

Aber nun zum eigentlichen Problem: Die dump1090 Konfiguration (Datei /etc/lighttpd/conf-enabled/89-dump1090.conf) enthält den Befehl alias.url += .... Wenn man sich das Error-Log /var/log/lighttpd/error.log anschaut, fällt eine Zeile auf: (server.c.1295) WARNING: unknown config-key: alias.url (ignored). Hier passt also etwas nicht. Und zwar fehlt dem Server das mod_alias Modul. Da man dies nicht einfach in die Konfiguration eintragen kann, da diese wie gesagt überschrieben wird, muss man stattdessen folgendes machen:

Die Lösung: Am Ende der lighttpd.conf wird die Datei external.conf geladen. Diese ist genau dafür da, Konfigurationen vorzunehmen, die ein Update von pihole überleben. Also einfach in die /etc/lighttpd/external.conf folgende Zeilen einfügen:

server.modules += (
        "mod_alias"
)

Dann den Webserver neu starten (sudo systemctl restart lighttpd) und die dump1090 Seite funktioniert.

3 Likes

Gerade durch googlen auf diese Antwort gestolpert und endlich läuft bei mir jetzt die dump1090 Map wieder.
Dankte!