Bullseye update fine but lighttpd is failing

mcnahum

can you share following

ls -la /var/www/

I did that and restore the lighttpd.conf for Pihole from a backup (below) and now:

root@DietPi:~# /usr/sbin/lighttpd -tt -f /etc/lighttpd/lighttpd.conf
2021-11-11 15:45:02: configfile.c.2113) command “cat external.conf 2>/dev/null” exited non-zero: 1
2021-11-11 15:45:02: configfile.c.1970) source: /etc/lighttpd/lighttpd.conf line: 68 pos: 14 parser failed somehow near here: (EOL)

\



/etc/lighttpd/lighttpd.conf

# 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_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             = "/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" )

mimetype.assign = (
    ".ico"   => "image/x-icon",
    ".jpeg"  => "image/jpeg",
    ".jpg"   => "image/jpeg",
    ".png"   => "image/png",
    ".svg"   => "image/svg+xml",
    ".css"   => "text/css; charset=utf-8",
    ".html"  => "text/html; charset=utf-8",
    ".js"    => "text/javascript; charset=utf-8",
    ".json"  => "application/json; charset=utf-8",
    ".map"   => "application/json; charset=utf-8",
    ".txt"   => "text/plain; charset=utf-8",
    ".eot"   => "application/vnd.ms-fontobject",
    ".otf"   => "font/otf",
    ".ttc"   => "font/collection",
    ".ttf"   => "font/ttf",
    ".woff"  => "font/woff",
    ".woff2" => "font/woff2"
)

# 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"

# default listening port for IPv6 falls back to the IPv4 port
include_shell "/usr/share/lighttpd/use-ipv6.pl " + server.port

# 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"
    )
}

# Block . files from being served, such as .git, .github, .gitignore
$HTTP["url"] =~ "^/admin/\.(.*)" {
    url.access-deny = ("")
}

# allow teleporter iframe on settings page
$HTTP["url"] =~ "/teleporter\.php$" {
    $HTTP["referer"] =~ "/admin/settings\.php" {
        setenv.add-response-header = ( "X-Frame-Options" => "SAMEORIGIN" )
    }
}

# Default expire header
expire.url = ( "" => "access plus 0 seconds" )

So just to be clear: If you installed Pi-hole via dietpi-software, this is now the wrong config, if you installed it via P-hole installer, it is right. But it then expects the external.conf to be present and I’m wondering how it is missing when you used the Pi-hole installer :thinking:. However, to fix:

> /etc/lighttpd/external.conf

I recommend to use DietPi installer. Less headache, less issue, less confirmation needed. All integrated and automatically configured to work together. Just as on option next time.

Thanks Joulinar & MichIng for your time! all is now good and yes if back in the days when I installed Pi-hole I was aware that DietPi Installer was a thing I would have done it… I didn’t follow the proper tuto … all my new Pi(s) will be be like build like that now :sunglasses:

Hello,

After upgrading to Bulleyes (following https://dietpi.com/blog/?p=811) I have also an error with Lighttpd:

DietPi-Services
─────────────────────────────────────────────────────
Mode: restart

[ OK ] DietPi-Services | restart : redis-server
[ OK ] DietPi-Services | restart : mariadb
[FAILED] DietPi-Services | restart : lighttpd
[ OK ] DietPi-Services | restart : cron

I have followed Joulinar question:

root@DietPi:/etc/lighttpd# /usr/sbin/lighttpd -tt -f /etc/lighttpd/lighttpd.conf
2022-05-08 16:17:08: configfile.c.461) Warning: “mod_compress” is DEPRECATED and has been replaced with “mod_deflate”. A future release of lighttpd 1.4.x will not contain mod_compress and lighttpd may fail to start up
2022-05-08 16:17:08: plugin.c.195) dlopen() failed for: /usr/lib/lighttpd/mod_openssl.so /usr/lib/lighttpd/mod_openssl.so: cannot open shared object file: No such file or directory
2022-05-08 16:17:08: server.c.1238) loading plugins finally failed

What can I do ?
regards

Did you reinstall lighttpd as described on our blog?

No i didn’t should I ?

It’s part of the blog post you linked above. Isn’t it?

Well it 's not so clear for me. As I use only Nextcloud do I have to re-install it also ?

Yes steps in 2.2.4 would need to be taken into account.

OK so let’s get back to work.

Question: If I need to uninstall all those sotware and reinstall them what is the difference with a brand new dietpi bulleyes installation ?

[ ] 73 Fail2Ban: prevents brute-force attacks with ip ban
[ ] 84 Lighttpd: Extremely lightweight webserver
[ ] 88 MariaDB: Persistent cached file-per-table database server
[ ] 89 PHP: Hypertext Preprocessor for dynamic web content
[ ] 91 Redis: Volatile in-memory non-SQL database server
[ ] 92 Certbot: Obtain and renew Let’s Encrypt SSL certs for HTTPS
[ ] 103 DietPi-RAMlog: Makes /var/log a RAM disk, preserves file structure on reboot
[ ] 104 Dropbear: Lightweight SSH server
[ ] 114 Nextcloud: File sync, sharing and collaboration platform

Usually there is no need to uninstall anything. A reinstall as described on our blog should be sufficient.

OK I followed once again the Blog instructions and finally I still had a problem with lighttpd. I did as recommended a reinstallation of lighttpd and finally it’s works (dietpi-software reinstall 84). Thanks for help

This is described on point 2.2.4 SOFTWARE MIGRATIONS as last command to be executed

dietpi-software reinstall 31 38 40 47 48 56 83 84 85 88 89 93 114 118 130 134 143

This include lighttpd (id 84) as well.

As a side note, a “reinstall” automatically skips software which is not currently installed, so it is safe to copy & paste the whole command :wink:.

Yes I have seen it but I thought it was automatically done when I copy paste the command lines, which is not automatic.
My first mistake was “uninstalling” and “installing” lighttpd instead of “reinstalling” lighttpd.

By the way after a few minutes I have had several errors on nextcloud (23.0.4) with cron which had been fixed by (for newbie like me):
. adding apc.enable_cli=1 under extension=apcu.so in the file /etc/php/7.4/mods-available/apcu.ini
. restart the dietpi-services
. and tested it with sudo -u www-data php -f /var/www/nextcloud/cron.php and checked with nextcloud

Thank you anyway.

Uninstalling Lighttpd also removed the Nextcloud specific configuration, including the APCu for CLI setting. There are other security relevant settings, so I recommend to reinstall Nextcloud (ID 114) to reapply them.

Ah yeah whenever a command that was copy pasted requires console input, like a “y” as confirmation, the following pasted commands are omitted. So indeed it is better to run them 1 by 1. Actually something we should point out on the guide.

“Uninstalling Lighttpd also removed the Nextcloud specific configuration” This is what I did the first time but then I started from a fresh image of the old system and I did what was specified by Joulinar:

dietpi-software reinstall 31 38 40 47 48 56 83 84 85 88 89 93 114 118 130 134 143

so both lighttpd and nextcloud were reinstalled and I still had little problems.

Actually something we should point out on the guide.

Yes for newbie like me, who often use copy/paste but now I will be aware of that :wink: