From c862b524fb879f416705e85fa31539472aeff2d8 Mon Sep 17 00:00:00 2001 From: Glenn Strauss Date: Tue, 29 Nov 2022 22:22:14 -0500 Subject: [PATCH] lighttpd: lighttpd.conf vars, comments, guidance lighttpd.conf variables, documentation comments, configuration guidance Signed-off-by: Glenn Strauss --- net/lighttpd/files/lighttpd.conf | 51 ++++++++++++++++++-------------- net/lighttpd/files/lighttpd.init | 10 ++++--- 2 files changed, 35 insertions(+), 26 deletions(-) diff --git a/net/lighttpd/files/lighttpd.conf b/net/lighttpd/files/lighttpd.conf index 64640779fa..4ce516d908 100644 --- a/net/lighttpd/files/lighttpd.conf +++ b/net/lighttpd/files/lighttpd.conf @@ -1,34 +1,41 @@ -server.document-root = "/www" +### Documentation +# https://wiki.lighttpd.net/ +# +### Configuration Syntax +# https://wiki.lighttpd.net/Docs_Configuration +# +### Configuration Options +# https://wiki.lighttpd.net/Docs_ConfigurationOptions +# +### Configuration Variables (potentially used in /etc/lighttpd/conf.d/*.conf) +var.log_root = "/var/log/lighttpd/" +var.server_root = "/www/" +var.state_dir = "/var/run/" +var.home_dir = "/var/lib/lighttpd/" +var.conf_dir = "/etc/lighttpd" +var.vhosts_dir = server_root + "/vhosts" +var.cache_dir = "/var/cache/lighttpd" +var.socket_dir = home_dir + "/sockets" + +### OpenWRT lighttpd base configuration +server.document-root = server_root server.upload-dirs = ( "/tmp" ) -server.errorlog = "/var/log/lighttpd/error.log" -server.pid-file = "/var/run/lighttpd.pid" +server.errorlog = log_root + "error.log" +server.pid-file = state_dir + "lighttpd.pid" server.username = "http" server.groupname = "www-data" +# historical; preserved for compatibility; should have been disabled by default index-file.names = ( "index.php", "index.html", "index.htm", "default.htm", ) static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" ) -### Features -#https://redmine.lighttpd.net/projects/lighttpd/wiki/Server_feature-flagsDetails -server.feature-flags += ("server.graceful-shutdown-timeout" => 5) -#server.feature-flags += ("server.graceful-restart-bg" => "enable") - -### Options that are useful but not always necessary: -#server.chroot = "/" -#server.port = 81 -#server.bind = "localhost" -#server.tag = "lighttpd" -#server.errorlog-use-syslog = "enable" -#server.network-backend = "writev" - -### Use IPv6 if available -#include_shell "/usr/share/lighttpd/use-ipv6.pl" - -#dir-listing.encoding = "utf-8" -#dir-listing.activate = "enable" - include "/etc/lighttpd/mime.conf" include "/etc/lighttpd/conf.d/*.conf" + +### Customizations +# customizations should generally be placed in separate files such as +# /etc/lighttpd/conf.d/00_vars.conf # override variables for conf.d/*.conf +# /etc/lighttpd/conf.d/zz_custom.conf # override other conf.d/*.conf settings diff --git a/net/lighttpd/files/lighttpd.init b/net/lighttpd/files/lighttpd.init index 04de178451..ffaae34a21 100644 --- a/net/lighttpd/files/lighttpd.init +++ b/net/lighttpd/files/lighttpd.init @@ -16,10 +16,12 @@ validate_conf() { start_service() { user_exists http || user_add http - [ -d /var/log/lighttpd ] || { - mkdir -m 0775 -p /var/log/lighttpd - chgrp www-data /var/log/lighttpd - } + for i in /var/log/lighttpd /var/lib/lighttpd /var/cache/lighttpd; do + [ -d "$i" ] || { + mkdir -m 0775 -p "$i" + chgrp www-data "$i" + } + done validate_conf || exit 1 -- 2.30.2