diff options
author | V3n3RiX <venerix@koprulu.sector> | 2024-05-07 00:00:56 +0100 |
---|---|---|
committer | V3n3RiX <venerix@koprulu.sector> | 2024-05-07 00:00:56 +0100 |
commit | 7bcfea9c5e79a425a62a66bba477b9d3c0d7fdd0 (patch) | |
tree | 02bad8e4f1f060d4858a1a2ec3fc9404f0b7a197 /www-servers/lighttpd/files | |
parent | 43c2a85d4e20318dd3d35872e348707900870067 (diff) |
gentoo auto-resync : 07:05:2024 - 00:00:56
Diffstat (limited to 'www-servers/lighttpd/files')
-rw-r--r-- | www-servers/lighttpd/files/conf/lighttpd.conf-r2 | 297 | ||||
-rw-r--r-- | www-servers/lighttpd/files/lighttpd-1.4.75-sparc.patch | 74 | ||||
-rw-r--r-- | www-servers/lighttpd/files/lighttpd.initd-r2 | 76 | ||||
-rw-r--r-- | www-servers/lighttpd/files/lighttpd.service-r1 | 14 |
4 files changed, 461 insertions, 0 deletions
diff --git a/www-servers/lighttpd/files/conf/lighttpd.conf-r2 b/www-servers/lighttpd/files/conf/lighttpd.conf-r2 new file mode 100644 index 000000000000..ca67355ecc5c --- /dev/null +++ b/www-servers/lighttpd/files/conf/lighttpd.conf-r2 @@ -0,0 +1,297 @@ +############################################################################### +# Default lighttpd.conf for Gentoo. +############################################################################### + +# {{{ variables +var.basedir = "/var/www/localhost" +var.logdir = "/var/log/lighttpd" +var.statedir = "/var/lib/lighttpd" +# }}} + +# {{{ modules +# At the very least, mod_access and mod_accesslog should be enabled. +# All other modules should only be loaded if necessary. +# NOTE: the order of modules is important. +server.modules = ( +# "mod_rewrite", +# "mod_redirect", +# "mod_alias", + "mod_access", +# "mod_magnet", +# "mod_auth", +# "mod_status", +# "mod_setenv", +# "mod_proxy", +# "mod_simple_vhost", +# "mod_evhost", +# "mod_userdir", +# "mod_deflate", +# "mod_ssi", +# "mod_expire", +# "mod_rrdtool", +# "mod_webdav", + "mod_accesslog" +) +# }}} + +# {{{ server settings +server.username = "lighttpd" +server.groupname = "lighttpd" + +server.document-root = var.basedir + "/htdocs" +server.pid-file = "/run/lighttpd.pid" + +server.errorlog = var.logdir + "/error.log" +# log errors to syslog instead +# server.errorlog-use-syslog = "enable" + +server.indexfiles = ("index.php", "index.html", + "index.htm", "default.htm") + +# server.tag = "lighttpd" + +# event handler +# see performance.txt +# +# for >= linux-2.6 +# server.event-handler = "epoll" # default on Linux +# for FreeBSD +# server.event-handler = "kqueue" # default on FreeBSD + +# chroot to directory (defaults to no chroot) +# server.chroot = "/" + +# bind to port (defaults to 80) +# server.port = 81 + +# bind to name (defaults to all interfaces) +# server.bind = "grisu.home.kneschke.de" + +# error-handler for status 404 +# server.error-handler-404 = "/error-handler.html" +# server.error-handler-404 = "/error-handler.php" + +# Format: <errorfile-prefix><status-code>.html +# -> ..../status-404.html for 'File not found' +# server.errorfile-prefix = var.basedir + "/error/status-" + +# support for caching stat() calls +# server.stat-cache-engine = "inotify" + +# If lighttpd was build with IPv6 support, and you would like to listen on IPv6, +# uncomment the following: +# server.use-ipv6 = "enable" + +# }}} + +# {{{ mod_staticfile + +# which extensions should not be handled via static-file transfer +# (extensions that are usually handled by mod_cgi, mod_fastcgi, etc). +static-file.exclude-extensions = (".php", ".pl", ".cgi", ".fcgi") +# }}} + +# {{{ mod_accesslog +accesslog.filename = var.logdir + "/access.log" +# }}} + +# {{{ mod_dirlisting +# enable directory listings +# dir-listing.activate = "enable" +# +# don't list hidden files/directories +# dir-listing.hide-dotfiles = "enable" +# +# use a different css for directory listings +# dir-listing.external-css = "/path/to/dir-listing.css" +# +# list of regular expressions. files that match any of the +# specified regular expressions will be excluded from directory +# listings. +# dir-listing.exclude = ("^\.", "~$") +# }}} + +# {{{ mod_access +# see access.txt + +url.access-deny = ("~", ".inc") +# }}} + +# {{{ mod_userdir +# see userdir.txt +# +# userdir.path = "public_html" +# userdir.exclude-user = ("root") +# }}} + +# {{{ mod_ssi +# see ssi.txt +# +# ssi.extension = (".shtml") +# }}} + +# {{{ mod_ssl +# see ssl.txt +# +# ssl.engine = "enable" +# ssl.pemfile = "server.pem" +# }}} + +# {{{ mod_status +# see status.txt +# +# status.status-url = "/server-status" +# status.config-url = "/server-config" +# }}} + +# {{{ mod_simple_vhost +# see simple-vhost.txt +# +# If you want name-based virtual hosting add the next three settings and load +# mod_simple_vhost +# +# document-root = +# virtual-server-root + virtual-server-default-host + virtual-server-docroot +# or +# virtual-server-root + http-host + virtual-server-docroot +# +# simple-vhost.server-root = "/home/weigon/wwwroot/servers/" +# simple-vhost.default-host = "grisu.home.kneschke.de" +# simple-vhost.document-root = "/pages/" +# }}} + +# {{{ mod_deflate +# see compress.txt +# +# deflate.cache-dir = var.statedir + "/cache/compress" +# deflate.mimetypes = ("text/plain", "text/html") +# }}} + +# {{{ mod_proxy +# see proxy.txt +# +# proxy.server = ( ".php" => +# ( "localhost" => +# ( +# "host" => "192.168.0.101", +# "port" => 80 +# ) +# ) +# ) +# }}} + +# {{{ mod_auth +# see authentication.txt +# +# auth.backend = "plain" +# auth.backend.plain.userfile = "lighttpd.user" +# auth.backend.plain.groupfile = "lighttpd.group" + +# auth.backend.ldap.hostname = "localhost" +# auth.backend.ldap.base-dn = "dc=my-domain,dc=com" +# auth.backend.ldap.filter = "(uid=$)" + +# auth.require = ( "/server-status" => +# ( +# "method" => "digest", +# "realm" => "download archiv", +# "require" => "user=jan" +# ), +# "/server-info" => +# ( +# "method" => "digest", +# "realm" => "download archiv", +# "require" => "valid-user" +# ) +# ) +# }}} + +# {{{ mod_rewrite +# see rewrite.txt +# +# url.rewrite = ( +# "^/$" => "/server-status" +# ) +# }}} + +# {{{ mod_redirect +# see redirect.txt +# +# url.redirect = ( +# "^/wishlist/(.+)" => "http://www.123.org/$1" +# ) +# }}} + +# {{{ mod_evhost +# define a pattern for the host url finding +# %% => % sign +# %0 => domain name + tld +# %1 => tld +# %2 => domain name without tld +# %3 => subdomain 1 name +# %4 => subdomain 2 name +# +# evhost.path-pattern = "/home/storage/dev/www/%3/htdocs/" +# }}} + +# {{{ mod_expire +# expire.url = ( +# "/buggy/" => "access 2 hours", +# "/asdhas/" => "access plus 1 seconds 2 minutes" +# ) +# }}} + +# {{{ mod_rrdtool +# see rrdtool.txt +# +# rrdtool.binary = "/usr/bin/rrdtool" +# rrdtool.db-name = var.statedir + "/lighttpd.rrd" +# }}} + +# {{{ mod_setenv +# see setenv.txt +# +# setenv.add-request-header = ( "TRAV_ENV" => "mysql://user@host/db" ) +# setenv.add-response-header = ( "X-Secret-Message" => "42" ) +# }}} + +# {{{ mod_webdav +# see webdav.txt +# +# $HTTP["url"] =~ "^/dav($|/)" { +# webdav.activate = "enable" +# webdav.is-readonly = "enable" +# } +# }}} + +# {{{ extra rules +# +# set Content-Encoding and reset Content-Type for browsers that +# support decompressing on-thy-fly (requires mod_setenv) +# $HTTP["url"] =~ "\.gz$" { +# setenv.add-response-header = ("Content-Encoding" => "x-gzip") +# mimetype.assign = (".gz" => "text/plain") +# } + +# $HTTP["url"] =~ "\.bz2$" { +# setenv.add-response-header = ("Content-Encoding" => "x-bzip2") +# mimetype.assign = (".bz2" => "text/plain") +# } +# +# }}} + +# {{{ debug +# debug.log-request-header = "enable" +# debug.log-response-header = "enable" +# debug.log-request-handling = "enable" +# debug.log-file-not-found = "enable" +# }}} + +# {{{ cgi includes +# uncomment for cgi support +# include "mod_cgi.conf" +# uncomment for php/fastcgi support +# include "mod_fastcgi.conf" +# }}} + +# vim: set ft=conf foldmethod=marker et : diff --git a/www-servers/lighttpd/files/lighttpd-1.4.75-sparc.patch b/www-servers/lighttpd/files/lighttpd-1.4.75-sparc.patch new file mode 100644 index 000000000000..d7bd72973b94 --- /dev/null +++ b/www-servers/lighttpd/files/lighttpd-1.4.75-sparc.patch @@ -0,0 +1,74 @@ +https://bugs.gentoo.org/931305 +https://github.com/lighttpd/lighttpd1.4/commit/524614455554163ec78b27b89ff52bbf7fe96958 + +From 524614455554163ec78b27b89ff52bbf7fe96958 Mon Sep 17 00:00:00 2001 +From: Glenn Strauss <gstrauss@gluelogic.com> +Date: Wed, 24 Apr 2024 03:07:37 -0400 +Subject: [PATCH] [core] special value for Linux POLLRDHUP on SPARC (fixes + #3251) + +x-ref: + "[1.4.76] buildroot compile error with bootlin-sparc{64-g,-uc}libc" + https://redmine.lighttpd.net/issues/3251 +--- a/src/fdevent.h ++++ b/src/fdevent.h +@@ -40,6 +40,8 @@ struct fdnode_st { + #if (defined(__sun) && defined(__SVR4)) /* Solaris */ \ + || defined(__FreeBSD__) + #define FDEVENT_RDHUP 0x4000 ++#elif (defined(__linux__) && (defined(__sparc__) || defined(__sparc))) ++#define FDEVENT_RDHUP 0x2800 /*(0x2000 EPOLLRDHUP | 0x0800 POLLRDHUP)*/ + #else + #define FDEVENT_RDHUP 0x2000 + #endif +--- a/src/fdevent_impl.c ++++ b/src/fdevent_impl.c +@@ -338,6 +338,11 @@ fdevent_linux_sysepoll_event_set (fdevents *ev, fdnode *fdn, int events) + struct epoll_event ep; + #ifndef EPOLLRDHUP + events &= ~FDEVENT_RDHUP; ++ #elif (defined(__linux__) && (defined(__sparc__) || defined(__sparc))) ++ if (events & FDEVENT_RDHUP) { ++ events &= ~FDEVENT_RDHUP; ++ events |= EPOLLRDHUP; ++ } + #endif + ep.events = events | EPOLLERR | EPOLLHUP; + ep.data.ptr = fdn; +@@ -376,7 +381,11 @@ fdevent_linux_sysepoll_init (fdevents *ev) + ck_static_assert(EPOLLERR == FDEVENT_ERR); + ck_static_assert(EPOLLHUP == FDEVENT_HUP); + #ifdef EPOLLRDHUP ++ #if (defined(__linux__) && (defined(__sparc__) || defined(__sparc))) ++ ck_static_assert(EPOLLRDHUP & FDEVENT_RDHUP); ++ #else + ck_static_assert(EPOLLRDHUP == FDEVENT_RDHUP); ++ #endif + #endif + + ev->type = FDEVENT_HANDLER_LINUX_SYSEPOLL; +@@ -770,6 +779,11 @@ fdevent_poll_event_set (fdevents *ev, fdnode *fdn, int events) + + #ifndef POLLRDHUP + events &= ~FDEVENT_RDHUP; ++ #elif (defined(__linux__) && (defined(__sparc__) || defined(__sparc))) ++ if (events & FDEVENT_RDHUP) { ++ events &= ~FDEVENT_RDHUP; ++ events |= POLLRDHUP; ++ } + #endif + + if (k >= 0) { +@@ -854,7 +868,11 @@ fdevent_poll_init (fdevents *ev) + ck_static_assert(POLLHUP == FDEVENT_HUP); + ck_static_assert(POLLNVAL == FDEVENT_NVAL); + #ifdef POLLRDHUP ++ #if (defined(__linux__) && (defined(__sparc__) || defined(__sparc))) ++ ck_static_assert(POLLRDHUP & FDEVENT_RDHUP); ++ #else + ck_static_assert(POLLRDHUP == FDEVENT_RDHUP); ++ #endif + #endif + + ev->type = FDEVENT_HANDLER_POLL; + diff --git a/www-servers/lighttpd/files/lighttpd.initd-r2 b/www-servers/lighttpd/files/lighttpd.initd-r2 new file mode 100644 index 000000000000..24539e3e80c7 --- /dev/null +++ b/www-servers/lighttpd/files/lighttpd.initd-r2 @@ -0,0 +1,76 @@ +#!/sbin/openrc-run +# Copyright 1999-2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +extra_started_commands="reload graceful" + +LIGHTTPD_PID="$($(which lighttpd) -pf ${LIGHTTPD_CONF} | grep server.pid-file | cut -d '=' -f 2 | tr -d \\\" | tr -d [:space:])" + +depend() { + need net + use mysql logger spawn-fcgi ldap slapd netmount dns + after famd + after sshd +} + +checkconfig() { + if [ ! -f "${LIGHTTPD_CONF}" ] ; then + ewarn "${LIGHTTPD_CONF} does not exist." + return 1 + fi + + if [ -z "${LIGHTTPD_PID}" ] ; then + eerror "server.pid-file variable in ${LIGHTTPD_CONF}" + eerror "is not set. Please set this variable properly" + eerror "and try again" + return 1 + fi + /usr/sbin/lighttpd -tt -f ${LIGHTTPD_CONF} >/dev/null +} + +start() { + checkconfig || return 1 + # Glean lighttpd's credentials from the configuration file + # Fixes bug 454366 + LIGHTTPD_USER="$(awk '/^server.username/{s=$3};{sub("\"","",s)};END{print s}' ${LIGHTTPD_CONF})" + LIGHTTPD_GROUP="$(awk '/^server.groupname/{s=$3};{sub("\"","",s)};END{print s}' ${LIGHTTPD_CONF})" + checkpath -d -q -m 0750 -o "${LIGHTTPD_USER}":"${LIGHTTPD_GROUP}" /run/lighttpd/ + + ebegin "Starting lighttpd" + start-stop-daemon --start --quiet --exec /usr/sbin/lighttpd \ + --pidfile "${LIGHTTPD_PID}" -- -f "${LIGHTTPD_CONF}" + eend $? +} + +stop() { + local rv=0 + ebegin "Stopping lighttpd" + start-stop-daemon --stop --quiet --pidfile "${LIGHTTPD_PID}" + eend $? +} + +reload() { + if ! service_started "${SVCNAME}" ; then + eerror "${SVCNAME} isn't running" + return 1 + fi + checkconfig || return 1 + + ebegin "Re-opening lighttpd log files" + start-stop-daemon --quiet --pidfile "${LIGHTTPD_PID}" \ + --signal HUP + eend $? +} + +graceful() { + if ! service_started "${SVCNAME}" ; then + eerror "${SVCNAME} isn't running" + return 1 + fi + checkconfig || return 1 + + ebegin "Gracefully restarting lighttpd" + start-stop-daemon --quiet --pidfile "${LIGHTTPD_PID}" \ + --signal USR1 + eend $? +} diff --git a/www-servers/lighttpd/files/lighttpd.service-r1 b/www-servers/lighttpd/files/lighttpd.service-r1 new file mode 100644 index 000000000000..2a8f22474eea --- /dev/null +++ b/www-servers/lighttpd/files/lighttpd.service-r1 @@ -0,0 +1,14 @@ +[Unit] +Description=Lighttpd Daemon +After=syslog.target network-online.target + +[Service] +Type=simple +PIDFile=/run/lighttpd.pid +ExecStartPre=/usr/sbin/lighttpd -tt -f /etc/lighttpd/lighttpd.conf +ExecStart=/usr/sbin/lighttpd -D -f /etc/lighttpd/lighttpd.conf +ExecReload=/bin/kill -USR1 $MAINPID +Restart=on-failure + +[Install] +WantedBy=multi-user.target |