mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-11-25 15:43:19 +00:00
Only remove the server.modules+=
from new config if lighttpd version is < 1.4.56 (#5133)
This commit is contained in:
commit
ce7f926e92
3 changed files with 14 additions and 10 deletions
|
@ -17,7 +17,6 @@
|
||||||
|
|
||||||
server.modules = (
|
server.modules = (
|
||||||
"mod_access",
|
"mod_access",
|
||||||
"mod_accesslog",
|
|
||||||
"mod_auth",
|
"mod_auth",
|
||||||
"mod_expire",
|
"mod_expire",
|
||||||
"mod_redirect",
|
"mod_redirect",
|
||||||
|
@ -34,8 +33,6 @@ server.groupname = "www-data"
|
||||||
# For lighttpd version 1.4.46 or above, the port can be overwritten in `/etc/lighttpd/external.conf` using the := operator
|
# For lighttpd version 1.4.46 or above, the port can be overwritten in `/etc/lighttpd/external.conf` using the := operator
|
||||||
# e.g. server.port := 8000
|
# e.g. server.port := 8000
|
||||||
server.port = 80
|
server.port = 80
|
||||||
accesslog.filename = "/var/log/lighttpd/access-pihole.log"
|
|
||||||
accesslog.format = "%{%s}t|%V|%r|%s|%b"
|
|
||||||
|
|
||||||
# Allow streaming response
|
# Allow streaming response
|
||||||
# reference: https://redmine.lighttpd.net/projects/lighttpd/wiki/Server_stream-response-bodyDetails
|
# reference: https://redmine.lighttpd.net/projects/lighttpd/wiki/Server_stream-response-bodyDetails
|
||||||
|
|
|
@ -35,8 +35,6 @@ server.groupname = "lighttpd"
|
||||||
# For lighttpd version 1.4.46 or above, the port can be overwritten in `/etc/lighttpd/external.conf` using the := operator
|
# For lighttpd version 1.4.46 or above, the port can be overwritten in `/etc/lighttpd/external.conf` using the := operator
|
||||||
# e.g. server.port := 8000
|
# e.g. server.port := 8000
|
||||||
server.port = 80
|
server.port = 80
|
||||||
accesslog.filename = "/var/log/lighttpd/access-pihole.log"
|
|
||||||
accesslog.format = "%{%s}t|%V|%r|%s|%b"
|
|
||||||
|
|
||||||
# Allow streaming response
|
# Allow streaming response
|
||||||
# reference: https://redmine.lighttpd.net/projects/lighttpd/wiki/Server_stream-response-bodyDetails
|
# reference: https://redmine.lighttpd.net/projects/lighttpd/wiki/Server_stream-response-bodyDetails
|
||||||
|
|
|
@ -1432,14 +1432,23 @@ installConfigs() {
|
||||||
elif [[ -d "/etc/lighttpd/conf-available" ]]; then
|
elif [[ -d "/etc/lighttpd/conf-available" ]]; then
|
||||||
conf=/etc/lighttpd/conf-available/15-pihole-admin.conf
|
conf=/etc/lighttpd/conf-available/15-pihole-admin.conf
|
||||||
install -D -m 644 -T ${PI_HOLE_LOCAL_REPO}/advanced/pihole-admin.conf $conf
|
install -D -m 644 -T ${PI_HOLE_LOCAL_REPO}/advanced/pihole-admin.conf $conf
|
||||||
# disable server.modules += ( ... ) in $conf to avoid module dups
|
|
||||||
# (needed until Debian 10 no longer supported by pi-hole)
|
# Get the version number of lighttpd
|
||||||
|
version=$(dpkg-query -f='${Version}\n' --show lighttpd)
|
||||||
|
# Test if that version is greater than or euqal to 1.4.56
|
||||||
|
if dpkg --compare-versions "$version" "ge" "1.4.56"; then
|
||||||
|
# If it is, then we don't need to disable the modules
|
||||||
# (server.modules duplication is ignored in lighttpd 1.4.56+)
|
# (server.modules duplication is ignored in lighttpd 1.4.56+)
|
||||||
|
:
|
||||||
|
else
|
||||||
|
# disable server.modules += ( ... ) in $conf to avoid module dups
|
||||||
if awk '!/^server\.modules/{print}' $conf > $conf.$$ && mv $conf.$$ $conf; then
|
if awk '!/^server\.modules/{print}' $conf > $conf.$$ && mv $conf.$$ $conf; then
|
||||||
:
|
:
|
||||||
else
|
else
|
||||||
rm $conf.$$
|
rm $conf.$$
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
chmod 644 $conf
|
chmod 644 $conf
|
||||||
if is_command lighty-enable-mod ; then
|
if is_command lighty-enable-mod ; then
|
||||||
lighty-enable-mod pihole-admin access accesslog redirect fastcgi setenv > /dev/null || true
|
lighty-enable-mod pihole-admin access accesslog redirect fastcgi setenv > /dev/null || true
|
||||||
|
|
Loading…
Reference in a new issue