[crux-commits] ports/contrib (3.6): lighttpd: adopt port; update to 1.4.59

crux at crux.nu crux at crux.nu
Fri Feb 5 01:20:46 UTC 2021


commit 04fe9e3a3b6f383f4552483b22dda2228dfe0a51
Author: Steffen Nurpmeso <steffen at sdaoden.eu>
Date:   Fri Feb 5 02:19:41 2021 +0100

    lighttpd: adopt port; update to 1.4.59

diff --git a/lighttpd/.footprint b/lighttpd/.footprint
index 4828aa683..def3d9d8d 100644
--- a/lighttpd/.footprint
+++ b/lighttpd/.footprint
@@ -1,10 +1,12 @@
 drwxr-xr-x	root/root	etc/
--rw-r--r--	root/root	etc/lighttpd.conf
+drwxr-xr-x	root/root	etc/lighttpd/
+-rw-r--r--	root/root	etc/lighttpd/cgi.conf
+-rw-r--r--	root/root	etc/lighttpd/dirlisting.conf
+-rw-r--r--	root/root	etc/lighttpd/fastcgi.conf
+-rw-r--r--	root/root	etc/lighttpd/lighttpd.conf
+-rw-r--r--	root/root	etc/lighttpd/userdir.conf
 drwxr-xr-x	root/root	etc/rc.d/
 -rwxr-xr-x	root/root	etc/rc.d/lighttpd
-drwxr-xr-x	root/root	etc/ssl/
-drwxr-xr-x	root/root	etc/ssl/certs/
--rw-------	root/root	etc/ssl/certs/lighttpd.pem (EMPTY)
 drwxr-xr-x	root/root	usr/
 drwxr-xr-x	root/root	usr/lib/
 drwxr-xr-x	root/root	usr/lib/lighttpd/
@@ -12,14 +14,20 @@ drwxr-xr-x	root/root	usr/lib/lighttpd/
 -rwxr-xr-x	root/root	usr/lib/lighttpd/mod_access.so
 -rwxr-xr-x	root/root	usr/lib/lighttpd/mod_accesslog.la
 -rwxr-xr-x	root/root	usr/lib/lighttpd/mod_accesslog.so
+-rwxr-xr-x	root/root	usr/lib/lighttpd/mod_ajp13.la
+-rwxr-xr-x	root/root	usr/lib/lighttpd/mod_ajp13.so
 -rwxr-xr-x	root/root	usr/lib/lighttpd/mod_alias.la
 -rwxr-xr-x	root/root	usr/lib/lighttpd/mod_alias.so
 -rwxr-xr-x	root/root	usr/lib/lighttpd/mod_auth.la
 -rwxr-xr-x	root/root	usr/lib/lighttpd/mod_auth.so
 -rwxr-xr-x	root/root	usr/lib/lighttpd/mod_authn_file.la
 -rwxr-xr-x	root/root	usr/lib/lighttpd/mod_authn_file.so
+-rwxr-xr-x	root/root	usr/lib/lighttpd/mod_authn_pam.la
+-rwxr-xr-x	root/root	usr/lib/lighttpd/mod_authn_pam.so
 -rwxr-xr-x	root/root	usr/lib/lighttpd/mod_cgi.la
 -rwxr-xr-x	root/root	usr/lib/lighttpd/mod_cgi.so
+-rwxr-xr-x	root/root	usr/lib/lighttpd/mod_cml.la
+-rwxr-xr-x	root/root	usr/lib/lighttpd/mod_cml.so
 -rwxr-xr-x	root/root	usr/lib/lighttpd/mod_deflate.la
 -rwxr-xr-x	root/root	usr/lib/lighttpd/mod_deflate.so
 -rwxr-xr-x	root/root	usr/lib/lighttpd/mod_dirlisting.la
@@ -38,6 +46,8 @@ drwxr-xr-x	root/root	usr/lib/lighttpd/
 -rwxr-xr-x	root/root	usr/lib/lighttpd/mod_flv_streaming.so
 -rwxr-xr-x	root/root	usr/lib/lighttpd/mod_indexfile.la
 -rwxr-xr-x	root/root	usr/lib/lighttpd/mod_indexfile.so
+-rwxr-xr-x	root/root	usr/lib/lighttpd/mod_magnet.la
+-rwxr-xr-x	root/root	usr/lib/lighttpd/mod_magnet.so
 -rwxr-xr-x	root/root	usr/lib/lighttpd/mod_openssl.la
 -rwxr-xr-x	root/root	usr/lib/lighttpd/mod_openssl.so
 -rwxr-xr-x	root/root	usr/lib/lighttpd/mod_proxy.la
@@ -85,7 +95,8 @@ drwxr-xr-x	root/root	usr/share/man/man8/
 -rw-r--r--	root/root	usr/share/man/man8/lighttpd-angel.8.gz
 -rw-r--r--	root/root	usr/share/man/man8/lighttpd.8.gz
 drwxr-xr-x	root/root	var/
-drwxr-xr-x	root/root	var/run/
+drwxr-xr-x	root/root	var/log/
+drwxr-xr-x	root/root	var/log/lighttpd/
 drwxr-xr-x	root/root	var/www/
-drwxr-xr-x	root/root	var/www/htdocs/
-drwxr-xr-x	root/root	var/www/logs/
+drwxr-xr-x	root/root	var/www/lighttpd/
+drwxr-xr-x	root/root	var/www/lighttpd/htdocs/
diff --git a/lighttpd/.signature b/lighttpd/.signature
index 09c3f183f..61cc674c8 100644
--- a/lighttpd/.signature
+++ b/lighttpd/.signature
@@ -1,7 +1,11 @@
 untrusted comment: verify with /etc/ports/contrib.pub
