Lighttpd startet mit SSL und Letsencrypt nicht

BitKeeper

New Member
Hallo,

ich hoffe ich bin hier im richtigen Unterforum.

Ich habe auf einen RPi 3b+ raspian installiert (debian stretch). Da drauf ist ein Pihole, welcher lighttpd mitbringt und bei updates auch erneut installiert. Deshalb möchte ich auch bei lighttpd bleiben. Zusätzlich befindet sich auf dem RPi auch eine Nextcloud, welche ich gerne per SSL nutzen würde (ohne SSL läuft bisher alles gut).

Nun habe ich verschiedene Anleitungen ausprobiert und alle enden mit dem resultat das lighttpd nicht mehr startet.

Unteranderem habe ich die https://nwgat.ninja/setting-up-letsencrypt-with-lighttpd/ bzw diese https://discourse.pi-hole.net/t/enabling-https-for-your-pi-hole-web-interface/5771 verwendet. Das resultat ist jedesmal das selbe. Lighttpd startet nicht mehr.

Ich habe unten noch meine .conf dateien und die fehlermeldung kopiert. Vielleicht hilft das ja noch. Wenn noch was benötigt wird bitte bescheid geben. Vielen Dank im vorraus.

Gruß
BitKeeper

lighttpd -v
lighttpd/1.4.45 (ssl) - a light and fast webserver
Build-Date: Jan 14 2017 21:07:19

cat lighttpd.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 uu%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
include_shell "cat external.conf 2>/dev/null"

cat external.conf
$HTTP["host"] == "my.myfritz.net" {
# Ensure the Pi-hole Block Page knows that this is not a blocked domain
setenv.add-environment = ("fqdn" => "true")
# Enable the SSL engine with a LE cert, only for this specific host
$SERVER["socket"] == ":443" {
ssl.engine = "enable"
ssl.pemfile = "/etc/letsencrypt/live/my.myfritz.net-0001/combined.pem"
ssl.ca-file = "/etc/letsencrypt/live/my.myfritz.net-0001/fullchain.pem"
ssl.honor-cipher-order = "enable"
ssl.cipher-list = "EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH"
ssl.use-compression = "disable"
ssl.use-sslv2 = "disable"
ssl.use-sslv3 = "disable"
}
# Redirect HTTP to HTTPS
$HTTP["scheme"] == "http" {
$HTTP["host"] =~ ".*" {
url.redirect = (".*" => "https://%0$0")
}
}
}

