From f8bef6451f27ee5c328bde7151e72e7b98213da1 Mon Sep 17 00:00:00 2001 From: Glenn Strauss Date: Sun, 18 Dec 2022 03:54:39 -0500 Subject: [PATCH] lighttpd doc Signed-off-by: Glenn Strauss --- docs/guides/webserver/lighttpd.md | 58 +++++++++++++++++++++++++++++++ docs/main/faq.md | 2 +- mkdocs.yml | 2 ++ 3 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 docs/guides/webserver/lighttpd.md diff --git a/docs/guides/webserver/lighttpd.md b/docs/guides/webserver/lighttpd.md new file mode 100644 index 000000000..f2d20170b --- /dev/null +++ b/docs/guides/webserver/lighttpd.md @@ -0,0 +1,58 @@ +### Notes & Warnings + +- **This is an unsupported configuration created by the community** + +### Basic requirements + +1. Run [basic-install](/main/basic-install/) and choose to install the Admin Web Interface. + lighttpd is the default webserver installed and used by the pi-hole Admin Web Interface. + +### Optional configuration + +lighttpd config with [BLOCK\_IPV4](/ftldns/configfile/#block_ipv4) or [BLOCK\_IPV6](/ftldns/configfile/#block_ipv6) +(Note this does not work with TLS due to local server not having local TLS certificates for 1.6+ million ad domains) + +Option 1: configure lighttpd 404 error handler (compatibility with old pi-hole behavior) +Sample handler: pi-hole used to provide /var/www/html/pihole/[index.php](https://github.com/pi-hole/pi-hole/blob/v5.14.2/advanced/index.php) +Adjust `server.error-handler-404` to be the url-path from the virtual host document root (e.g. `/var/www/html`). +If not already enabled, the global lighttpd.conf must be configured for mod\_fastcgi to handle `.php`. +(Alternatively, `/pihole/index.php` could instead be an empty file `/404.txt`) + +Fedora: + + ```bash + echo 'server.error-handler-404 := "/pihole/index.php"' > /etc/lighttpd/conf.d/pihole-block-ip.conf + echo 'include "/etc/lighttpd/conf.d/pihole-block-ip*.conf"' >> /etc/lighttpd/lighttpd.conf + service lighttpd restart + ``` + +Debian: + + ```bash + echo 'server.error-handler-404 := "/pihole/index.php"' > /etc/lighttpd/conf-available2/08-pihole-block-ip.conf + lighty-enable-mod pihole-block-ip + service lighttpd restart + ``` + +Option 2: configure lighttpd mod\_magnet + +Download, review, and copy [pihole-block-ip.lua](https://github.com/gstrauss/pi-hole/blob/lighttpd-lua/advanced/pihole.lua) to `/etc/lighttpd/pihole-block-ip.lua` +(sample lua app created by lighttpd dev, also replacing `pihole-admin.conf`) + +Fedora: + + ```bash + echo 'server.modules += ("mod_magnet")' > /etc/lighttpd/conf.d/pihole-block-ip.conf + echo 'magnet.attract-physical-path-to += ("/etc/lighttpd/pihole-block-ip.lua")' >> /etc/lighttpd/conf.d/pihole-block-ip.conf + echo 'include "/etc/lighttpd/conf.d/pihole-block-ip*.conf"' >> /etc/lighttpd/lighttpd.conf + service lighttpd restart + ``` + +Debian: + + ```bash + echo 'server.modules += ("mod_magnet")' > /etc/lighttpd/conf.d/pihole-block-ip.conf + echo 'magnet.attract-physical-path-to += ("/etc/lighttpd/pihole-block-ip.lua")' >> /etc/lighttpd/conf.d/pihole-block-ip.conf + lighty-enable-mod pihole-block-ip + service lighttpd restart + ``` diff --git a/docs/main/faq.md b/docs/main/faq.md index a352c4bf2..8d4edc5ec 100644 --- a/docs/main/faq.md +++ b/docs/main/faq.md @@ -61,7 +61,7 @@ If requesting a lot of data from the long-term database you get this error ```code An unknown error occurred while loading the data. -Check the server's log files (/var/log/lighttpd/error-pihole.log) for details. +Check the server's log files (/var/log/lighttpd/error*.log) for details. You may need to increase PHP memory limit. diff --git a/mkdocs.yml b/mkdocs.yml index 5bb55224d..29260729c 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -183,6 +183,7 @@ nav: - 'Using DNSSEC': guides/misc/tor/dnssec.md - 'Whitelist and Blacklist editing': guides/misc/whitelist-blacklist.md - 'Web server': + - 'lighttpd': guides/webserver/lighttpd.md - 'NGINX': guides/webserver/nginx.md - 'Caddy': guides/webserver/caddy.md - 'Traefik v1 (not in Docker)': guides/webserver/traefik-nodocker.md @@ -238,6 +239,7 @@ plugins: 'guides/tor/performance-issues.md': guides/misc/tor/performance-issues.md 'guides/tor/dnssec.md': guides/misc/tor/dnssec.md 'guides/whitelist-blacklist.md': guides/misc/whitelist-blacklist.md + 'guides/lighttpd-configuration.md': 'guides/webserver/lighttpd.md' 'guides/nginx-configuration.md': 'guides/webserver/nginx.md' 'guides/caddy-configuration.md': 'guides/webserver/caddy.md' 'guides/traefik-configuration-nodocker.md': 'guides/webserver/traefik-nodocker.md'