-RWSagIOpLGJF334F+4teGIuS8Qao9R7euY09XlaY3UuSrZDHGQjiYggxQs12H+9vq3rpAM/V7emXoFL2AiCkvmMZQquwzhAYJg0=
-SHA256 (Pkgfile) = 705dbac47d161cdc95c6c35b06e97a3e8ba0828a6952f2840c2335417dac8384
-SHA256 (.footprint) = f2dbc24896b495026df5d8cae44706b5c1fa6d9d49c38baa21865fc68ecff4ec
-SHA256 (lighttpd-1.4.58.tar.xz) = 267feffda13a190ebdce7b15172d8be16da98008457f30fddecd72832d126d0e
-SHA256 (lighttpd.conf) = fd994cfccc2a67b625acc57373c45195f14cd02fda60b4e2af014ba5f4d560ca
-SHA256 (lighttpd.rc) = ba07175f8b59b60a1391680be2636f7fab10d749ebf4e56a4f78d8b2422c5b07
+RWSagIOpLGJF357V0/61f8BIortskpMO/gLFcxfId6vlFbg1IPsWVu+xdtDaO9r6pFz7Q1jSgwk1eYtbGAI44PQ1WxaxtnIRIgU=
+SHA256 (Pkgfile) = 1a0f9ccb668014100251da808ee3fc84f0433e4b1de0758b21a916af5f1a07ff
+SHA256 (.footprint) = 7b124b8ef5d18e01b14210013544cd57341fe010f53ac39df137962af90c20ca
+SHA256 (lighttpd-1.4.59.tar.xz) = fb953db273daef08edb6e202556cae8a3d07eed6081c96bd9903db957d1084d5
+SHA256 (lighttpd.rc) = 239560128d32a8babfaa19f0baded545e7d0ae0f3ead4cb81928f6188c4d9ed8
+SHA256 (lighttpd.conf) = 484b5805549ec18675df8e219f0a9e3e4527623e04677a57dc7e605ad3678bfb
+SHA256 (cgi.conf) = c94f2e34462b82f3c33bd7db74e8d3c0c4e6454021d396e2a01a6ac7e252917b
+SHA256 (dirlisting.conf) = 3d14b80061bc570b2c27e9d1e915902c4df1d8c5307c3ea9a88cf44376d9d541
+SHA256 (fastcgi.conf) = 74b3906e82498ada1ffc02d5d2b145f502aaf191ba9189fe13c014dcc61f5f75
+SHA256 (userdir.conf) = e4b410a368c42aa45556d8987870f112bbe7539fa8e0cb5285a7b34ba43e3b92
diff --git a/lighttpd/Pkgfile b/lighttpd/Pkgfile
index 0bcccdb8d..4deb6506d 100644
--- a/lighttpd/Pkgfile
+++ b/lighttpd/Pkgfile
@@ -1,27 +1,33 @@
 # Description: Secure, fast, compliant and very flexible web server
-# URL: http://www.lighttpd.net/
-# Maintainer:  Thomas Penteker, tek at serverop dot de
-# Depends on: libpcre
+# URL:         https://www.lighttpd.net/
+# Maintainer:  Steffen Nurpmeso, steffen at sdaoden dot eu
+# Depends on:  libpcre lua
 
 name=lighttpd
-version=1.4.58
+version=1.4.59
 release=1
