From 8397126152023855b7589cb06505a2fc7ff7c0c7 Mon Sep 17 00:00:00 2001 From: xavier skip Date: Fri, 29 Mar 2024 15:25:25 +0800 Subject: [PATCH 1/3] update how to modifying lighttpd configuration when you use caddy as web server --- docs/guides/webserver/caddy.md | 46 +++++++++++++++++++++++++++------- 1 file changed, 37 insertions(+), 9 deletions(-) diff --git a/docs/guides/webserver/caddy.md b/docs/guides/webserver/caddy.md index 94bbeb3b5..1fb8b4610 100644 --- a/docs/guides/webserver/caddy.md +++ b/docs/guides/webserver/caddy.md @@ -7,20 +7,16 @@ If you'd like to use [Caddy](https://caddyserver.com/) as your main web server w ## Modifying lighttpd configuration -First, change the listen port in this file: `/etc/lighttpd/lighttpd.conf:` +create your config file: `/etc/lighttpd/conf-available/04-caddy.conf` with the following content ```lighttpd -server.port = 1080 +server.port := 1080 ``` -In this case, port 1080 was chosen at random. You can use a custom port. - -BUT ANY CHANGES MADE TO THIS FILE WILL BE LOST ON THE NEXT PI-HOLE UPDATE. - -So if you want a permanent method of changing the lighttpd port and your lighttpd version >= 1.4.46, you can overwrite the port in: `/etc/lighttpd/external.conf` (note the different syntax!): +link it to `/etc/lighttpd/conf-enabled` folder -```lighttpd -server.port := 1080 +```bash +> ln -s /etc/lighttpd/conf-available/04-caddy.conf /etc/lighttpd/conf-enabled/04-caddy.conf ``` Next, restart the lighttpd server with either of these commands: @@ -35,6 +31,38 @@ or sudo service lighttpd restart ``` +if your lighttpd is throwing the following error: + +``` +network.c.369) can't bind to socket: [::]:80: Permission denied +``` + +please check file `/etc/lighttpd/lighttpd.conf` + +```lighttpd.conf +include_shell "/usr/share/lighttpd/use-ipv6.pl " + server.port +``` +is executed before the line: +```lighttpd.conf +include "/etc/lighttpd/conf-enabled/*.conf" +``` + +Update `lighttpd.conf` from: + +```lighttpd.conf +# 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.conf.pl" +include "/etc/lighttpd/conf-enabled/*.conf" +``` +to: +``` +include_shell "/usr/share/lighttpd/create-mime.conf.pl" +include "/etc/lighttpd/conf-enabled/*.conf" +# default listening port for IPv6 falls back to the IPv4 port +include_shell "/usr/share/lighttpd/use-ipv6.pl " + server.port +``` + ## Installing Caddy Follow the instructions on the [Caddy download](https://caddyserver.com/docs/download) documentation page. From 92326266dfd06eaa833da246aa3b874067502677 Mon Sep 17 00:00:00 2001 From: xavier skip Date: Fri, 29 Mar 2024 16:15:41 +0800 Subject: [PATCH 2/3] fix markdown format issue --- docs/guides/webserver/caddy.md | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/docs/guides/webserver/caddy.md b/docs/guides/webserver/caddy.md index 1fb8b4610..d6766c5c2 100644 --- a/docs/guides/webserver/caddy.md +++ b/docs/guides/webserver/caddy.md @@ -39,24 +39,28 @@ network.c.369) can't bind to socket: [::]:80: Permission denied please check file `/etc/lighttpd/lighttpd.conf` -```lighttpd.conf +```lighttpd include_shell "/usr/share/lighttpd/use-ipv6.pl " + server.port ``` + is executed before the line: -```lighttpd.conf + +```lighttpd include "/etc/lighttpd/conf-enabled/*.conf" ``` Update `lighttpd.conf` from: -```lighttpd.conf +```lighttpd # 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.conf.pl" include "/etc/lighttpd/conf-enabled/*.conf" ``` + to: -``` + +```lighttpd include_shell "/usr/share/lighttpd/create-mime.conf.pl" include "/etc/lighttpd/conf-enabled/*.conf" # default listening port for IPv6 falls back to the IPv4 port From 167275743500920956ba99779a4fe0acc555d137 Mon Sep 17 00:00:00 2001 From: xavier skip Date: Fri, 29 Mar 2024 16:25:54 +0800 Subject: [PATCH 3/3] fix MD009/no-trailing-spaces Trailing spaces --- docs/guides/webserver/caddy.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/guides/webserver/caddy.md b/docs/guides/webserver/caddy.md index d6766c5c2..01957b966 100644 --- a/docs/guides/webserver/caddy.md +++ b/docs/guides/webserver/caddy.md @@ -37,7 +37,7 @@ if your lighttpd is throwing the following error: network.c.369) can't bind to socket: [::]:80: Permission denied ``` -please check file `/etc/lighttpd/lighttpd.conf` +please check file `/etc/lighttpd/lighttpd.conf` ```lighttpd include_shell "/usr/share/lighttpd/use-ipv6.pl " + server.port