Zwei unterschiedliche Webinterfaces über Lighttpd aufrufbar machen?

B

Boedefeld1990

Gast
Hallo,

seit Tagen versuche 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 hab 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.
Wenn ich nun http://192.168.0.10/dump1090/gmap.html eingebe, werde ich auf die Startseite von Pi-Hole geleitet.

Nach viel googeln habe ich bisher herausgefunden, dass man in der config von lighttpd die URL von Dump 1090 hinzufügen muss.
Nur leider blicke ich nicht da nicht mehr durch, wie ich die config umschreiben muss, dass ich am Ende sowohl das Interface von Pi-Hole als auch Dump1090 aufrufen kann.

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

Code:
# 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" schaut so aus:
Code:
# 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"

ich bin noch nicht so sehr mit Linux vertraut und hoffe, dass ihr wisst, wie ich neben das Pi-Hole Webinterface zusätzlich das Dump1090 Webinterface über die URL http://192.168.0.10/dump1090/gmap.html aufrufen kann und über http://192.168.0.10/Admin das Interface von Pi-Hole.

vielen Dank bereits für die Hilfestellung!

Gruß
 
Zuletzt bearbeitet von einem Moderator:
Soweit ich mich erinnern kann, benutzt dump1090 seinen eigenen Webserver. Wenn der nun auf Port 80 läuft und der lighthttpd auch, dann gibt's natürlich einen Konflikt. Check mal ob du bei dump1090 den Port ändern kannst.
 
Danke für die Antwort!

Leider habe ich in der config von Dump1090 nichts gefunden, wo ich den Port für den Webserver ändern konnte.

Nun habe ich aber folgendes ausgeführt:

Code:
#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

Und die lighttpd.conf schaute anschließend so aus:


Code:
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"

Nach einem Neustart funktioniert es nun.
Allerdings weiß ich nun nicht, woran es nun genau lag und was ich selbst in der config hätte ändern müssen...

Vielleicht kann mich ja jemand hierzu aufklären.

Gruß
 
Zurück
Oben