summaryrefslogtreecommitdiff
path: root/user/lighttpd
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2018-06-08 02:11:51 -0500
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2018-06-08 02:11:51 -0500
commitc86aec496298fb20f0770f5ce9a2a37935f7aa5b (patch)
treeb95d17ae82ab73a2a147a2f0c9734c309e5f9807 /user/lighttpd
parentfd2bb2f751c13b3c0c002b8e012810902b9da364 (diff)
downloadpackages-c86aec496298fb20f0770f5ce9a2a37935f7aa5b.tar.gz
packages-c86aec496298fb20f0770f5ce9a2a37935f7aa5b.tar.bz2
packages-c86aec496298fb20f0770f5ce9a2a37935f7aa5b.tar.xz
packages-c86aec496298fb20f0770f5ce9a2a37935f7aa5b.zip
put user stuff in user, not system
Diffstat (limited to 'user/lighttpd')
-rw-r--r--user/lighttpd/APKBUILD116
-rw-r--r--user/lighttpd/char-signedness.patch46
-rw-r--r--user/lighttpd/lighttpd.conf261
-rw-r--r--user/lighttpd/lighttpd.confd12
-rw-r--r--user/lighttpd/lighttpd.initd75
-rw-r--r--user/lighttpd/lighttpd.logrotate15
-rw-r--r--user/lighttpd/lighttpd.pre-install8
l---------user/lighttpd/lighttpd.pre-upgrade1
-rw-r--r--user/lighttpd/mime-types.conf79
-rw-r--r--user/lighttpd/mod_cgi.conf33
-rw-r--r--user/lighttpd/mod_fastcgi.conf17
-rw-r--r--user/lighttpd/mod_fastcgi_fpm.conf16
12 files changed, 679 insertions, 0 deletions
diff --git a/user/lighttpd/APKBUILD b/user/lighttpd/APKBUILD
new file mode 100644
index 000000000..356bce93e
--- /dev/null
+++ b/user/lighttpd/APKBUILD
@@ -0,0 +1,116 @@
+# Contributor: Valery Kartel <valery.kartel@gmail.com>
+# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
+pkgname=lighttpd
+pkgver=1.4.48
+pkgrel=0
+pkgdesc="A secure, fast, compliant and very flexible web-server"
+url="http://www.lighttpd.net/"
+arch="all"
+license="custom"
+install="$pkgname.pre-install $pkgname.pre-upgrade"
+pkgusers="lighttpd"
+pkggroups="lighttpd"
+makedepends="flex pcre-dev openssl-dev zlib-dev bzip2-dev lua5.2-dev
+ automake autoconf openldap-dev libxml2-dev sqlite-dev libev-dev
+ gamin-dev attr-dev"
+subpackages="$pkgname-doc $pkgname-dbg $pkgname-mod_auth $pkgname-openrc
+ $pkgname-mod_webdav"
+source="http://download.lighttpd.net/lighttpd/releases-1.4.x/$pkgname-$pkgver.tar.xz
+ $pkgname.initd
+ $pkgname.confd
+ $pkgname.logrotate
+ lighttpd.conf
+ mime-types.conf
+ mod_cgi.conf
+ mod_fastcgi.conf
+ mod_fastcgi_fpm.conf
+ char-signedness.patch"
+builddir="$srcdir/$pkgname-$pkgver"
+
+build() {
+ cd "$builddir"
+
+ ./configure \
+ --build=$CBUILD \
+ --host=$CHOST \
+ --prefix=/usr \
+ --disable-dependency-tracking \
+ --enable-lfs \
+ --libdir=/usr/lib/lighttpd \
+ --without-mysql \
+ --with-attr \
+ --without-kerberos5 \
+ --with-fam \
+ --with-webdav-props \
+ --with-webdav-locks \
+ --without-gdbm \
+ --with-bzip2 \
+ --with-ldap \
+ --with-openssl \
+ --with-libev \
+ --with-lua
+ make
+}
+
+check() {
+ cd "$builddir"
+ make check
+}
+
+package() {
+ cd "$builddir"
+
+ make DESTDIR="$pkgdir" install
+
+ # create dirs
+ install -d -m755 -o lighttpd -g lighttpd \
+ "$pkgdir"/var/log/lighttpd/
+ install -d -m755 \
+ "$pkgdir"/etc/lighttpd/ \
+ "$pkgdir"/var/www/localhost/htdocs
+
+ # lighttpd
+ install -D -m755 "$srcdir"/lighttpd.initd \
+ "$pkgdir"/etc/init.d/lighttpd
+ install -D -m644 "$srcdir"/lighttpd.confd \
+ "$pkgdir"/etc/conf.d/lighttpd
+ install -D -m644 "$srcdir"/lighttpd.logrotate \
+ "$pkgdir"/etc/logrotate.d/lighttpd
+
+ # config files
+ local i; for i in lighttpd.conf mime-types.conf mod_cgi.conf \
+ mod_fastcgi.conf mod_fastcgi_fpm.conf
+ do
+ install -m644 "$srcdir"/$i "$pkgdir"/etc/lighttpd/$i
+ done
+}
+
+_mv_mod() {
+ mkdir -p "$subpkgdir"/usr/lib/lighttpd
+ while [ $# -gt 0 ]; do
+ mv "$pkgdir"/usr/lib/lighttpd/$1.so \
+ "$subpkgdir"/usr/lib/lighttpd/
+ shift
+ done
+}
+
+mod_auth() {
+ pkgdesc="Authentication module for lighttpd"
+ _mv_mod mod_auth
+}
+
+mod_webdav() {
+ pkgdesc="WebDAV module for lighttpd"
+ _mv_mod mod_webdav
+}
+
+sha512sums="361dbf07b280aa7345f3026cce6d12d0aeaa3bb535b5a5b2a894a568395f46a9c7ce723dfd1948225117495f3e63ec207b72d5e4b680da7cd56419e23cf8bae4 lighttpd-1.4.48.tar.xz
+f2f3c5c7731550237fd75a8de66275f427eaf897cffff7ac7ef44178328ad8fad6c4ec6654759bfc665cbaf7991ddcdf0aaa916831c8b6aa440192d57b242038 lighttpd.initd
+9d2ab5deb7353ebf290e90936b511941df440859c78589d0bcf130ef69a5e9c79e4d318548b6b118df002083c46f7476230a28954b7a10a9dbd05040e02b1291 lighttpd.confd
+0536b4f21d2e8659f7831b45998c13d9f6051ae7ecde13be01f372f837d255bfc4e211de48a7686cc743d53aa9c08ab3f10ec19788896dcf8356b90053ca7a16 lighttpd.logrotate
+b0fd7500ea7f7f7f9fbf04bb66eb06050cfed57bdc1730900b4c559598176442e4504395f1d406e037e7cffeaa1451d40a6cad408570f7f7e1dd6cc26c968912 lighttpd.conf
+a3f2f5763885d7e4f510491b24164e34aaf62bb02daa12991575dc64335c12668355af5bb8d6ce191eb4e9cce95324b1f7c9ba61b323b4e7b50a1e03e021afcf mime-types.conf
+27cc638d8068dcf47bd9db44943d1db6c6f4e8e6abd6b42af7cea004b1c093440068541d98c68f8bea70b956713adaf8ed59a4b642dea826ee8620a05f8cfde5 mod_cgi.conf
+1d15b84c03fb648a0e67ab5c5411b85478b4454c44bc2959cc96d1700eeadd7ff429520a5f1550db6527267646622dccd3d47d3fd1258869fccaf5c22d4ad4b2 mod_fastcgi.conf
+f9efc4b70d825600f5356c30e57d0b6cac11c01739337f7192c09c2cfd96cb76c8328b11d818ea4c2addc1a6d253975b84700106ae75854d55d0df73e220bd2b mod_fastcgi_fpm.conf
+ce35c1d65d7b4fedd1fcfadd8a5e906d5efa8dcda318a4fa69958b708c2df329f708591f43b12adaaac4da6a2913d0cc8f9745e636e7f2016c1075bcd52c6bb2 char-signedness.patch"
diff --git a/user/lighttpd/char-signedness.patch b/user/lighttpd/char-signedness.patch
new file mode 100644
index 000000000..43f7f5faf
--- /dev/null
+++ b/user/lighttpd/char-signedness.patch
@@ -0,0 +1,46 @@
+
+Added by gstrauss 16 days ago
+
+ ID d4083effab0f9bf76528d5c47198b17e7471ed13
+ Parent 0c95ed37
+ Child 37f9b60d
+
+[core] fix base64 decode when char is unsigned (fixes #2848)
+
+thx, codehero
+
+x-ref:
+"buffer_append_base64_decode() broken on compilers where char is assumed unsigned"
+https://redmine.lighttpd.net/issues/2848
+
+diff --git a/src/base64.c b/src/base64.c
+index f39dbaa2..3034181a 100644
+--- a/src/base64.c
++++ b/src/base64.c
+@@ -11,7 +11,7 @@
+
+ /* BASE64_STANDARD: "A-Z a-z 0-9 + /" maps to 0-63, pad with "=" */
+ static const char base64_standard_table[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
+-static const char base64_standard_reverse_table[] = {
++static const signed char base64_standard_reverse_table[] = {
+ /* 0 1 2 3 4 5 6 7 8 9 A B C D E F */
+ -1, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, /* 0x00 - 0x0F */
+ -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, /* 0x10 - 0x1F */
+@@ -25,7 +25,7 @@ static const char base64_standard_reverse_table[] = {
+
+ /* BASE64_URL: "A-Z a-z 0-9 - _" maps to 0-63, pad with "." */
+ static const char base64_url_table[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_.";
+-static const char base64_url_reverse_table[] = {
++static const signed char base64_url_reverse_table[] = {
+ /* 0 1 2 3 4 5 6 7 8 9 A B C D E F */
+ -1, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, /* 0x00 - 0x0F */
+ -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, /* 0x10 - 0x1F */
+@@ -42,7 +42,7 @@ unsigned char* buffer_append_base64_decode(buffer *out, const char* in, size_t i
+ size_t out_pos = 0; /* current output character (position) that is decoded. can contain partial result */
+ unsigned int group = 0; /* how many base64 digits in the current group were decoded already. each group has up to 4 digits */
+ size_t i;
+- const char *base64_reverse_table;
++ const signed char *base64_reverse_table;
+
+ switch (charset) {
+ case BASE64_STANDARD:
diff --git a/user/lighttpd/lighttpd.conf b/user/lighttpd/lighttpd.conf
new file mode 100644
index 000000000..cfec00065
--- /dev/null
+++ b/user/lighttpd/lighttpd.conf
@@ -0,0 +1,261 @@
+###################################
+# Default lighttpd.conf for Adélie
+###################################
+
+
+######## Variables ########
+var.basedir = "/var/www/localhost"
+var.logdir = "/var/log/lighttpd"
+var.statedir = "/var/lib/lighttpd"
+
+
+######## Modules ########
+# 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"
+)
+
+
+######## Inclusions ########
+include "mime-types.conf"
+# 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"
+
+
+######## Global 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"
+# To log errors to syslog instead, use:
+# server.errorlog-use-syslog = "enable"
+
+server.indexfiles = ("index.html", "index.htm", "default.htm")
+
+# server.tag = "lighttpd"
+
+server.follow-symlink = "enable"
+
+server.event-handler = "linux-sysepoll"
+
+# To chroot to a directory:
+# server.chroot = "/"
+
+# Default bind port is 80. To change:
+# server.port = 81
+
+# Default bind address is global (0.0.0.0). To change:
+# server.bind = "grisu.home.kneschke.de"
+
+# error-handler for status 404
+# server.error-handler-404 = "/error-handler.html"
+
+# 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
+server.stat-cache-engine = "fam"
+
+# 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 config ########
+accesslog.filename = var.logdir + "/access.log"
+
+
+######## mod_dirlisting config ########
+# Enable directory listings if no indexfile is present.
+#dir-listing.activate = "enable"
+
+# Don't list hidden files/directories (beginning with '.')
+#dir-listing.hide-dotfiles = "enable"
+#
+# Specify a path here for custom directory listing CSS:
+#dir-listing.external-css = "/path/to/dir-listing.css"
+#
+# Exclude files that match any regex in this list from directory listings:
+#dir-listing.exclude = ("^\.", "~$")
+
+
+######## mod_access config ########
+# See access.txt in lighttpd-doc package for more info.
+
+url.access-deny = ("~", ".inc")
+
+
+######## mod_userdir config ########
+# This will give all users with valid homedirs the chance to publish a
+# webpage from this server using traditional /~username/ paths.
+# See userdir.txt in lighttpd-doc package for more info.
+#
+#userdir.path = "public_html"
+#userdir.exclude-user = ("root")
+
+
+######## mod_ssi config ########
+# This allows you to use server-side includes.
+#ssi.extension = (".shtml")
+
+
+######## SSL config ########
+# See ssl.txt in lighttpd-doc package for more info.
+# The defaults here are NOT the server defaults. You need to uncomment
+# them to use them. They are HIGHLY recommended; by default, lighttpd
+# will serve older TLS protocols that may be vulnerable to attack.
+#
+#ssl.engine = "enable"
+#ssl.honor-cipher-order = "enable"
+#ssl.disable-client-renegotiation = "enable"
+# pemfile is cert+privkey, ca-file is the intermediate chain in one file
+#ssl.pemfile = "/path/to/signed_cert_plus_private_key.pem"
+#ssl.ca-file = "/path/to/intermediate_certificate.pem"
+# ECDH/ECDHE ciphers curve strength (see `openssl ecparam -list_curves`)
+#ssl.ec-curve = "secp384r1"
+# Environment flag for HTTPS enabled
+#setenv.add-environment = (
+# "HTTPS" => "on"
+#)
+# Modern configuration, tweak to your needs
+#ssl.use-sslv2 = "disable"
+#ssl.use-sslv3 = "disable"
+#ssl.cipher-list = "ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256"
+# HSTS(15768000 seconds = 6 months)
+#setenv.add-response-header = (
+# "Strict-Transport-Security" => "max-age=15768000;"
+#)
+
+
+######## mod_status config ########
+# This is generally handy and won't expose any sensitive info.
+#status.status-url = "/server-status"
+# This will expose some of your configuration to the world!
+#status.config-url = "/server-config"
+
+
+######## mod_compress config ########
+compress.cache-dir = var.statedir + "/cache/compress"
+compress.filetype = ("text/plain", "text/html")
+
+
+######## mod_proxy config ########
+# See proxy.txt in lighttpd-doc package for more info.
+# proxy.server = ( ".php" =>
+# ( "localhost" =>
+# (
+# "host" => "192.168.0.101",
+# "port" => 80
+# )
+# )
+# )
+# }}}
+
+
+######## mod_auth config ########
+# See authentication.txt in lighttpd-doc package for more info.
+#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 config ########
+# Apache-style mod_rewrite for implementing URL rewriting.
+# See rewrite.txt in lighttpd-doc package for more info.
+#
+#url.rewrite = (
+# "^/$" => "/server-status"
+#)
+
+
+######## mod_redirect config ########
+# See redirect.txt in lighttpd-doc package for more info.
+#
+#url.redirect = (
+# "^/wishlist/(.+)" => "http://www.123.org/$1"
+#)
+
+
+######## mod_expire config ########
+# It is highly recommended you configure Expire: headers correctly to
+# conserve bandwidth, especially for users on slow links.
+#expire.url = (
+# "/buggy/" => "access 2 hours",
+# "/asdhas/" => "access plus 1 seconds 2 minutes"
+#)
+
+# {{{ 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_webdav config ########
+# lighttpd can act as a WebDAV server.
+# See webdav.txt in lighttpd-doc package for more info.
+#
+#$HTTP["url"] =~ "^/dav($|/)" {
+# webdav.activate = "enable"
+# webdav.is-readonly = "enable"
+#}
+
+
+######## Debugging options ########
+# debug.log-request-header = "enable"
+# debug.log-response-header = "enable"
+# debug.log-request-handling = "enable"
+# debug.log-file-not-found = "enable"
+
+# vim: set ft=conf foldmethod=marker et :
diff --git a/user/lighttpd/lighttpd.confd b/user/lighttpd/lighttpd.confd
new file mode 100644
index 000000000..da524afb4
--- /dev/null
+++ b/user/lighttpd/lighttpd.confd
@@ -0,0 +1,12 @@
+# /etc/conf.d/lighttpd
+
+# Location of a shell used by the 'include_shell' directive
+# in the lighttpd's configuration file
+#export SHELL="/bin/bash"
+
+# Location of the lighttpd configuration file
+LIGHTTPD_CONF="/etc/lighttpd/lighttpd.conf"
+
+# Location of the lighttpd pid file
+LIGHTTPD_PID="/run/lighttpd.pid"
+
diff --git a/user/lighttpd/lighttpd.initd b/user/lighttpd/lighttpd.initd
new file mode 100644
index 000000000..614cb2132
--- /dev/null
+++ b/user/lighttpd/lighttpd.initd
@@ -0,0 +1,75 @@
+#!/sbin/openrc-run
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/www-servers/lighttpd/files/lighttpd.initd,v 1.21 2012/01/08 20:45:46 hwoarang Exp $
+
+extra_started_commands="reload graceful"
+required_files=$LIGHTTPD_CONF
+
+depend() {
+ need net
+ use mysql logger spawn-fcgi ldap slapd netmount dns
+ after firewall
+ after famd
+ after sshd
+}
+
+checkconfig() {
+ if [ ! -f "${LIGHTTPD_CONF}" ] ; then
+ ewarn "${LIGHTTPD_CONF} does not exist."
+ return 1
+ fi
+
+ if [ -z "${LIGHTTPD_PID}" ] ; then
+ ewarn "server.pid-file variable in ${LIGHTTPD_CONF}"
+ ewarn "is not set. Falling back to lighttpd.pid"
+ LIGHTTPD_PID="/run/lighttpd.pid"
+ fi
+ /usr/sbin/lighttpd -t -f ${LIGHTTPD_CONF} >/dev/null
+}
+
+start() {
+ checkconfig || return 1
+ checkpath -d -q -m 0750 -o lighttpd:lighttpd /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 stopping lighttpd"
+ start-stop-daemon --quiet --pidfile "${LIGHTTPD_PID}" \
+ --signal INT
+ if eend $? ; then
+ rm -f "${LIGHTTPD_PID}"
+ start
+ fi
+}
diff --git a/user/lighttpd/lighttpd.logrotate b/user/lighttpd/lighttpd.logrotate
new file mode 100644
index 000000000..8fbb20fb0
--- /dev/null
+++ b/user/lighttpd/lighttpd.logrotate
@@ -0,0 +1,15 @@
+# $Header: /var/cvsroot/gentoo-x86/www-servers/lighttpd/files/lighttpd.logrotate,v 1.2 2006/05/30 19:49:29 bangert Exp $
+# lighttpd logrotate script for Gentoo
+
+/var/log/lighttpd/*.log {
+ daily
+ missingok
+ copytruncate
+ rotate 7
+ compress
+ notifempty
+ sharedscripts
+ postrotate
+ /etc/init.d/lighttpd --quiet --ifstarted reload
+ endscript
+}
diff --git a/user/lighttpd/lighttpd.pre-install b/user/lighttpd/lighttpd.pre-install
new file mode 100644
index 000000000..81ccda1f9
--- /dev/null
+++ b/user/lighttpd/lighttpd.pre-install
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+addgroup -S -g 82 www-data 2>/dev/null
+addgroup -S lighttpd 2>/dev/null
+adduser -S -D -H -h /var/www/localhost/htdocs -s /sbin/nologin -G lighttpd -g lighttpd lighttpd 2>/dev/null
+addgroup lighttpd www-data 2>/dev/null
+
+exit 0
diff --git a/user/lighttpd/lighttpd.pre-upgrade b/user/lighttpd/lighttpd.pre-upgrade
new file mode 120000
index 000000000..18a7fef66
--- /dev/null
+++ b/user/lighttpd/lighttpd.pre-upgrade
@@ -0,0 +1 @@
+lighttpd.pre-install \ No newline at end of file
diff --git a/user/lighttpd/mime-types.conf b/user/lighttpd/mime-types.conf
new file mode 100644
index 000000000..f24d4d858
--- /dev/null
+++ b/user/lighttpd/mime-types.conf
@@ -0,0 +1,79 @@
+###############################################################################
+# Default mime-types.conf for Gentoo.
+# include'd from lighttpd.conf.
+# $Header: /var/cvsroot/gentoo-x86/www-servers/lighttpd/files/conf/mime-types.conf,v 1.4 2010/03/14 21:45:18 bangert Exp $
+###############################################################################
+
+# {{{ mime types
+mimetype.assign = (
+ ".svg" => "image/svg+xml",
+ ".svgz" => "image/svg+xml",
+ ".pdf" => "application/pdf",
+ ".sig" => "application/pgp-signature",
+ ".spl" => "application/futuresplash",
+ ".class" => "application/octet-stream",
+ ".ps" => "application/postscript",
+ ".torrent" => "application/x-bittorrent",
+ ".dvi" => "application/x-dvi",
+ ".gz" => "application/x-gzip",
+ ".pac" => "application/x-ns-proxy-autoconfig",
+ ".swf" => "application/x-shockwave-flash",
+ ".tar.gz" => "application/x-tgz",
+ ".tgz" => "application/x-tgz",
+ ".tar" => "application/x-tar",
+ ".zip" => "application/zip",
+ ".dmg" => "application/x-apple-diskimage",
+ ".mp3" => "audio/mpeg",
+ ".m3u" => "audio/x-mpegurl",
+ ".wma" => "audio/x-ms-wma",
+ ".wax" => "audio/x-ms-wax",
+ ".ogg" => "application/ogg",
+ ".wav" => "audio/x-wav",
+ ".gif" => "image/gif",
+ ".jpg" => "image/jpeg",
+ ".jpeg" => "image/jpeg",
+ ".png" => "image/png",
+ ".xbm" => "image/x-xbitmap",
+ ".xpm" => "image/x-xpixmap",
+ ".xwd" => "image/x-xwindowdump",
+ ".css" => "text/css",
+ ".html" => "text/html",
+ ".htm" => "text/html",
+ ".js" => "text/javascript",
+ ".asc" => "text/plain",
+ ".c" => "text/plain",
+ ".h" => "text/plain",
+ ".cc" => "text/plain",
+ ".cpp" => "text/plain",
+ ".hh" => "text/plain",
+ ".hpp" => "text/plain",
+ ".conf" => "text/plain",
+ ".log" => "text/plain",
+ ".text" => "text/plain",
+ ".txt" => "text/plain",
+ ".diff" => "text/plain",
+ ".patch" => "text/plain",
+ ".ebuild" => "text/plain",
+ ".eclass" => "text/plain",
+ ".rtf" => "application/rtf",
+ ".bmp" => "image/bmp",
+ ".tif" => "image/tiff",
+ ".tiff" => "image/tiff",
+ ".ico" => "image/x-icon",
+ ".dtd" => "text/xml",
+ ".xml" => "text/xml",
+ ".mpeg" => "video/mpeg",
+ ".mpg" => "video/mpeg",
+ ".mov" => "video/quicktime",
+ ".qt" => "video/quicktime",
+ ".avi" => "video/x-msvideo",
+ ".asf" => "video/x-ms-asf",
+ ".asx" => "video/x-ms-asf",
+ ".wmv" => "video/x-ms-wmv",
+ ".bz2" => "application/x-bzip",
+ ".tbz" => "application/x-bzip-compressed-tar",
+ ".tar.bz2" => "application/x-bzip-compressed-tar"
+ )
+# }}}
+
+# vim: set ft=conf foldmethod=marker et :
diff --git a/user/lighttpd/mod_cgi.conf b/user/lighttpd/mod_cgi.conf
new file mode 100644
index 000000000..1cb3770f9
--- /dev/null
+++ b/user/lighttpd/mod_cgi.conf
@@ -0,0 +1,33 @@
+###############################################################################
+# mod_cgi.conf
+# include'd by lighttpd.conf.
+# $Header: /var/cvsroot/gentoo-x86/www-servers/lighttpd/files/conf/mod_cgi.conf,v 1.1 2005/08/27 12:36:13 ka0ttic Exp $
+###############################################################################
+
+#
+# see cgi.txt for more information on using mod_cgi
+#
+
+server.modules += ("mod_cgi")
+
+# NOTE: this requires mod_alias
+alias.url = (
+ "/cgi-bin/" => var.basedir + "/cgi-bin/"
+)
+
+#
+# Note that you'll also want to enable the
+# cgi-bin alias via mod_alias (above).
+#
+
+$HTTP["url"] =~ "^/cgi-bin/" {
+ # disable directory listings
+ dir-listing.activate = "disable"
+ # only allow cgi's in this directory
+ cgi.assign = (
+ ".pl" => "/usr/bin/perl",
+ ".cgi" => "/usr/bin/perl"
+ )
+}
+
+# vim: set ft=conf foldmethod=marker et :
diff --git a/user/lighttpd/mod_fastcgi.conf b/user/lighttpd/mod_fastcgi.conf
new file mode 100644
index 000000000..549b84c2e
--- /dev/null
+++ b/user/lighttpd/mod_fastcgi.conf
@@ -0,0 +1,17 @@
+###############################################################################
+# mod_fastcgi.conf
+# include'd by lighttpd.conf.
+# $Header: /var/cvsroot/gentoo-x86/www-servers/lighttpd/files/conf/mod_fastcgi.conf-1.4.13-r2,v 1.1 2007/04/01 23:22:00 robbat2 Exp $
+###############################################################################
+
+server.modules += ("mod_fastcgi")
+fastcgi.server = ( ".php" =>
+ ( "localhost" =>
+ (
+ "socket" => "/run/lighttpd/lighttpd-fastcgi-php-" + PID + ".socket",
+ "bin-path" => "/usr/bin/php-cgi"
+ )
+ )
+ )
+
+# vim: set ft=conf foldmethod=marker et :
diff --git a/user/lighttpd/mod_fastcgi_fpm.conf b/user/lighttpd/mod_fastcgi_fpm.conf
new file mode 100644
index 000000000..926137a43
--- /dev/null
+++ b/user/lighttpd/mod_fastcgi_fpm.conf
@@ -0,0 +1,16 @@
+###############################################################################
+# mod_fastcgi_fpm.conf
+# include'd by lighttpd.conf.
+###############################################################################
+
+server.modules += ("mod_fastcgi")
+fastcgi.server = ( ".php" =>
+ ( "localhost" =>
+ (
+ "host" => "127.0.0.1",
+ "port" => "9000"
+ )
+ )
+ )
+
+# vim: set ft=conf foldmethod=marker et :