● lighttpd.service - Lighttpd Daemon
Loaded: loaded (/lib/systemd/system/lighttpd.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Thu 2018-07-05 20:55:06 UTC; 30min ago
Process: 32226 ExecStart=/usr/sbin/lighttpd -D -f /etc/lighttpd/lighttpd.conf (code=exited, sta
Process: 32215 ExecStartPre=/usr/sbin/lighttpd -tt -f /etc/lighttpd/lighttpd.conf (code=exited,
Main PID: 32226 (code=exited, status=255)

Jul 05 20:55:06 raspberrypi systemd[1]: lighttpd.service: Unit entered failed state.
Jul 05 20:55:06 raspberrypi systemd[1]: lighttpd.service: Failed with result 'exit-code'.
Jul 05 20:55:06 raspberrypi systemd[1]: lighttpd.service: Service hold-off time over, scheduling
Jul 05 20:55:06 raspberrypi systemd[1]: Stopped Lighttpd Daemon.
Jul 05 20:55:06 raspberrypi systemd[1]: lighttpd.service: Start request repeated too quickly.
Jul 05 20:55:06 raspberrypi systemd[1]: Failed to start Lighttpd Daemon.
Jul 05 20:55:06 raspberrypi systemd[1]: lighttpd.service: Unit entered failed state.
Jul 05 20:55:06 raspberrypi systemd[1]: lighttpd.service: Failed with result 'exit-code'.
 
Starte den lighthttp mal direkt ohne service.
Mich irritiert das -D in der .service file.
Je nachdem welcher type angegeben ist, darf man den Prozess nicht als Daemon starten, weil das in dem Fall systemd macht.

Deswegen einfach der Test, ob den Prozess ganz normal über die Kommandozeile starten kannst. Wichtig ist auch, dass du dann selbst den Pfad zur Konfiguration angibst.
 
Danke für die Antwort.

der configcheck sagt syntax ok

Habe versucht ihn zu sarten und bekam

lighttpd -f /etc/lighttpd/lighttpd.conf
2018-07-07 22:13:02: (network.c.464) can't bind to port: 443 Address already in use

Vielleicht ist das der Grund?

ich habe von linux leider nicht soviel ahnung wie ich es gerne hätte ':)
 
Entweder lighttpd läuft schon oder ein anderes Programm benutzt Port 443.

Was zeigt denn in der Shell:
Code:
netstat -tulpen | grep :443
 
Er zeigt nichts an

root@raspberrypi:/home/pi# sudo service lighttpd start
root@raspberrypi:/home/pi# netstat -tulpen | grep :443
root@raspberrypi:/home/pi# lighttpd -f /etc/lighttpd/lighttpd.conf
2018-07-08 16:06:34: (network.c.464) can't bind to port: 443 Address already in use
root@raspberrypi:/home/pi# netstat -tulpen | grep :443
root@raspberrypi:/home/pi# sudo service lighttpd stop
root@raspberrypi:/home/pi# lighttpd -f /etc/lighttpd/lighttpd.conf
2018-07-08 16:07:42: (network.c.464) can't bind to port: 443 Address already in use
root@raspberrypi:/home/pi# netstat -tulpen | grep :443
root@raspberrypi:/home/pi#

Auch lsof -t -i:443 gibt nix aus

Wenn ich die das Https zeug aus der Konfig entferne gibt er für den befehl aus:

root@raspberrypi:/home/pi# service lighttpd start
root@raspberrypi:/home/pi# netstat -tulpen | grep :443
tcp 0 0 0.0.0.0:443 0.0.0.0:* LISTEN 0 28195 3344/lighttpd
 
Es scheint als würde der dienst in einer schleife starten.
root@raspberrypi:/home/pi# service lighttpd stop
root@raspberrypi:/home/pi# ps aux | grep lighttpd
root 8357 0.0 0.0 4372 580 pts/0 S+ 06:56 0:00 grep lighttpd
root@raspberrypi:/home/pi# ps aux | grep lighttpd
root 8359 0.0 0.0 4372 584 pts/0 S+ 06:56 0:00 grep lighttpd
root@raspberrypi:/home/pi# ps aux | grep lighttpd
root 8361 0.0 0.0 4372 576 pts/0 S+ 06:56 0:00 grep lighttpd
root@raspberrypi:/home/pi# ps aux | grep lighttpd
root 8363 0.0 0.0 4372 524 pts/0 S+ 06:56 0:00 grep lighttpd
root@raspberrypi:/home/pi# ps aux | grep lighttpd
root 8365 0.0 0.0 4372 572 pts/0 S+ 06:56 0:00 grep lighttpd
root@raspberrypi:/home/pi# ps aux | grep lighttpd
root 8367 0.0 0.0 4372 580 pts/0 S+ 06:56 0:00 grep lighttpd
root@raspberrypi:/home/pi# ps aux | grep lighttpd
root 8369 0.0 0.0 4372 564 pts/0 S+ 06:56 0:00 grep lighttpd
root@raspberrypi:/home/pi# ps aux | grep lighttpd
root 8371 0.0 0.0 4372 544 pts/0 S+ 06:56 0:00 grep lighttpd
 
Ich habe scheinbar eine Lösung gefunden. Ich habe einfach mal auf gut glück den SSL mod von lighty versucht zu disablen. Nach dem ich die https config wieder eingefügt habe und ein force-reload durch geführt habe läuft der server jetzt und scheint die conf datei zu nutzen.

root@raspberrypi:/home/pi# sudo lighty-disable-mod ssl
Disabling ssl
Run "service lighttpd force-reload" to enable changes
root@raspberrypi:/home/pi# service lighttpd force-reload
root@raspberrypi:/home/pi# nano /etc/lighttpd/external.conf
root@raspberrypi:/home/pi# service lighttpd force-reload

ich werde nachher noch etwas testen und dann bescheid geben ob das tatsächlich die lösung ist.

ich danke euch schon mal im Voraus.

Gruß
BitKeeper
 
Back
Top