-source=(https://download.$name.net/$name/releases-1.4.x/$name-$version.tar.xz \
-        $name.conf \
-        $name.rc)
+source=(
+  https://download.${name}.net/${name}/releases-1.4.x/${name}-${version}.tar.xz
+   ${name}.rc ${name}.conf
+   cgi.conf dirlisting.conf fastcgi.conf userdir.conf
+)
 
 build() {
-    cd $name-$version
-    ./configure --prefix=/usr --libdir=/usr/lib/$name --with-openssl --with-pcre
+    cd ${name}-${version}
+
+    ./configure --prefix=/usr \
+       --libdir=/usr/lib/${name} \
+       --with-openssl --with-pam \
+         --with-bzip2 --with-zlib --with-zstd \
+      --with-pcre --with-lua
     make
     make DESTDIR=$PKG install
 
-    install -D -m 644 $SRC/$name.conf $PKG/etc/$name.conf
-    install -D -m 755 $SRC/$name.rc $PKG/etc/rc.d/$name
-    install -d $PKG/var/www/{htdocs,logs}
-    install -d $PKG/var/run
-    install -d $PKG/etc/ssl/certs
-    #touch $PKG/var/run/lighttpd.pid
-    touch $PKG/etc/ssl/certs/lighttpd.pem
-    chmod 0600 $PKG/etc/ssl/certs/lighttpd.pem
+    install -D -m 0755 "${SRC}"/${name}.rc "${PKG}"/etc/rc.d/${name}
+    install -d -m 0755 "${PKG}"/etc/${name}
+    install -D -m 0644 "${SRC}"/*.conf "${PKG}"/etc/${name}/
+    install -d -m 0755 "${PKG}"/var/log/${name}
+    install -d -m 0755 "${PKG}"/var/www/${name}/htdocs
 }
+
+# s-sh-mode
diff --git a/lighttpd/README b/lighttpd/README
deleted file mode 100644
index 0acea5286..000000000
--- a/lighttpd/README
+++ /dev/null
@@ -1,26 +0,0 @@
-REQUIREMENTS
-
-PRE-INSTALL
-
-POST-INSTALL
-
-lighttpd runs as a different user ('lighttpd') by default for security reasons.
-Do the following after installing the port:
-
-  useradd -s /bin/false lighttpd
-  groupadd lighttpd
-  touch /var/www/logs/access_log
-  touch /var/www/logs/error_log
-  chown lighttpd:lighttpd /var/www/logs/*
-
-If you wish to enable SSL support, uncomment the relevant lines in 
-/etc/lighttpd.conf and generate a self-signed certificate:
-
-  openssl req -new -x509 \
-  -keyout /etc/ssl/certs/lighttpd.pem -out /etc/ssl/certs/lighttpd.pem \
-  -days 365 -nodes
-
-PRECAUTION
-
-As of lighttpd 1.4.23 spawn-fcgi was removed and is now provided as a separate
-project at http://redmine.lighttpd.net/projects/spawn-fcgi
diff --git a/lighttpd/cgi.conf b/lighttpd/cgi.conf
new file mode 100644
index 000000000..ac956099a
--- /dev/null
+++ b/lighttpd/cgi.conf
@@ -0,0 +1,60 @@
+#######################################################################
+##
+##  CGI modules
+## --------------- 
+##
+## See https://redmine.lighttpd.net/projects/lighttpd/wiki/docs_modcgi
+##
+server.modules += ( "mod_cgi" )
+
+##
+## Plain old CGI handling
+##
+## For PHP don't forget to set cgi.fix_pathinfo = 1 in the php.ini.
+##
+cgi.assign                 = ( ".pl"  => "/usr/bin/perl",
+                               ".cgi" => "/usr/bin/perl",
+                               ".rb"  => "/usr/bin/ruby",
+                               ".erb" => "/usr/bin/eruby",
+                               ".py"  => "/usr/bin/python" )
+
+##
+## to get the old cgi-bin behavior of apache
+##
+## Note: make sure that mod_alias is loaded if you uncomment the
+##       next line. (see modules.conf)
+##
+#alias.url += ( "/cgi-bin" => server_root + "/cgi-bin" )
+#$HTTP["url"] =~ "^/cgi-bin" {
+#   cgi.assign = ( "" => "" )
+#}
+
+##
+## require execute permission (+x) on files for CGI scripts
+## default: disable
+##
+#cgi.execute-x-only = "enable"
+
+##
+## process X-Sendfile (if present) from CGI response
+## https://redmine.lighttpd.net/projects/lighttpd/wiki/Docs_ModFastCGI#X-Sendfile
+## default: disable
+##
+#cgi.x-sendfile = "enable"
+#cgi.x-sendfile-docroot = ( "/srv/www/html", "/srv/www/static" )
+
+##
+## Local Redirect Response optimization
+## https://www.ietf.org/rfc/rfc3875 6.2.2 Local Redirect Response optimization
+## default: disable
+##
+#cgi.local-redir = "enable"
+
+##
+## permit Upgrade, e.g. Upgrade: websocket
+## default: disable
+##
+#cgi.upgrade = "enable"
+
+##
+#######################################################################
diff --git a/lighttpd/dirlisting.conf b/lighttpd/dirlisting.conf
new file mode 100644
index 000000000..982121d7f
--- /dev/null
+++ b/lighttpd/dirlisting.conf
@@ -0,0 +1,95 @@
+#######################################################################
+##
+##  Dirlisting Module 
+## ------------------- 
+##
+## See https://redmine.lighttpd.net/projects/lighttpd/wiki/Docs_ModDirlisting
+##
+
+##
+## Enabled Directory listing
+## default: disable
+#dir-listing.activate      = "enable"
+
+##
+## Hide dot files from the listing?
+## By default they are hidden (not listed).
+## default: enable
+#dir-listing.hide-dotfiles = "enable"
+
+##
+## list of regular expressions. Files that match any of the specified
+## regular expressions will be excluded from directory listings.
+##
+dir-listing.exclude       = ( "~$" )
+
+##
+## set a encoding for the generated directory listing
+##
+## If you file-system is not using ASCII you have to set the encoding of
+## the filenames as they are put into the HTML listing AS IS (with XML
+## encoding)
+##
+dir-listing.encoding = "UTF-8"
+
+##
+## local URL to optional CSS stylesheet for the directory listing
+##
+#dir-listing.external-css  = "/dirindex.css"
+
+##
+## local URL to optional js script to include,
+## e.g. for client side directory list sorting
+##
+#dir-listing.external-js = "/dirindex.js"
+
+##
+## Include HEADER.txt files above the directory listing. 
+## default: disable
+##
+#dir-listing.show-header = "enable"
+##
+## You can disable showing the HEADER.txt in the listing. 
+## default: disable (shows file in listing)
+##
+#dir-listing.hide-header-file = "enable"
+##
+## HTML-encode HEADER.txt
+## (disable to include files as-is, e.g. if files contain valid HTML)
+## default: enable
+##
+#dir-listing.encode-header = "disable"
+
+##
+## Include README.txt files above the directory listing. 
+## default: disable
+##
+#dir-listing.show-readme = "enable"
+##
+## You can disable showing the README.txt in the listing. 
+## default: disable (shows file in listing)
+##
+#dir-listing.hide-readme-file = "enable"
+##
+## HTML-encode README.txt
+## (disable to include files as-is, e.g. if files contain valid HTML)
+## default: enable
+##
+#dir-listing.encode-readme = "disable"
+
+##
+## displays a string in the footer of a listing page
+## default: value of server.tag directive
+##   "<PACKAGE_NAME>/<PACKAGE_VERSION>" e.g. "lighttpd/1.4.56"
+##
+#dir-listing.set-footer = " "
+
+##
+## Use lighttpd-provided page tags <body> and <html>
+## (disable if HEADER.txt and README.txt provide those tags)
+## default: enable
+##
+#dir-listing.auto-layout = "disable"
+
+##
+#######################################################################
diff --git a/lighttpd/fastcgi.conf b/lighttpd/fastcgi.conf
new file mode 100644
index 000000000..0760af06f
--- /dev/null
+++ b/lighttpd/fastcgi.conf
@@ -0,0 +1,132 @@
+#######################################################################
+##
+##  FastCGI Module 
+## --------------- 
+##
+## See https://redmine.lighttpd.net/projects/lighttpd/wiki/Docs_ModFastCGI
+##
+server.modules += ( "mod_fastcgi" )
+
+##
+## PHP Example
+## For PHP don't forget to set cgi.fix_pathinfo = 1 in the php.ini.
+##
+## The number of php processes you will get can be easily calculated:
+##
+## num-procs = max-procs * ( 1 + PHP_FCGI_CHILDREN )
+##
+## for the php-num-procs example it means you will get 17*5 = 85 php
+## processes. you always should need this high number for your very
+## busy sites. And if you have a lot of RAM. :)
+##
+#fastcgi.server = ( ".php" =>
+#                   ( "php-local" =>
+#                     (
+#                       "socket" => socket_dir + "/php-fastcgi-1.socket",
+#                       "bin-path" => server_root + "/cgi-bin/php5",
+#                       "max-procs" => 1,
+#                       "broken-scriptfilename" => "enable",
+#                     ),
+#                     "php-tcp" =>
+#                     (
+#                       "host" => "127.0.0.1",
+#                       "port" => 9999,
+#                       "check-local" => "disable",
+#                       "broken-scriptfilename" => "enable",
+#                     ),
+#                     "php-num-procs" =>
+#                     (
+#                       "socket" => socket_dir + "/php-fastcgi-2.socket",
+#                       "bin-path" => server_root + "/cgi-bin/php5",
+#                       "bin-environment" => (
+#                         "PHP_FCGI_CHILDREN" => "16",
+#                         "PHP_FCGI_MAX_REQUESTS" => "10000",
+#                       ),
+#                       "max-procs" => 5,
+#                       "broken-scriptfilename" => "enable",
+#                     ),
+#                   ),
+#                 )
+
+##
+## Ruby on Rails Example
+##
+## Normally you only run one Rails application on one vhost.
+##
+#$HTTP["host"] == "rails1.example.com" {
+#  server.document-root  = server_root + "/rails/someapp/public"
+#  server.error-handler-404 = "/dispatch.fcgi"
+#  fastcgi.server = ( ".fcgi" =>
+#    ("someapp" =>
+#      ( "socket" => socket_dir + "/someapp-fcgi.socket",
+#        "bin-path" => server_root + "/rails/someapp/public/dispatch.fcgi",
+#        "bin-environment" => (
+#              "RAILS_ENV" => "production",
+#              "TMP" => home_dir + "/rails/someapp",
+#        ),
+#      )
+#    )
+#  )
+#}
+
+##
+## Another example with multiple rails applications on one vhost.
+##
+## https://blog.lighttpd.net/articles/2005/11/23/lighttpd-1-4-8-and-multiple-rails-apps
+##
+#$HTTP["host"] == "rails2.example.com" {
+#  $HTTP["url"] =~ "^/someapp1" {
+#    server.document-root  = server_root + "/rails/someapp1/public"
+#    server.error-handler-404 = "/dispatch.fcgi"
+#    fastcgi.server = ( ".fcgi" =>
+#      ("someapp1" =>
+#        ( "socket" => socket_dir + "/someapp1-fcgi.socket",
+#          "bin-path" => server_root + "/rails/someapp1/public/dispatch.fcgi",
+#          "bin-environment" => (
+#                "RAILS_ENV" => "production",
+#                "TMP" => home_dir + "/rails/someapp1",
+#          ),
+#          "strip-request-uri" => "/someapp1/"
+#        )
+#      )
+#    )
+#  }
+#
+#  $HTTP["url"] =~ "^/someapp2" {
+#    server.document-root  = server_root + "/rails/someapp2/public"
+#    server.error-handler-404 = "/dispatch.fcgi"
+#    fastcgi.server = ( ".fcgi" =>
+#      ("someapp2" =>
+#        ( "socket" => socket_dir + "/someapp2-fcgi.socket",
+#          "bin-path" => server_root + "/rails/someapp2/public/dispatch.fcgi",
+#          "bin-environment" => (
+#                "RAILS_ENV" => "production",
+#                "TMP" => home_dir + "/rails/someapp2",
+#          ),
+#          "strip-request-uri" => "/someapp2/"
+#        )
+#      )
+#    )
+#  }
+#}
+
+## chrooted webserver + external PHP
+##
+## $ spawn-fcgi -f /usr/bin/php-cgi -p 2000 -a 127.0.0.1 -C 8
+##
+## webserver chrooted to /srv/www/
+## php running outside the chroot
+#
+#fastcgi.server = ( 
+#  ".php" => (( 
+#    "host" => "127.0.0.1",
+#    "port" => "2000",
+#    "docroot" => "/srv/www/servers/www.example.org/htdocs/"
+#  )))
+#
+#server.chroot = "/srv/www"
+#server.document-root = "/servers/wwww.example.org/htdocs/"
+#
+
+##
+#######################################################################
diff --git a/lighttpd/lighttpd.conf b/lighttpd/lighttpd.conf
index e112f77b5..fa94eaf8b 100644
--- a/lighttpd/lighttpd.conf
+++ b/lighttpd/lighttpd.conf
@@ -1,204 +1,721 @@
-#
-# /etc/lighttpd.conf: lighttpd(1) configuration
-#
-
-# to use mod_rewrite you have to compile lighttpd with libpcre installed
-server.modules = ("mod_accesslog")
+###############################################################################
+# Default lighttpd.conf for Gentoo.
+# $Header: /var/cvsroot/gentoo-x86/www-servers/lighttpd/files/conf/lighttpd.conf,v 1.3 2005/09/01 14:22:35 ka0ttic Exp $
+###############################################################################
 
-server.port = 80
-server.username = "lighttpd"
-server.groupname = "lighttpd"
-server.pid-file = "/var/run/lighttpd.pid"
+# {{{ variables
+var.basedir  = "/var/www/lighttpd"
+var.logdir   = "/var/log/lighttpd"
+var.statedir = "/var/lib/lighttpd"
+# }}}
 
-# ssl support
-#server.port = 443
-#ssl.engine = "enable"
-#ssl.pemfile = "/etc/ssl/certs/lighttpd.pem"
-
-# chrooted operation
-server.chroot = "/var/www"
-server.document-root = "/htdocs"
-server.errorlog = "/logs/error_log"
-accesslog.filename = "/logs/access_log"
-
-# non-chrooted operation
-#server.document-root = "/var/www/htdocs"
-#server.errorlog = "/var/www/logs/error_log"
-#accesslog.filename = "/var/www/logs/access_log"
+# {{{ 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_cml",
+#    "mod_trigger_b4_dl",
+#    "mod_auth",
+#    "mod_status",
+#    "mod_setenv",
+#    "mod_proxy",
+#    "mod_simple_vhost",
+#    "mod_evhost",
+#    "mod_userdir",
+#    "mod_compress",
+#    "mod_ssi",
+#    "mod_usertrack",
+#    "mod_expire",
+#    "mod_secdownload",
+#    "mod_rrdtool",
+#    "mod_webdav",
+    "mod_accesslog"
+)
+# }}}
 
-server.dir-listing = "enable"
-server.indexfiles = ("index.html", "index.htm", "default.htm")
+# {{{ includes
+# uncomment for cgi support
+#   include "mod_cgi.conf"
+# uncomment for php/fastcgi support
+#   include "mod_fastcgi.conf"
+# uncomment for php/fastcgi fpm support
+#   include "mod_fastcgi_fpm.conf"
+# }}}
 
-mimetype.assign = (
-	".ai" => "application/postscript",
-	".aif" => "audio/x-aiff",
-	".aifc" => "audio/x-aiff",
-	".aiff" => "audio/x-aiff",
-	".arj" => "application/x-arj-compressed",
-	".asc" => "text/plain",
-	".atom" => "application/atom+xml",
-	".au" => "audio/ulaw",
-	".avi" => "video/x-msvideo",
-	".bat" => "application/x-msdos-program",
-	".bcpio" => "application/x-bcpio",
+mimetype.assign = ( # {{{
+	".tar.bz2" => "application/x-gtar-compressed",
+	".tar.gz" => "application/x-gtar-compressed",
+	".cbor" => "application/cbor",
+	".efi" => "application/efi",
+	".epub" => "application/epub+zip",
+	".gz" => "application/gzip",
+	".tgz" => "application/gzip",
+	".js" => "application/javascript",
+	".json" => "application/json",
+	".json-patch" => "application/json-patch+json",
+	".mbox" => "application/mbox",
+	".doc" => "application/msword",
+	".mxf" => "application/mxf",
 	".bin" => "application/octet-stream",
-	".bmp" => "image/bmp",
-	".cdf" => "application/x-netcdf",
-	".cgm" => "image/cgm",
 	".class" => "application/octet-stream",
-	".com" => "application/x-msdos-program",
-	".cpio" => "application/x-cpio",
-	".cpt" => "application/mac-compactpro",
-	".csh" => "application/x-csh",
-	".css" => "text/css",
-	".dcr" => "application/x-director",
-	".deb" => "application/x-debian-package",
-	".dir" => "application/x-director",
-	".djv" => "image/vnd.djvu",
-	".djvu" => "image/vnd.djvu",
-	".dl" => "video/dl",
 	".dll" => "application/octet-stream",
-	".dmg" => "application/octet-stream",
-	".dms" => "application/octet-stream",
-	".doc" => "application/msword",
-	".dtd" => "application/xml-dtd",
-	".dvi" => "application/x-dvi",
-	".dxr" => "application/x-director",
-	".eps" => "application/postscript",
-	".etx" => "text/x-setext",
-	".exe" => "application/x-msdos-program",
-	".ez" => "application/andrew-inset",
-	".fli" => "video/fli",
-	".gif" => "image/gif",
-	".gl" => "video/gl",
-	".gram" => "application/srgs",
-	".grxml" => "application/srgs+xml",
-	".gtar" => "application/x-gtar",
-	".tar.gz" => "application/x-tar-gz",
-	".gz" => "application/x-gunzip",
-	".hdf" => "application/x-hdf",
-	".hqx" => "application/mac-binhex40",
-	".htm" => "text/html",
-	".html" => "text/html",
-	".ice" => "x-conference/x-cooltalk",
-	".ico" => "image/x-icon",
-	".ics" => "text/calendar",
-	".ief" => "image/ief",
-	".ifb" => "text/calendar",
-	".iges" => "model/iges",
-	".igs" => "model/iges",
-	".jpe" => "image/jpeg",
-	".jpeg" => "image/jpeg",
-	".jpg" => "image/jpeg",
-	".js" => "application/x-javascript",
-	".kar" => "audio/midi",
-	".latex" => "application/x-latex",
+	".exe" => "application/octet-stream",
+	".img" => "application/octet-stream",
+	".iso" => "application/octet-stream",
 	".lha" => "application/octet-stream",
 	".lzh" => "application/octet-stream",
-	".m3u" => "audio/x-mpegurl",
-	".m4u" => "video/vnd.mpegurl",
-	".man" => "application/x-troff-man",
-	".mathml" => "application/mathml+xml",
-	".me" => "application/x-troff-me",
-	".mesh" => "model/mesh",
-	".mid" => "audio/midi",
-	".midi" => "audio/midi",
-	".mif" => "application/x-mif",
-	".mov" => "video/quicktime",
-	".movie" => "video/x-sgi-movie",
-	".mp2" => "video/mpeg",
-	".mp3" => "audio/mpeg",
-	".mpe" => "video/mpeg",
-	".mpeg" => "video/mpeg",
-	".mpg" => "video/mpeg",
-	".mpga" => "audio/mpeg",
-	".ms" => "application/x-troff-ms",
-	".msh" => "model/mesh",
-	".mxu" => "video/vnd.mpegurl",
-	".nc" => "application/x-netcdf",
-	".oda" => "application/oda",
-	".ogg" => "application/ogg",
-	".pbm" => "image/x-portable-bitmap",
-	".pdb" => "chemical/x-pdb",
+	".so" => "application/octet-stream",
+	".ogx" => "application/ogg",
 	".pdf" => "application/pdf",
-	".pgm" => "image/x-portable-graymap",
-	".pgn" => "application/x-chess-pgn",
-	".pgp" => "application/pgp",
-	".pl" => "application/x-perl",
-	".pm" => "application/x-perl",
-	".png" => "image/png",
-	".pnm" => "image/x-portable-anymap",
-	".ppm" => "image/x-portable-pixmap",
-	".ppt" => "application/vnd.ms-powerpoint",
+	".pem" => "application/pem-certificate-chain",
+	".pgp" => "application/pgp-encrypted",
+	".sig" => "application/pgp-signature",
+	".p10" => "application/pkcs10",
+	".p12" => "application/pkcs12",
+	".pfx" => "application/pkcs12",
+	".p7c" => "application/pkcs7-mime",
+	".p7m" => "application/pkcs7-mime",
+	".p7s" => "application/pkcs7-signature",
+	".p8" => "application/pkcs8",
+	".p8e" => "application/pkcs8-encrypted",
+	".cer" => "application/pkix-cert",
+	".crl" => "application/pkix-crl",
+	".pkipath" => "application/pkix-pkipath",
+	".pki" => "application/pkixcmp",
+	".pls" => "application/pls+xml",
+	".ai" => "application/postscript",
+	".eps" => "application/postscript",
 	".ps" => "application/postscript",
-	".qt" => "video/quicktime",
-	".ra" => "audio/x-pn-realaudio",
-	".ram" => "audio/x-pn-realaudio",
-	".rar" => "application/x-rar-compressed",
-	".ras" => "image/x-cmu-raster",
-	".rdf" => "application/rdf+xml",
-	".rgb" => "image/x-rgb",
-	".rm" => "application/vnd.rn-realmedia",
-	".roff" => "application/x-troff",
+	".rfcxml" => "application/rfc+xml",
 	".rtf" => "application/rtf",
-	".rtx" => "text/richtext",
-	".sgm" => "text/sgml",
-	".sgml" => "text/sgml",
+	".sieve" => "application/sieve",
+	".siv" => "application/sieve",
+	".sql" => "application/sql",
+	".xht" => "application/xhtml+xml",
+	".xhtm" => "application/xhtml+xml",
+	".xhtml" => "application/xhtml+xml",
+	".xlf" => "application/xliff+xml",
+	".dtd" => "application/xml-dtd",
+	".xop" => "application/xop+xml",
+	".xsl" => "application/xslt+xml",
+	".xslt" => "application/xslt+xml",
+	".yang" => "application/yang",
+	".yin" => "application/yin+xml",
+	".zip" => "application/zip",
+	".zst" => "application/zstd",
+	".qwd" => "application/vnd.Quark.QuarkXPress",
+	".qwt" => "application/vnd.Quark.QuarkXPress",
+	".qxb" => "application/vnd.Quark.QuarkXPress",
+	".qxd" => "application/vnd.Quark.QuarkXPress",
+	".qxl" => "application/vnd.Quark.QuarkXPress",
+	".qxt" => "application/vnd.Quark.QuarkXPress",
+	".swf" => "application/vnd.adobe.flash.movie",
+	".fcdt" => "application/vnd.adobe.formscentral.fcdt",
+	".fxp" => "application/vnd.adobe.fxp",
+	".fxpl" => "application/vnd.adobe.fxp",
+	".xdp" => "application/vnd.adobe.xdp+xml",
+	".xfdf" => "application/vnd.adobe.xfdf",
+	".afp" => "application/vnd.afpc.modca",
+	".dist" => "application/vnd.apple.installer+xml",
+	".distz" => "application/vnd.apple.installer+xml",
+	".mpkg" => "application/vnd.apple.installer+xml",
+	".pkg" => "application/vnd.apple.installer+xml",
+	".keynote" => "application/vnd.apple.keynote",
+	".m3u8" => "application/vnd.apple.mpegurl",
+	".numbers" => "application/vnd.apple.numbers",
+	".pages" => "application/vnd.apple.pages",
+	".deb" => "application/vnd.debian.binary-package",
+	".udeb" => "application/vnd.debian.binary-package",
+	".karbon" => "application/vnd.kde.karbon",
+	".chrt" => "application/vnd.kde.kchart",
+	".kfo" => "application/vnd.kde.kformula",
+	".flw" => "application/vnd.kde.kivio",
+	".kon" => "application/vnd.kde.kontour",
+	".kpr" => "application/vnd.kde.kpresenter",
+	".kpt" => "application/vnd.kde.kpresenter",
+	".ksp" => "application/vnd.kde.kspread",
+	".kwd" => "application/vnd.kde.kword",
+	".kwt" => "application/vnd.kde.kword",
+	".xul" => "application/vnd.mozilla.xul+xml",
+	".3mf" => "application/vnd.ms-3mfdocument",
+	".cil" => "application/vnd.ms-artgalry",
+	".asf" => "application/vnd.ms-asf",
+	".cab" => "application/vnd.ms-cab-compressed",
+	".xla" => "application/vnd.ms-excel",
+	".xlc" => "application/vnd.ms-excel",
+	".xlm" => "application/vnd.ms-excel",
+	".xls" => "application/vnd.ms-excel",
+	".xlt" => "application/vnd.ms-excel",
+	".xlw" => "application/vnd.ms-excel",
+	".xlam" => "application/vnd.ms-excel.addin.macroEnabled.12",
+	".xlsb" => "application/vnd.ms-excel.sheet.binary.macroEnabled.12",
+	".xlsm" => "application/vnd.ms-excel.sheet.macroEnabled.12",
+	".xltm" => "application/vnd.ms-excel.template.macroEnabled.12",
+	".eot" => "application/vnd.ms-fontobject",
+	".chm" => "application/vnd.ms-htmlhelp",
+	".ims" => "application/vnd.ms-ims",
+	".lrm" => "application/vnd.ms-lrm",
+	".thmx" => "application/vnd.ms-officetheme",
+	".pot" => "application/vnd.ms-powerpoint",
+	".pps" => "application/vnd.ms-powerpoint",
+	".ppt" => "application/vnd.ms-powerpoint",
+	".ppam" => "application/vnd.ms-powerpoint.addin.macroEnabled.12",
+	".pptm" => "application/vnd.ms-powerpoint.presentation.macroEnabled.12",
+	".sldm" => "application/vnd.ms-powerpoint.slide.macroEnabled.12",
+	".ppsm" => "application/vnd.ms-powerpoint.slideshow.macroEnabled.12",
+	".potm" => "application/vnd.ms-powerpoint.template.macroEnabled.12",
+	".mpp" => "application/vnd.ms-project",
+	".mpt" => "application/vnd.ms-project",
+	".tnef" => "application/vnd.ms-tnef",
+	".tnf" => "application/vnd.ms-tnef",
+	".docm" => "application/vnd.ms-word.document.macroEnabled.12",
+	".dotm" => "application/vnd.ms-word.template.macroEnabled.12",
+	".wcm" => "application/vnd.ms-works",
+	".wdb" => "application/vnd.ms-works",
+	".wks" => "application/vnd.ms-works",
+	".wps" => "application/vnd.ms-works",
+	".wpl" => "application/vnd.ms-wpl",
+	".oxt" => "application/vnd.openofficeorg.extension",
+	".osm" => "application/vnd.openstreetmap.data+xml",
+	".pptx" => "application/vnd.openxmlformats-officedocument.presentationml.presentation",
+	".sldx" => "application/vnd.openxmlformats-officedocument.presentationml.slide",
+	".ppsx" => "application/vnd.openxmlformats-officedocument.presentationml.slideshow",
+	".potx" => "application/vnd.openxmlformats-officedocument.presentationml.template",
+	".xlsx" => "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
+	".xltx" => "application/vnd.openxmlformats-officedocument.spreadsheetml.template",
+	".docx" => "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
+	".dotx" => "application/vnd.openxmlformats-officedocument.wordprocessingml.template",
+	".wpd" => "application/vnd.wordperfect",
+	".tbz" => "application/x-gtar-compressed",
+	".hdf" => "application/x-hdf",
+	".jar" => "application/x-java-archive",
+	".kil" => "application/x-killustrator",
+	".latex" => "application/x-latex",
+	".cdf" => "application/x-netcdf",
+	".nc" => "application/x-netcdf",
+	".pl" => "application/x-perl",
+	".rpm" => "application/x-rpm",
 	".sh" => "application/x-sh",
 	".shar" => "application/x-shar",
-	".silo" => "model/mesh",
 	".sit" => "application/x-stuffit",
-	".skd" => "application/x-koan",
-	".skm" => "application/x-koan",
-	".skp" => "application/x-koan",
-	".skt" => "application/x-koan",
-	".smi" => "application/smil",
-	".smil" => "application/smil",
-	".snd" => "audio/basic",
-	".so" => "application/octet-stream",
-	".spl" => "application/x-futuresplash",
-	".src" => "application/x-wais-source",
-	".sv4cpio" => "application/x-sv4cpio",
-	".sv4crc" => "application/x-sv4crc",
-	".svg" => "image/svg+xml",
-	".swf" => "application/x-shockwave-flash",
-	".t" => "application/x-troff",
 	".tar" => "application/x-tar",
 	".tcl" => "application/x-tcl",
 	".tex" => "application/x-tex",
 	".texi" => "application/x-texinfo",
 	".texinfo" => "application/x-texinfo",
-	".tgz" => "application/x-tar-gz",
+	".1" => "application/x-troff-man",
+	".2" => "application/x-troff-man",
+	".3" => "application/x-troff-man",
+	".4" => "application/x-troff-man",
+	".5" => "application/x-troff-man",
+	".6" => "application/x-troff-man",
+	".7" => "application/x-troff-man",
+	".8" => "application/x-troff-man",
+	".man" => "application/x-troff-man",
+	".me" => "application/x-troff-me",
+	".ms" => "application/x-troff-ms",
+	".ustar" => "application/x-ustar",
+	".xz" => "application/x-xz",
+	".aac" => "audio/aac",
+	".ass" => "audio/aac",
+	".acn" => "audio/asc",
+	".au" => "audio/basic",
+	".snd" => "audio/basic",
+	".mid" => "audio/midi",
+	".midi" => "audio/midi",
+	".m4a" => "audio/mp4",
+	".mp1" => "audio/mpeg",
+	".mp2" => "audio/mpeg",
+	".mp3" => "audio/mpeg",
+	".mpga" => "audio/mpeg",
+	".oga" => "audio/ogg",
+	".ogg" => "audio/ogg",
+	".opus" => "audio/ogg",
+	".spx" => "audio/ogg",
+	".aif" => "audio/x-aiff",
+	".aifc" => "audio/x-aiff",
+	".aiff" => "audio/x-aiff",
+	".flac" => "audio/x-flac",
+	".mka" => "audio/x-matroska",
+	".otf" => "font/otf",
+	".ttf" => "font/ttf",
+	".bmp" => "image/bmp",
+	".dib" => "image/bmp",
+	".cgm" => "image/cgm",
+	".drle" => "image/dicom-rle",
+	".emf" => "image/emf",
+	".fit" => "image/fits",
+	".fits" => "image/fits",
+	".fts" => "image/fits",
+	".gif" => "image/gif",
+	".heic" => "image/heic",
+	".heics" => "image/heic-sequence",
+	".heif" => "image/heif",
+	".heifs" => "image/heif-sequence",
+	".hej2" => "image/hej2k",
+	".hsj2" => "image/hsj2",
+	".ief" => "image/ief",
+	".jls" => "image/jls",
+	".jp2" => "image/jp2",
+	".jpg2" => "image/jp2",
+	".jfif" => "image/jpeg",
+	".jpe" => "image/jpeg",
+	".jpeg" => "image/jpeg",
+	".jpg" => "image/jpeg",
+	".jph" => "image/jph",
+	".jhc" => "image/jphc",
+	".jpgm" => "image/jpm",
+	".jpm" => "image/jpm",
+	".jpf" => "image/jpx",
+	".jpx" => "image/jpx",
+	".jxr" => "image/jxr",
+	".jxra" => "image/jxrA",
+	".jxrs" => "image/jxrS",
+	".jxs" => "image/jxs",
+	".jxsc" => "image/jxsc",
+	".jxsi" => "image/jxsi",
+	".jxss" => "image/jxss",
+	".ktx" => "image/ktx",
+	".png" => "image/png",
+	".btf" => "image/prs.btif",
+	".btif" => "image/prs.btif",
+	".pti" => "image/prs.pti",
+	".svg" => "image/svg+xml",
+	".svgz" => "image/svg+xml",
+	".t38" => "image/t38",
 	".tif" => "image/tiff",
 	".tiff" => "image/tiff",
-	".tr" => "application/x-troff",
-	".tsv" => "text/tab-separated-values",
-	".txt" => "text/plain",
-	".ustar" => "application/x-ustar",
-	".vcd" => "application/x-cdlink",
-	".vrm" => "x-world/x-vrml",
-	".vrml" => "x-world/x-vrml",
-	".vxml" => "application/voicexml+xml",
-	".wav" => "audio/x-wav",
+	".tfx" => "image/tiff-fx",
+	".webp" => "image/webp",
+	".wmf" => "image/wmf",
+	".psd" => "image/vnd.adobe.photoshop",
+	".azv" => "image/vnd.airzip.accelerator.azv",
+	".uvg" => "image/vnd.dece.graphic",
+	".uvi" => "image/vnd.dece.graphic",
+	".uvvg" => "image/vnd.dece.graphic",
+	".uvvi" => "image/vnd.dece.graphic",
+	".djv" => "image/vnd.djvu",
+	".djvu" => "image/vnd.djvu",
+	".dwg" => "image/vnd.dwg",
+	".dxf" => "image/vnd.dxf",
+	".fbs" => "image/vnd.fastbidsheet",
+	".fpx" => "image/vnd.fpx",
+	".fst" => "image/vnd.fst",
+	".mmr" => "image/vnd.fujixerox.edmics-mmr",
+	".rlc" => "image/vnd.fujixerox.edmics-rlc",
+	".pgb" => "image/vnd.globalgraphics.pgb",
+	".ico" => "image/vnd.microsoft.icon",
+	".apng" => "image/vnd.mozilla.apng",
+	".mdi" => "image/vnd.ms-modi",
+	".hdr" => "image/vnd.radiance",
+	".rgbe" => "image/vnd.radiance",
+	".xyze" => "image/vnd.radiance",
+	".s1n" => "image/vnd.sealed.png",
+	".spn" => "image/vnd.sealed.png",
+	".spng" => "image/vnd.sealed.png",
+	".s1g" => "image/vnd.sealedmedia.softseal.gif",
+	".sgi" => "image/vnd.sealedmedia.softseal.gif",
+	".sgif" => "image/vnd.sealedmedia.softseal.gif",
+	".s1j" => "image/vnd.sealedmedia.softseal.jpg",
+	".sjp" => "image/vnd.sealedmedia.softseal.jpg",
+	".sjpg" => "image/vnd.sealedmedia.softseal.jpg",
+	".tap" => "image/vnd.tencent.tap",
+	".vtf" => "image/vnd.valve.source.texture",
 	".wbmp" => "image/vnd.wap.wbmp",
-	".wbxml" => "application/vnd.wap.wbxml",
-	".wml" => "text/vnd.wap.wml",
-	".wmlc" => "application/vnd.wap.wmlc",
-	".wmls" => "text/vnd.wap.wmlscript",
-	".wmlsc" => "application/vnd.wap.wmlscriptc",
-	".wrl" => "x-world/x-vrml",
+	".xif" => "image/vnd.xiff",
+	".pcx" => "image/vnd.zbrush.pcx",
+	".pnm" => "image/x-portable-anymap",
+	".pbm" => "image/x-portable-bitmap",
+	".pgm" => "image/x-portable-graymap",
+	".ppm" => "image/x-portable-pixmap",
+	".rgb" => "image/x-rgb",
+	".tga" => "image/x-targa",
 	".xbm" => "image/x-xbitmap",
-	".xht" => "application/xhtml+xml",
-	".xhtml" => "application/xhtml+xml",
-	".xls" => "application/excel",
-	".xml" => "application/xml",
 	".xpm" => "image/x-xpixmap",
-	".xsl" => "application/xml",
-	".xslt" => "application/xslt+xml",
-	".xul" => "application/vnd.mozilla.xul+xml",
 	".xwd" => "image/x-xwindowdump",
-	".xyz" => "chemical/x-xyz",
-	".zip" => "application/x-zip-compressed"
+	".art" => "message/rfc822",
+	".eml" => "message/rfc822",
+	".mail" => "message/rfc822",
+	".vrml" => "model/vrml",
+	".wrl" => "model/vrml",
+	".x3db" => "model/x3d+xml",
+	".x3dv" => "model/x3d-vrml",
+	".x3dvz" => "model/x3d-vrml",
+	".ics" => "text/calendar",
+	".ifb" => "text/calendar",
+	".css" => "text/css; charset=utf-8",
+	".csv" => "text/csv; charset=utf-8",
+	".csvs" => "text/csv-schema",
+	".soa" => "text/dns",
+	".zone" => "text/dns",
+	".htm" => "text/html",
+	".html" => "text/html",
+	".sandboxed" => "text/html-sandboxed",
+	".cnd" => "text/jcr-cnd",
+	".markdown" => "text/markdown; charset=utf-8",
+	".md" => "text/markdown; charset=utf-8",
+	".miz" => "text/mizar",
+	".n3" => "text/n3",
+	".asc" => "text/plain; charset=utf-8",
+	".c" => "text/plain; charset=utf-8",
+	".cc" => "text/plain; charset=utf-8",
+	".conf" => "text/plain; charset=utf-8",
+	".cxx" => "text/plain; charset=utf-8",
+	".el" => "text/plain; charset=utf-8",
+	".f90" => "text/plain; charset=utf-8",
+	".h" => "text/plain; charset=utf-8",
+	".hh" => "text/plain; charset=utf-8",
+	".hxx" => "text/plain; charset=utf-8",
+	".log" => "text/plain; charset=utf-8",
+	".pm" => "text/plain; charset=utf-8",
+	".spec" => "text/plain; charset=utf-8",
+	".text" => "text/plain; charset=utf-8",
+	".txt" => "text/plain; charset=utf-8",
+	".provn" => "text/provenance-notation",
+	".rst" => "text/prs.fallenstein.rst",
+	".dsc" => "text/prs.lines.tag",
+	".tag" => "text/prs.lines.tag",
+	".rtx" => "text/richtext",
+	".sgm" => "text/sgml",
+	".sgml" => "text/sgml",
+	".tsv" => "text/tab-separated-values",
+	".roff" => "text/troff",
+	".t" => "text/troff",
+	".tr" => "text/troff",
+	".ttl" => "text/turtle",
+	".uri" => "text/uri-list",
+	".uris" => "text/uri-list",
+	".vcard" => "text/vcard",
+	".vcf" => "text/vcard",
+	".vtt" => "text/vtt",
+	".rng" => "text/xml",
+	".xml" => "text/xml",
+	".xsd" => "text/xml",
+	".ent" => "text/xml-external-parsed-entity",
+	".dms" => "text/vnd.DMClientScript",
+	".a" => "text/vnd.a",
+	".abc" => "text/vnd.abc",
+	".ascii" => "text/vnd.ascii-art",
+	".copyright" => "text/vnd.debian.copyright",
+	".pod" => "text/x-pod",
+	".etx" => "text/x-setext",
+	".3gp" => "video/3gpp",
+	".3gpp" => "video/3gpp",
+	".3g2" => "video/3gpp2",
+	".3gpp2" => "video/3gpp2",
+	".m4s" => "video/iso.segment",
+	".mj2" => "video/mj2",
+	".mjp2" => "video/mj2",
+	".m4v" => "video/mp4",
+	".mp4" => "video/mp4",
+	".mpg4" => "video/mp4",
+	".m1v" => "video/mpeg",
+	".m2v" => "video/mpeg",
+	".mpe" => "video/mpeg",
+	".mpeg" => "video/mpeg",
+	".mpg" => "video/mpeg",
+	".ogv" => "video/ogg",
+	".mov" => "video/quicktime",
+	".qt" => "video/quicktime",
+	".webm" => "video/webm",
+	".yt" => "video/vnd.youtube.yt",
+	".axv" => "video/x-annodex",
+	".flv" => "video/x-flv",
+	".fxm" => "video/x-javafx",
+	".mkv" => "video/x-matroska",
+	".mk3d" => "video/x-matroska-3d",
+	".asx" => "video/x-ms-asf",
+	".wm" => "video/x-ms-wm",
+	".wmv" => "video/x-ms-wmv",
+	".wmx" => "video/x-ms-wmx",
+	".wvx" => "video/x-ms-wvx",
+	".avi" => "video/x-msvideo",
+	".movie" => "video/x-sgi-movie",
+	"README" => "text/plain; charset=utf-8",
+	"Makefile" => "text/x-makefile; charset=utf-8"
 )
+# }}}
+
+# {{{ server settings
+server.username      = "lighttpd"
+server.groupname     = "lighttpd"
+
+server.document-root = var.basedir + "/htdocs"
+server.pid-file      = "/var/run/lighttpd.pid"
+
+server.errorlog      = var.logdir  + "/error.log"
+# log errors to syslog instead
+#   server.errorlog-use-syslog = "enable"
+#server.errorlog-use-syslog = "enable"
+# daemon by default
+#server.syslog-facility = "ftp"
+
+server.indexfiles    = ("index.php", "index.html",
+						"index.htm", "default.htm")
+
+# server.tag           = "lighttpd"
+
+server.follow-symlink = "enable"
+
+# event handler (defaults to "poll")
+# see performance.txt
+# 
+# for >= linux-2.4
+#   server.event-handler = "linux-rtsig"
+# for >= linux-2.6
+#   server.event-handler = "linux-sysepoll"
+server.event-handler = "linux-sysepoll"
+# for FreeBSD
+#   server.event-handler = "freebsd-kqueue"
+
+# 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-"
+
+# FAM support for caching stat() calls
+# requires that lighttpd be built with USE=fam
+#   server.stat-cache-engine = "fam"
+# }}}
+
+# {{{ 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"
+#accesslog.use-syslog = "enable"
+# }}}
+
+# {{{ 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_compress
+# see compress.txt
+#
+# compress.cache-dir   = var.statedir + "/cache/compress"
+# compress.filetype    = ("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_trigger_b4_dl
+# see trigger_b4_dl.txt
+#
+# trigger-before-download.gdbm-filename = "/home/weigon/testbase/trigger.db"
+# trigger-before-download.memcache-hosts = ( "127.0.0.1:11211" )
+# trigger-before-download.trigger-url = "^/trigger/"
+# trigger-before-download.download-url = "^/download/"
+# trigger-before-download.deny-url = "http://127.0.0.1/index.html"
+# trigger-before-download.trigger-timeout = 10
+# }}}
+
+# {{{ mod_cml
+# see cml.txt
+#
+# don't forget to add index.cml to server.indexfiles
+# cml.extension               = ".cml"
+# cml.memcache-hosts          = ( "127.0.0.1:11211" )
+# }}} 
+
+# {{{ 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"
+# }}}
 
-# End of file
+# vim: set ft=conf foldmethod=marker et :
diff --git a/lighttpd/lighttpd.rc b/lighttpd/lighttpd.rc
index e98d75d2f..f6d1db915 100755
--- a/lighttpd/lighttpd.rc
+++ b/lighttpd/lighttpd.rc
@@ -6,30 +6,31 @@
 SSD=/sbin/start-stop-daemon
 PROG=/usr/sbin/lighttpd
 PID=/var/run/lighttpd.pid
-OPTS="-f /etc/lighttpd.conf"
+OPTS="-f /etc/lighttpd/lighttpd.conf"
 
-case $1 in
+case ${1} in
 start)
-        $SSD --start --pidfile $PID --exec $PROG -- $OPTS
+        ${SSD} --start --pidfile ${PID} --exec ${PROG} -- ${OPTS}
         ;;
 stop)
-        $SSD --stop --remove-pidfile --retry 10 --pidfile $PID
+        ${SSD} --stop --remove-pidfile --retry 10 --pidfile ${PID}
         ;;
 restart)
-        $0 stop
-        $0 start
+        ${0} stop
+        ${0} start
         ;;
 status)
-        $SSD --status --pidfile $PID
-        case $? in
-        0) echo "$PROG is running with pid $(cat $PID)" ;;
-        1) echo "$PROG is not running but the pid file $PID exists" ;;
-        3) echo "$PROG is not running" ;;
+        ${SSD} --status --pidfile ${PID}
+	e=${?}
+        case ${e} in
+        0) echo "${PROG} is running with pid $(cat ${PID})" ;;
+        1) echo "${PROG} is not running but the pid file ${PID} exists" ;;
+        3) echo "${PROG} is not running" ;;
         4) echo "Unable to determine the program status" ;;
         esac
         ;;
 *)
-        echo "usage: $0 [start|stop|restart|status]"
+        echo "usage: ${0} [start|stop|restart|status]"
         ;;
 esac
 
diff --git a/lighttpd/post-install b/lighttpd/post-install
new file mode 100644
index 000000000..4c24fd915
--- /dev/null
+++ b/lighttpd/post-install
@@ -0,0 +1,11 @@
+#!/bin/sh -
+
+getent group lighttpd || groupadd -r lighttpd
+
+if [ -z "`getent passwd named`" ]; then
+	useradd -g lighttpd -d /var/www/lighttpd -s /bin/false lighttpd
+	passwd -l lighttpd
+fi
+
+chown root:lighttpd /var/log/lighttpd
+chmod 0775 /var/log/lighttpd
diff --git a/lighttpd/userdir.conf b/lighttpd/userdir.conf
new file mode 100644
index 000000000..5d4bf6ee6
--- /dev/null
+++ b/lighttpd/userdir.conf
@@ -0,0 +1,36 @@
+#######################################################################
+##
+##  Userdir Module 
+## ----------------
+##
+## See https://redmine.lighttpd.net/projects/lighttpd/wiki/Docs_ModUserDir
+##
+server.modules += ( "mod_userdir" )
+
+##
+## usually it should be set to "public_html" to take ~/public_html/ as
+## the document root
+## Default: empty (document root is the home directory)
+##
+userdir.path = "public_html"
+
+##
+## If set, don't check /etc/passwd for homedir
+## Default: empty
+#userdir.basepath = server_root + "/users/"
+
+##
+## list of usernames which may not use this feature
+## Default: empty (all users may use it)
+##
+#userdir.exclude-user = ( "root", "postmaster" )
+
+##
+## if set, only users from this list may use the feature
+## Default: empty (all users may use it) 
+##
+#userdir.include-user = ("user1", "user2")
+
+##
+#######################################################################
+


More information about the crux-commits mailing list