diff options
author | 2013-10-14 20:29:26 +0100 | |
---|---|---|
committer | 2013-10-14 20:29:26 +0100 | |
commit | f9cd106e9bdbc4bc83aa42047b2576946a6138ac (patch) | |
tree | 767c6885a69796662ddf9a76745d40434da99b31 /www-servers | |
parent | wireless/bluez-4.101-r5 (diff) | |
download | srcshelton-f9cd106e9bdbc4bc83aa42047b2576946a6138ac.tar.gz srcshelton-f9cd106e9bdbc4bc83aa42047b2576946a6138ac.tar.bz2 srcshelton-f9cd106e9bdbc4bc83aa42047b2576946a6138ac.zip |
www-servers/lighttpd-1.4.32-r2
Diffstat (limited to 'www-servers')
-rw-r--r-- | www-servers/lighttpd/Manifest | 12 | ||||
-rw-r--r-- | www-servers/lighttpd/files/conf/lighttpd.conf | 330 | ||||
-rw-r--r-- | www-servers/lighttpd/files/conf/mime-types.conf | 79 | ||||
-rw-r--r-- | www-servers/lighttpd/files/conf/mod_cgi.conf | 33 | ||||
-rw-r--r-- | www-servers/lighttpd/files/conf/mod_fastcgi.conf | 17 | ||||
-rw-r--r-- | www-servers/lighttpd/files/conf/mod_fastcgi.conf-1.4.13-r2 | 17 | ||||
-rw-r--r-- | www-servers/lighttpd/files/lighttpd-1.4.29-mod_uploadprogress.patch | 738 | ||||
-rw-r--r-- | www-servers/lighttpd/files/lighttpd.confd | 12 | ||||
-rw-r--r-- | www-servers/lighttpd/files/lighttpd.initd | 73 | ||||
-rw-r--r-- | www-servers/lighttpd/files/lighttpd.logrotate | 17 | ||||
-rw-r--r-- | www-servers/lighttpd/files/lighttpd.service | 10 | ||||
-rw-r--r-- | www-servers/lighttpd/lighttpd-1.4.32-r2.ebuild | 227 |
12 files changed, 1565 insertions, 0 deletions
diff --git a/www-servers/lighttpd/Manifest b/www-servers/lighttpd/Manifest new file mode 100644 index 00000000..5e428d13 --- /dev/null +++ b/www-servers/lighttpd/Manifest @@ -0,0 +1,12 @@ +AUX conf/lighttpd.conf 8383 SHA256 52598c3428ede27e2784861df16cc1f7b811feee4f4273b26515aba4a79431b6 SHA512 8befa83dd2ccc1df0187c31c233a3bffd7d059ccc1ce4aa96fbd9a6fd0c402d8ddf0f6b9bd8dc7ff2279103ee92ddd53ecf6aac509deb3ffc17d62ed1cad413e WHIRLPOOL 685806f9e770c803f7a0498b4b9f8f4d1aaad510ec93f61979c3ab8e9ed4e34893bccf03b6e33c9d7798943c1110b3409782d863c345a6e6f1f9312c1106b1fb +AUX conf/mime-types.conf 3436 SHA256 75a6fce072250ebccde2320996fdace0ebfeb525b03322f0b454f8f4e0e29a85 SHA512 a3f2f5763885d7e4f510491b24164e34aaf62bb02daa12991575dc64335c12668355af5bb8d6ce191eb4e9cce95324b1f7c9ba61b323b4e7b50a1e03e021afcf WHIRLPOOL 4302b7ea4d95d35c52f3a4f4d70b7501d5d84ab38a159f1e13a546b072fa051ed99eeac5e234e5788c788d18d1a60e31cca5af0c56a4a6bfd4e468ecbd1550ff +AUX conf/mod_cgi.conf 869 SHA256 322656b4cfd22ca9f1f8ab160e0b932f1646622422fd49c6fc82ab416223eecf SHA512 27cc638d8068dcf47bd9db44943d1db6c6f4e8e6abd6b42af7cea004b1c093440068541d98c68f8bea70b956713adaf8ed59a4b642dea826ee8620a05f8cfde5 WHIRLPOOL 6384804166120172603e92dd1642666b995fe1987fa8033518d0395b7e0b9e029a06edb989515f405dd5a5e4c5e5c0706d98e24a72ca4f1ff6c35c9607200c73 +AUX conf/mod_fastcgi.conf 677 SHA256 954bf2a030e268e7cd880d4cd7d6c13317c09e0ec4e87a8d7d887fb4e7dc83bd SHA512 0e9ba1403c44bcca6740803f8932caf2d787641d139db3ff1d3d3234234368774875493b8dd82e5e5337791de945d9ddeb578f665cec5503747e5bdf2c5318ba WHIRLPOOL b7378d44772216076ca9bba05104c03a256035a1a604f0366d76e6b5d0709212a1f3e222f8cbb9e0daabd28e513d4322eeb39e6b2e2950ffff9d3602c960bce9 +AUX conf/mod_fastcgi.conf-1.4.13-r2 687 SHA256 d1adc1358b5d9e85353caa2e706bfa231d145dd59c075cdcb3f818b3cb5d722e SHA512 1f7ca06b3501326f204bfa4de2694b1552fddfac5af52357a5cea5861c20204069adf6f92ea0c267968e5e2dc02804e34a61eb710026c213e3523a490254b3aa WHIRLPOOL 8e125710abe0467170a83f17a2b6cbe79d7a17ad9dde9b158a1be1dca2cc14ecfa2db6a4856371f1240f528caf22f0809523f1b13c81bab9e6ec70fd4f0abe59 +AUX lighttpd-1.4.29-mod_uploadprogress.patch 22472 SHA256 b7b13ae1de4bbe2cf2687686ae4921d4ae2f66fc524703b3c63924b6d888934f SHA512 b790e36f803765c922da970ca69a851afa7f03aa8aedb9ecaf21d326794fa8622959b953705d0d9ff4125504478da7b384fa969d1c70e35623b3a3d4bb4b90bc WHIRLPOOL 837792c531c7522a11618f99574716c2b4a1eb43f906cf6e50fcd6bf10fe85ab451ad160d072830cd0d813e69a1b15fa5eb3808db75b2516244b55418e20a92e +AUX lighttpd.confd 383 SHA256 bb6e6721f33e6582a91025f3500e159a599fb856d699e9394093e1018c7925e0 SHA512 a28bf860ed23836063c37c14ca33dcd70f4b1234326442f8c0bc23b44efb53f5752292a98cf5f4a6c6cfc0f9e06b3c8a2f9d3b9512b0146e680af021570ad16d WHIRLPOOL cea38f5edf0e0d30c46e815adbb03579816979215789944564f1b1bdb53a97f566857bb8bd72954bc91ae641a3a898ed87033980f7f69466ae33fbad5df88b35 +AUX lighttpd.initd 1682 SHA256 4e7741cf9f702c981f14852357e7e1dcac7bb26b32dd5e872af01fce6026ffc8 SHA512 fe4e755c95355bb9c81f2a13b30df37e282238b3e5288335ca7ac66d6a2b6353ae3187446d0e2537f5094b37de884ef207859cc3ac7fd9f69df58c711dab405a WHIRLPOOL 764ceb47fa89eb81e930bedbf1401a04d0dbdf3c02e115bd5da991a77d35c7bd402d1753b8bd37df9206220874b8d1ae735f2ac0c176a4a7a15b70f497fe6b78 +AUX lighttpd.logrotate 487 SHA256 503ee1cd454e2c0f9a212ef60dc8321893eda06ccf721ecbe94d189a09e0bc6c SHA512 e1284fe9ab4b9a53c21b40a5ac3e77e66343e187321b8a2f7464db64747f3a99f7e17a9e7c0e298db84a24fa1286cfe344dbff182eddd9de5c0605f5397a6972 WHIRLPOOL 96538a7fb86d6cb19dbc8eb6034e305fbc574edeb29e45d7fd8e58234fb8f1812daf7c1d845f9dfa052ebf9bfdc84b801a8aa68dfbad08aa88f32b0838a5bf5c +AUX lighttpd.service 252 SHA256 bcd5a17df1bf5fe1cd2af9393e18c33a23eca5fb706de44472b214dd0cfb82fc SHA512 0a890005a8eb7d813c687bca8611018cf158152d04eb8355abf963cb74c06d712060bb66cb96d8d6d48ac71839b89bfec74e32b8f143b411c8570ec9c38ae5be WHIRLPOOL 811c4cfe203e261493da5d42dac541001982faffc0335e1a0359cb5d0b174aae136d825d4c63d89d90b3ed33d5d47fb6ce39dce6792443486b3d113ba99fecfb +DIST lighttpd-1.4.32.tar.bz2 681065 SHA256 60691b2dcf3ad2472c06b23d75eb0c164bf48a08a630ed3f308f61319104701f SHA512 ffd5488a2ed57daa26b6d16223f422a94e88f2488cdc50bbb354c45daa535fbf9231fbbe73c23327a0adb708cc2b67fbdc60c34195a2a46a171dcc0f30bb3efb WHIRLPOOL 0f537296ae2a321962a4e4bc9a45631d334cf180a5aee1a182e6d95ebdcabfec6df4d229e888ce9170f526ab716c323cc66947413747ee91e6f73e2a4a0d4526 +EBUILD lighttpd-1.4.32-r2.ebuild 6795 SHA256 983efc737afbc65ab5b1d89ac70b8f723c9cf7ab60f54881194b553db53d3616 SHA512 953a0b77f312513be35735738df46b2a6ba092e803bd02c32c5f8041bd66b0f5f2f183a36e2bb78b47fc51ce20250ecf81eb72f6407647eaf1b7aa44392ccef6 WHIRLPOOL 88ecdd22f38ce62b6c6a8babc4072b9f1ccb6ad60435249c5d058b2a1ed5ad383da87f74c21a7485f4b82c24f0ff0479034b73d63e01c716c96902e45628f08f diff --git a/www-servers/lighttpd/files/conf/lighttpd.conf b/www-servers/lighttpd/files/conf/lighttpd.conf new file mode 100644 index 00000000..5ea46837 --- /dev/null +++ b/www-servers/lighttpd/files/conf/lighttpd.conf @@ -0,0 +1,330 @@ +############################################################################### +# Default lighttpd.conf for Gentoo. +# $Header: /var/cvsroot/gentoo-x86/www-servers/lighttpd/files/conf/lighttpd.conf,v 1.5 2010/11/18 15:13:47 hwoarang Exp $ +############################################################################### + +# {{{ 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_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" +) +# }}} + +# {{{ includes +include "mime-types.conf" +# fcgi and cgi are included below +# }}} + +# {{{ 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.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" +# 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" + +# 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_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" +# }}} + +# {{{ 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/conf/mime-types.conf b/www-servers/lighttpd/files/conf/mime-types.conf new file mode 100644 index 00000000..f24d4d85 --- /dev/null +++ b/www-servers/lighttpd/files/conf/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/www-servers/lighttpd/files/conf/mod_cgi.conf b/www-servers/lighttpd/files/conf/mod_cgi.conf new file mode 100644 index 00000000..1cb3770f --- /dev/null +++ b/www-servers/lighttpd/files/conf/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/www-servers/lighttpd/files/conf/mod_fastcgi.conf b/www-servers/lighttpd/files/conf/mod_fastcgi.conf new file mode 100644 index 00000000..b70aff1d --- /dev/null +++ b/www-servers/lighttpd/files/conf/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,v 1.3 2009/04/03 20:59:34 bangert Exp $ +############################################################################### + +server.modules += ("mod_fastcgi") +fastcgi.server = ( ".php" => + ( "localhost" => + ( + "socket" => "/var/run/lighttpd/lighttpd-fastcgi-php-" + PID + ".socket", + "bin-path" => "/usr/bin/php-cgi" + ) + ) + ) + +# vim: set ft=conf foldmethod=marker et : diff --git a/www-servers/lighttpd/files/conf/mod_fastcgi.conf-1.4.13-r2 b/www-servers/lighttpd/files/conf/mod_fastcgi.conf-1.4.13-r2 new file mode 100644 index 00000000..ca1369af --- /dev/null +++ b/www-servers/lighttpd/files/conf/mod_fastcgi.conf-1.4.13-r2 @@ -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" => "/var/run/lighttpd/lighttpd-fastcgi-php-" + PID + ".socket", + "bin-path" => "/usr/bin/php-cgi" + ) + ) + ) + +# vim: set ft=conf foldmethod=marker et : diff --git a/www-servers/lighttpd/files/lighttpd-1.4.29-mod_uploadprogress.patch b/www-servers/lighttpd/files/lighttpd-1.4.29-mod_uploadprogress.patch new file mode 100644 index 00000000..c99886af --- /dev/null +++ b/www-servers/lighttpd/files/lighttpd-1.4.29-mod_uploadprogress.patch @@ -0,0 +1,738 @@ +diff -Nru lighttpd-1.4.22.orig/src/connections.c lighttpd-1.4.22/src/connections.c +--- lighttpd-1.4.22.orig/src/connections.c 2009-02-19 14:15:14.000000000 +0100 ++++ lighttpd-1.4.28/src/connections.c 2009-04-22 17:45:20.000000000 +0200 +@@ -1401,11 +1401,15 @@ + if (http_request_parse(srv, con)) { + /* we have to read some data from the POST request */ + ++ plugins_call_handle_request_end(srv, con); ++ + connection_set_state(srv, con, CON_STATE_READ_POST); + + break; + } + ++ plugins_call_handle_request_end(srv, con); ++ + connection_set_state(srv, con, CON_STATE_HANDLE_REQUEST); + + break; +diff -Nru lighttpd-1.4.22.orig/src/Makefile.am lighttpd-1.4.22/src/Makefile.am +--- lighttpd-1.4.22.orig/src/Makefile.am 2009-02-19 14:15:14.000000000 +0100 ++++ lighttpd-1.4.28/src/Makefile.am 2009-04-22 17:46:34.000000000 +0200 +@@ -246,6 +246,11 @@ + mod_accesslog_la_LDFLAGS = -module -export-dynamic -avoid-version -no-undefined + mod_accesslog_la_LIBADD = $(common_libadd) + ++lib_LTLIBRARIES += mod_uploadprogress.la ++mod_uploadprogress_la_SOURCES = mod_uploadprogress.c ++mod_uploadprogress_la_LDFLAGS = -module -export-dynamic -avoid-version -no-undefined ++mod_uploadprogress_la_LIBADD = $(common_libadd) ++ + + hdr = server.h buffer.h network.h log.h keyvalue.h \ + response.h request.h fastcgi.h chunk.h \ +diff -Nru lighttpd-1.4.22.orig/src/plugin.c lighttpd-1.4.22/src/plugin.c +--- lighttpd-1.4.22.orig/src/plugin.c 2009-02-19 14:15:14.000000000 +0100 ++++ lighttpd-1.4.28/src/plugin.c 2009-04-22 17:45:20.000000000 +0200 +@@ -34,6 +34,7 @@ + PLUGIN_FUNC_UNSET, + PLUGIN_FUNC_HANDLE_URI_CLEAN, + PLUGIN_FUNC_HANDLE_URI_RAW, ++ PLUGIN_FUNC_HANDLE_REQUEST_END, + PLUGIN_FUNC_HANDLE_REQUEST_DONE, + PLUGIN_FUNC_HANDLE_CONNECTION_CLOSE, + PLUGIN_FUNC_HANDLE_TRIGGER, +@@ -262,6 +263,7 @@ + + PLUGIN_TO_SLOT(PLUGIN_FUNC_HANDLE_URI_CLEAN, handle_uri_clean) + PLUGIN_TO_SLOT(PLUGIN_FUNC_HANDLE_URI_RAW, handle_uri_raw) ++PLUGIN_TO_SLOT(PLUGIN_FUNC_HANDLE_REQUEST_END, handle_request_end) + PLUGIN_TO_SLOT(PLUGIN_FUNC_HANDLE_REQUEST_DONE, handle_request_done) + PLUGIN_TO_SLOT(PLUGIN_FUNC_HANDLE_CONNECTION_CLOSE, handle_connection_close) + PLUGIN_TO_SLOT(PLUGIN_FUNC_HANDLE_SUBREQUEST, handle_subrequest) +@@ -389,6 +391,7 @@ + + PLUGIN_TO_SLOT(PLUGIN_FUNC_HANDLE_URI_CLEAN, handle_uri_clean); + PLUGIN_TO_SLOT(PLUGIN_FUNC_HANDLE_URI_RAW, handle_uri_raw); ++ PLUGIN_TO_SLOT(PLUGIN_FUNC_HANDLE_REQUEST_END, handle_request_end); + PLUGIN_TO_SLOT(PLUGIN_FUNC_HANDLE_REQUEST_DONE, handle_request_done); + PLUGIN_TO_SLOT(PLUGIN_FUNC_HANDLE_CONNECTION_CLOSE, handle_connection_close); + PLUGIN_TO_SLOT(PLUGIN_FUNC_HANDLE_TRIGGER, handle_trigger); +diff -Nru lighttpd-1.4.22.orig/src/plugin.h lighttpd-1.4.22/src/plugin.h +--- lighttpd-1.4.22.orig/src/plugin.h 2009-02-19 14:15:14.000000000 +0100 ++++ lighttpd-1.4.28/src/plugin.h 2009-04-22 17:45:20.000000000 +0200 +@@ -42,12 +42,12 @@ + handler_t (* handle_uri_clean) (server *srv, connection *con, void *p_d); /* after uri is set */ + handler_t (* handle_docroot) (server *srv, connection *con, void *p_d); /* getting the document-root */ + handler_t (* handle_physical) (server *srv, connection *con, void *p_d); /* mapping url to physical path */ ++ handler_t (* handle_request_end) (server *srv, connection *con, void *p_d); /* a handler for the request content */ + handler_t (* handle_request_done) (server *srv, connection *con, void *p_d); /* at the end of a request */ + handler_t (* handle_connection_close)(server *srv, connection *con, void *p_d); /* at the end of a connection */ + handler_t (* handle_joblist) (server *srv, connection *con, void *p_d); /* after all events are handled */ + + +- + handler_t (* handle_subrequest_start)(server *srv, connection *con, void *p_d); + + /* when a handler for the request +@@ -68,6 +68,7 @@ + handler_t plugins_call_handle_uri_clean(server *srv, connection *con); + handler_t plugins_call_handle_subrequest_start(server *srv, connection *con); + handler_t plugins_call_handle_subrequest(server *srv, connection *con); ++handler_t plugins_call_handle_request_end(server *srv, connection *con); + handler_t plugins_call_handle_request_done(server *srv, connection *con); + handler_t plugins_call_handle_docroot(server *srv, connection *con); + handler_t plugins_call_handle_physical(server *srv, connection *con); +diff -Nru lighttpd-1.4.22.orig/src/mod_uploadprogress.c lighttpd-1.4.22/src/mod_uploadprogress.c +--- lighttpd-1.4.22.orig/src/mod_uploadprogress.c 1970-01-01 01:00:00.000000000 +0100 ++++ lighttpd-1.4.28/src/mod_uploadprogress.c 2009-04-22 17:32:38.000000000 +0200 +@@ -0,0 +1,648 @@ ++#include <ctype.h> ++#include <stdlib.h> ++#include <string.h> ++ ++#include "base.h" ++#include "log.h" ++#include "buffer.h" ++ ++#include "plugin.h" ++ ++#include "response.h" ++#include "stat_cache.h" ++ ++#define CONFIG_UPLOAD_PROGRESS_URL "upload-progress.progress-url" ++#define CONFIG_UPLOAD_PROGRESS_TIMEOUT "upload-progress.remove-timeout" ++#define CONFIG_UPLOAD_PROGRESS_DEBUG "upload-progress.debug" ++ ++#define SAFE_BUF_STR(x) x && x->ptr ? x->ptr : "(null)" ++ ++/** ++ * uploadprogress for lighttpd ++ * ++ * Initial: Jan Kneschke <jan@kneschke.de> ++ * Timeout+Status addon: Bjoern Kalkbrenner <terminar@cyberphoria.org> [20070112] ++ * ++ * Ported to Lighttpd 1.4.22 by Radek Senfeld <rush@logic.cz> ++ * ++ * Backport based on revision 2369 ++ * http://redmine.lighttpd.net/projects/lighttpd/repository/changes/trunk/src/mod_uploadprogress.c ++ * ++ * the timeout is used to keep in the status information intact even if the parent ++ * connection is gone already ++ * ++ */ ++ ++typedef struct { ++ buffer *tracking_id; ++ connection *con; ++ ++ time_t timeout; ++ int status; ++ off_t size; ++} connection_map_entry; ++ ++typedef struct { ++ connection_map_entry **ptr; ++ ++ size_t used; ++ size_t size; ++} connection_map; ++ ++/* plugin config for all request/connections */ ++ ++typedef struct { ++ buffer *progress_url; ++ unsigned short debug; ++ unsigned short remove_timeout; ++} plugin_config; ++ ++typedef struct { ++ PLUGIN_DATA; ++ ++ connection_map *con_map; ++ ++ buffer *tmp_buf; /** used as temporary buffer for extracting the tracking id */ ++ ++ plugin_config **config_storage; ++ ++ plugin_config conf; ++} plugin_data; ++ ++/** ++ * ++ * connection maps ++ * ++ */ ++ ++/* init the plugin data */ ++static connection_map *connection_map_init() { ++ connection_map *cm; ++ ++ cm = calloc(1, sizeof(*cm)); ++ ++ return cm; ++} ++ ++static void connection_map_free(connection_map *cm) { ++ size_t i; ++ for (i = 0; i < cm->size; i++) { ++ connection_map_entry *cme = cm->ptr[i]; ++ ++ if (!cme) break; ++ ++ if (cme->tracking_id) { ++ buffer_free(cme->tracking_id); ++ } ++ free(cme); ++ } ++ ++ free(cm); ++} ++ ++static connection_map_entry *connection_map_insert(connection_map *cm, buffer *tracking_id, connection *con) { ++ connection_map_entry *cme; ++ size_t i; ++ ++ if (cm->size == 0) { ++ cm->size = 16; ++ cm->ptr = malloc(cm->size * sizeof(*(cm->ptr))); ++ for (i = 0; i < cm->size; i++) { ++ cm->ptr[i] = NULL; ++ } ++ } else if (cm->used == cm->size) { ++ cm->size += 16; ++ cm->ptr = realloc(cm->ptr, cm->size * sizeof(*(cm->ptr))); ++ for (i = cm->used; i < cm->size; i++) { ++ cm->ptr[i] = NULL; ++ } ++ } ++ ++ if (cm->ptr[cm->used]) { ++ /* is already alloced, just reuse it */ ++ cme = cm->ptr[cm->used]; ++ } else { ++ cme = malloc(sizeof(*cme)); ++ cme->tracking_id = buffer_init(); ++ } ++ cme->timeout = 0; ++ cme->status = 0; ++ buffer_copy_string_buffer(cme->tracking_id, tracking_id); ++ cme->con = con; ++ ++ cm->ptr[cm->used++] = cme; ++ ++ return cme; ++} ++ ++static connection_map_entry *connection_map_get_connection_entry(connection_map *cm, buffer *tracking_id) { ++ size_t i; ++ ++ for (i = 0; i < cm->used; i++) { ++ connection_map_entry *cme = cm->ptr[i]; ++ ++ if (buffer_is_equal(cme->tracking_id, tracking_id)) { ++ /* found connection */ ++ return cme; ++ } ++ } ++ return NULL; ++} ++ ++static void connection_map_remove_connection(connection_map *cm, size_t i) { ++ connection_map_entry *cme = cm->ptr[i]; ++ ++ buffer_reset(cme->tracking_id); ++ cme->timeout=0; ++ cme->status=0; ++ ++ cm->used--; ++ ++ /* swap positions with the last entry */ ++ if (cm->used) { ++ cm->ptr[i] = cm->ptr[cm->used]; ++ cm->ptr[cm->used] = cme; ++ } ++} ++ ++/** ++ * remove dead tracking IDs ++ * ++ * uploadprogress.remove-timeout sets a grace-period in which the ++ * connection status is still known even of the connection is already ++ * being removed ++ * ++ */ ++static void connection_map_clear_timeout_connections(connection_map *cm) { ++ size_t i; ++ time_t now_t = time(NULL); ++ ++ for (i = 0; i < cm->used; i++) { ++ connection_map_entry *cme = cm->ptr[i]; ++ ++ if (cme->timeout != 0 && cme->timeout < now_t) { ++ /* found connection */ ++ connection_map_remove_connection(cm, i); ++ } ++ } ++} ++ ++/** ++ * extract the tracking-id from the parameters ++ * ++ * for POST requests it is part of the request headers ++ * for GET requests ... too ++ */ ++static buffer *get_tracking_id(plugin_data *p, server *srv, connection *con) { ++ data_string *ds; ++ buffer *b = NULL; ++ char *qstr=NULL; ++ size_t i; ++ ++ /* the request has to contain a 32byte ID */ ++ if (NULL == (ds = (data_string *)array_get_element(con->request.headers, "X-Progress-ID"))) { ++ char *amp = NULL; ++ ++ /* perhaps the POST request is using the querystring to pass the X-Progress-ID */ ++ if (buffer_is_empty(con->uri.query)) { ++ /* ++ * con->uri.query will not be parsed out if a 413 error happens ++ */ ++ if (NULL != (qstr = strchr(con->request.uri->ptr, '?'))) { ++ /** extract query string from request.uri */ ++ buffer_copy_string(con->uri.query, qstr + 1); ++ } else { ++ return NULL; ++ } ++ } ++ ++ /** split the query-string and extract the X-Progress-ID */ ++ do { ++ char *eq = NULL; ++ char *start = amp ? amp + 1 : con->uri.query->ptr; ++ ++ amp = strchr(start, '&'); ++ ++ /* check the string between start and amp for = */ ++ ++ if (amp) { ++ buffer_copy_string_len(p->tmp_buf, start, amp - start); ++ } else { ++ buffer_copy_string(p->tmp_buf, start); ++ } ++ ++ eq = strchr(p->tmp_buf->ptr, '='); ++ ++ if (eq) { ++ *eq = '\0'; ++ ++ if (0 == strcmp(p->tmp_buf->ptr, "X-Progress-ID")) { ++ size_t key_len = sizeof("X-Progress-ID") - 1; ++ size_t var_len = p->tmp_buf->used - 1; ++ /* found */ ++ ++ buffer_copy_string_len(p->tmp_buf, start + key_len + 1, var_len - key_len - 1); ++ ++ b = p->tmp_buf; ++ ++ break; ++ } ++ } ++ } while (amp); ++ ++ if (!b) return NULL; ++ } else { ++ /* request header was found, use it */ ++ b = ds->value; ++ } ++ ++ if (b->used != 32 + 1) { ++ if (p->conf.debug) log_error_write(srv, __FILE__, __LINE__, "sds", "the Progress-ID has to be 32 characters long, got", b->used - 1, "characters"); ++ return NULL; ++ } ++ ++ for (i = 0; i < b->used - 1; i++) { ++ char c = b->ptr[i]; ++ ++ if (!light_isxdigit(c)) { ++ if (p->conf.debug) log_error_write(srv, __FILE__, __LINE__, "sds", "only hex-digits are allowed (0-9 + a-f): (ascii:", c, ")"); ++ return NULL; ++ } ++ } ++ ++ return b; ++} ++ ++/* init the plugin data */ ++INIT_FUNC(mod_uploadprogress_init) { ++ plugin_data *p; ++ ++ p = calloc(1, sizeof(*p)); ++ ++ p->con_map = connection_map_init(); ++ p->tmp_buf = buffer_init(); ++ ++ return p; ++} ++ ++/* detroy the plugin data */ ++FREE_FUNC(mod_uploadprogress_free) { ++ plugin_data *p = p_d; ++ ++ UNUSED(srv); ++ ++ if (!p) return HANDLER_GO_ON; ++ ++ if (p->config_storage) { ++ size_t i; ++ for (i = 0; i < srv->config_context->used; i++) { ++ plugin_config *s = p->config_storage[i]; ++ ++ buffer_free(s->progress_url); ++ s->remove_timeout=0; ++ ++ free(s); ++ } ++ free(p->config_storage); ++ } ++ ++ connection_map_free(p->con_map); ++ buffer_free(p->tmp_buf); ++ ++ free(p); ++ ++ return HANDLER_GO_ON; ++} ++ ++/* handle plugin config and check values */ ++ ++SETDEFAULTS_FUNC(mod_uploadprogress_set_defaults) { ++ plugin_data *p = p_d; ++ size_t i = 0; ++ ++ config_values_t cv[] = { ++ { CONFIG_UPLOAD_PROGRESS_URL, NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 0 */ ++ { CONFIG_UPLOAD_PROGRESS_TIMEOUT, NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_CONNECTION }, /* 1 */ ++ { CONFIG_UPLOAD_PROGRESS_DEBUG, NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION }, /* 2 */ ++ { NULL, NULL, T_CONFIG_UNSET, T_CONFIG_SCOPE_UNSET } ++ }; ++ ++ if (!p) return HANDLER_ERROR; ++ ++ p->config_storage = calloc(1, srv->config_context->used * sizeof(specific_config *)); ++ ++ for (i = 0; i < srv->config_context->used; i++) { ++ plugin_config *s; ++ ++ s = calloc(1, sizeof(plugin_config)); ++ s->progress_url = buffer_init(); ++ s->remove_timeout = 60; ++ s->debug = 0; ++ ++ cv[0].destination = s->progress_url; ++ cv[1].destination = &(s->remove_timeout); ++ cv[2].destination = &(s->debug); ++ ++ p->config_storage[i] = s; ++ ++ if (0 != config_insert_values_global(srv, ((data_config *)srv->config_context->data[i])->value, cv)) { ++ return HANDLER_ERROR; ++ } ++ } ++ ++ return HANDLER_GO_ON; ++} ++ ++#define PATCH_OPTION(x) \ ++ p->conf.x = s->x; ++static int mod_uploadprogress_patch_connection(server *srv, connection *con, plugin_data *p) { ++ size_t i, j; ++ plugin_config *s = p->config_storage[0]; ++ ++ PATCH_OPTION(progress_url); ++ PATCH_OPTION(remove_timeout); ++ PATCH_OPTION(debug); ++ ++ /* skip the first, the global context */ ++ for (i = 1; i < srv->config_context->used; i++) { ++ data_config *dc = (data_config *)srv->config_context->data[i]; ++ s = p->config_storage[i]; ++ ++ /* condition didn't match */ ++ if (!config_check_cond(srv, con, dc)) continue; ++ ++ /* merge config */ ++ for (j = 0; j < dc->value->used; j++) { ++ data_unset *du = dc->value->data[j]; ++ ++ if (buffer_is_equal_string(du->key, CONST_STR_LEN(CONFIG_UPLOAD_PROGRESS_URL))) { ++ PATCH_OPTION(progress_url); ++ } else if (buffer_is_equal_string(du->key, CONST_STR_LEN(CONFIG_UPLOAD_PROGRESS_TIMEOUT))) { ++ PATCH_OPTION(remove_timeout); ++ } else if (buffer_is_equal_string(du->key, CONST_STR_LEN(CONFIG_UPLOAD_PROGRESS_DEBUG))) { ++ PATCH_OPTION(debug); ++ } ++ } ++ } ++ ++ return 0; ++} ++ ++/** ++ * ++ * the idea: ++ * ++ * for the first request we check if it is a post-request ++ * ++ * if no, move out, don't care about them ++ * ++ * if yes, take the connection structure and register it locally ++ * in the progress-struct together with an session-id (md5 ... ) ++ * ++ * if the connections closes, cleanup the entry in the progress-struct ++ * ++ * a second request can now get the info about the size of the upload, ++ * the received bytes ++ * ++ */ ++ ++URIHANDLER_FUNC(mod_uploadprogress_uri_handler) { ++ plugin_data *p = p_d; ++ buffer *tracking_id; ++ buffer *b; ++ connection_map_entry *post_con_entry = NULL; ++ connection_map_entry *map_con_entry = NULL; ++ ++ if (buffer_is_empty(con->uri.path)) return HANDLER_GO_ON; ++ ++ /* no progress URL set, ignore request */ ++ if (buffer_is_empty(p->conf.progress_url)) return HANDLER_GO_ON; ++ ++ switch(con->request.http_method) { ++ case HTTP_METHOD_POST: ++ /** ++ * a POST request is the UPLOAD itself ++ * ++ * get the unique tracker id ++ */ ++ if (NULL == (tracking_id = get_tracking_id(p, srv, con))) { ++ return HANDLER_GO_ON; ++ } ++ ++ if (NULL == (map_con_entry = connection_map_get_connection_entry(p->con_map, tracking_id))) { ++ connection_map_insert(p->con_map, tracking_id, con); ++ ++ if (p->conf.debug) log_error_write(srv, __FILE__, __LINE__, "ss", "POST: connection is new, registered:", SAFE_BUF_STR(tracking_id)); ++ } else { ++ map_con_entry->timeout = 0; ++ map_con_entry->status = 0; ++ ++ if (p->conf.debug) log_error_write(srv, __FILE__, __LINE__, "ss", "POST: connection is known, id:", SAFE_BUF_STR(tracking_id)); ++ } ++ ++ return HANDLER_GO_ON; ++ case HTTP_METHOD_GET: ++ /** ++ * the status request for the current connection ++ */ ++ if (p->conf.debug) log_error_write(srv, __FILE__, __LINE__, "ssss", "(uploadprogress) urls", SAFE_BUF_STR(con->uri.path), "==", SAFE_BUF_STR(p->conf.progress_url)); ++ ++ if (!buffer_is_equal(con->uri.path, p->conf.progress_url)) { ++ return HANDLER_GO_ON; ++ } ++ ++ /* get the tracker id */ ++ if (NULL == (tracking_id = get_tracking_id(p, srv, con))) { ++ return HANDLER_GO_ON; ++ } ++ ++ buffer_reset(con->physical.path); ++ ++ con->file_started = 1; ++ con->http_status = 200; ++ con->file_finished = 1; ++ ++ /* send JSON content */ ++ ++ response_header_overwrite(srv, con, CONST_STR_LEN("Content-Type"), CONST_STR_LEN("text/javascript")); ++ ++ /* just an attempt the force the IE/proxies to NOT cache the request */ ++ response_header_overwrite(srv, con, CONST_STR_LEN("Pragma"), CONST_STR_LEN("no-cache")); ++ response_header_overwrite(srv, con, CONST_STR_LEN("Expires"), CONST_STR_LEN("Thu, 19 Nov 1981 08:52:00 GMT")); ++ response_header_overwrite(srv, con, CONST_STR_LEN("Cache-Control"), ++ CONST_STR_LEN("no-store, no-cache, must-revalidate, post-check=0, pre-check=0")); ++ ++ b = chunkqueue_get_append_buffer(con->write_queue); ++ ++ /* get the connection */ ++ if (NULL == (post_con_entry = connection_map_get_connection_entry(p->con_map, tracking_id))) { ++ /** ++ * looks like we don't know the tracking id yet, GET and POST out of sync ? */ ++ buffer_append_string_len(b, CONST_STR_LEN("{ \"state\" : \"unknown\" }\r\n")); ++ con->response.content_length += b->used - 1; ++ ++ if (p->conf.debug) log_error_write(srv, __FILE__, __LINE__, "ssss", "connection unknown:", SAFE_BUF_STR(tracking_id), ", sending:", SAFE_BUF_STR(b)); ++ ++ return HANDLER_FINISHED; ++ } ++ ++ buffer_copy_string_len(b, CONST_STR_LEN("{ \"state\" : ")); ++ ++ if (post_con_entry->status == 413) { ++ /* the upload was too large */ ++ buffer_append_string_len(b, CONST_STR_LEN("\"error\", \"status\" : 413")); ++ } else if (post_con_entry->con == NULL) { ++ /* the connection is already gone */ ++ buffer_append_string_len(b, CONST_STR_LEN("\"done\", \"size\" : ")); ++ buffer_append_off_t(b, post_con_entry->size); ++ } else { ++ /* the upload is already done, but the connection might be still open */ ++ buffer_append_string(b, post_con_entry->con->state == CON_STATE_READ_POST ? "\"uploading\"" : "\"done\""); ++ buffer_append_string_len(b, CONST_STR_LEN(", \"received\" : ")); ++ buffer_append_off_t(b, post_con_entry->con->bytes_read); ++ buffer_append_string_len(b, CONST_STR_LEN(", \"size\" : ")); ++ buffer_append_off_t(b, post_con_entry->con->request.content_length); ++ } ++ buffer_append_string_len(b, CONST_STR_LEN("}\r\n")); ++ con->response.content_length += b->used - 1; ++ ++ if (p->conf.debug) log_error_write(srv, __FILE__, __LINE__, "ssss", "connection is known:", SAFE_BUF_STR(tracking_id), ", sending:", SAFE_BUF_STR(b)); ++ ++ return HANDLER_FINISHED; ++ default: ++ break; ++ } ++ ++ return HANDLER_GO_ON; ++} ++ ++/** ++ * check for POST request ++ */ ++CONNECTION_FUNC(mod_uploadprogress_request_end) { ++ plugin_data *p = p_d; ++ ++ buffer *tracking_id; ++ connection_map_entry *map_con_entry = NULL; ++ ++ UNUSED(srv); ++ ++ /* no request URL, ignore request */ ++ if (buffer_is_empty(con->request.uri)) return HANDLER_GO_ON; ++ ++ mod_uploadprogress_patch_connection(srv, con, p); ++ ++ /* ++ * we only want to process the upload (POST request) ++ */ ++ if (con->request.http_method != HTTP_METHOD_POST) { ++ return HANDLER_GO_ON; ++ } ++ ++ if (p->conf.debug) { ++ log_error_write(srv, __FILE__, __LINE__, "sxsdsd", "request_end: con=", (void *) con, ", http_method=", con->request.http_method, ", http_status=", con->http_status); ++ } ++ ++ /* get the tracker id */ ++ if (NULL == (tracking_id = get_tracking_id(p, srv, con))) { ++ return HANDLER_GO_ON; ++ } ++ ++ if (NULL == (map_con_entry = connection_map_get_connection_entry(p->con_map, tracking_id))) { ++ /** ++ * in case the request parser meant the request was too large the URI handler won't ++ * get called. Insert the connection mapping here ++ */ ++ if (NULL == (map_con_entry = connection_map_insert(p->con_map, tracking_id, con))) { ++ return HANDLER_GO_ON; ++ } ++ } ++ ++ /* ok, found our entries, setting status */ ++ map_con_entry->status = con->http_status; ++ ++ return HANDLER_GO_ON; ++} ++ ++/** ++ * remove the parent connection from the connection mapping ++ * when it got closed ++ * ++ * keep the mapping active for a while to send a valid final status ++ */ ++CONNECTION_FUNC(mod_uploadprogress_request_done) { ++ plugin_data *p = p_d; ++ buffer *tracking_id; ++ connection_map_entry *cm = NULL; ++ ++ UNUSED(srv); ++ ++ if (buffer_is_empty(con->request.uri)) return HANDLER_GO_ON; ++ ++ /* ++ * only need to handle the upload request. ++ */ ++ if (con->request.http_method != HTTP_METHOD_POST) { ++ return HANDLER_GO_ON; ++ } ++ ++ if (NULL == (tracking_id = get_tracking_id(p, srv, con))) { ++ return HANDLER_GO_ON; ++ } ++ ++ if (p->conf.debug) { ++ log_error_write(srv, __FILE__, __LINE__, "sssd", "upload is done, moving tracking-id to backlog: tracking-id=", SAFE_BUF_STR(tracking_id), ", http_status=", con->http_status); ++ } ++ ++ /* ++ * set timeout on the upload's connection_map_entry. ++ */ ++ if (NULL == (cm = connection_map_get_connection_entry(p->con_map, tracking_id))) { ++ if (p->conf.debug) { ++ log_error_write(srv, __FILE__, __LINE__, "sss", "tracking ID", SAFE_BUF_STR(tracking_id), "not found, can't set timeout"); ++ } ++ return HANDLER_GO_ON; ++ } ++ ++ /* save request size to be able to report it even when cm->con == NULL */ ++ cm->size = con->request.content_length; ++ ++ cm->timeout = time(NULL) + p->conf.remove_timeout; ++ cm->con = NULL; /* con becomes invalid very soon */ ++ ++ return HANDLER_GO_ON; ++} ++ ++/** ++ * remove dead connections once in while ++ */ ++TRIGGER_FUNC(mod_uploadprogress_trigger) { ++ plugin_data *p = p_d; ++ ++ if ((srv->cur_ts % 10) != 0) return HANDLER_GO_ON; ++ ++ connection_map_clear_timeout_connections(p->con_map); ++ ++ return HANDLER_GO_ON; ++} ++ ++ ++/* this function is called at dlopen() time and inits the callbacks */ ++ ++int mod_uploadprogress_plugin_init(plugin *p) { ++ p->version = LIGHTTPD_VERSION_ID; ++ p->name = buffer_init_string("uploadprogress"); ++ ++ p->init = mod_uploadprogress_init; ++ p->handle_uri_clean = mod_uploadprogress_uri_handler; ++ p->handle_request_end = mod_uploadprogress_request_end; ++ p->handle_request_done = mod_uploadprogress_request_done; ++// p->connection_reset = mod_uploadprogress_request_done; ++ p->set_defaults = mod_uploadprogress_set_defaults; ++ p->cleanup = mod_uploadprogress_free; ++ p->handle_trigger = mod_uploadprogress_trigger; ++ ++ p->data = NULL; ++ ++ return 0; ++} diff --git a/www-servers/lighttpd/files/lighttpd.confd b/www-servers/lighttpd/files/lighttpd.confd new file mode 100644 index 00000000..f3afb07a --- /dev/null +++ b/www-servers/lighttpd/files/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="$(/usr/bin/awk '/^server.pid-file/{s=$3};{sub("\"","",s)};END{print s}' ${LIGHTTPD_CONF})" + diff --git a/www-servers/lighttpd/files/lighttpd.initd b/www-servers/lighttpd/files/lighttpd.initd new file mode 100644 index 00000000..dadbed56 --- /dev/null +++ b/www-servers/lighttpd/files/lighttpd.initd @@ -0,0 +1,73 @@ +#!/sbin/runscript +# Copyright 1999-2013 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.22 2013/02/06 19:36:51 hwoarang Exp $ + +extra_started_commands="reload graceful" + +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 + ewarn "server.pid-file variable in ${LIGHTTPD_CONF}" + ewarn "is not set. Falling back to lighttpd.pid" + LIGHTTPD_PID="/var/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 /var/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/www-servers/lighttpd/files/lighttpd.logrotate b/www-servers/lighttpd/files/lighttpd.logrotate new file mode 100644 index 00000000..76f0ef3f --- /dev/null +++ b/www-servers/lighttpd/files/lighttpd.logrotate @@ -0,0 +1,17 @@ +# $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 + if [ -f /var/run/lighttpd.pid ]; then \ + /etc/init.d/lighttpd reload > /dev/null 2>&1 || true ; \ + fi; + endscript +} diff --git a/www-servers/lighttpd/files/lighttpd.service b/www-servers/lighttpd/files/lighttpd.service new file mode 100644 index 00000000..369950c9 --- /dev/null +++ b/www-servers/lighttpd/files/lighttpd.service @@ -0,0 +1,10 @@ +[Unit] +Description=Lightning Fast Webserver With Light System Requirements +After=syslog.target network.target + +[Service] +PIDFile=/var/run/lighttpd.pid +ExecStart=/usr/sbin/lighttpd -D -f /etc/lighttpd/lighttpd.conf + +[Install] +WantedBy=multi-user.target diff --git a/www-servers/lighttpd/lighttpd-1.4.32-r2.ebuild b/www-servers/lighttpd/lighttpd-1.4.32-r2.ebuild new file mode 100644 index 00000000..f6edab6a --- /dev/null +++ b/www-servers/lighttpd/lighttpd-1.4.32-r2.ebuild @@ -0,0 +1,227 @@ +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/www-servers/lighttpd/lighttpd-1.4.32-r2.ebuild,v 1.10 2013/09/14 10:56:16 ago Exp $ + +EAPI="4" +inherit base autotools eutils depend.php readme.gentoo user systemd + +DESCRIPTION="Lightweight high-performance web server" +HOMEPAGE="http://www.lighttpd.net/" +SRC_URI="http://download.lighttpd.net/lighttpd/releases-1.4.x/${P}.tar.bz2" + +LICENSE="BSD GPL-2" +SLOT="0" +KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 ~sh sparc x86 ~sparc-fbsd ~x86-fbsd" +IUSE="bzip2 doc fam gdbm ipv6 kerberos ldap libev lua minimal mmap memcache mysql pcre php rrdtool selinux ssl systemd test uploadprogress webdav xattr zlib" + +REQUIRED_USE="kerberos? ( ssl )" + +RDEPEND=" + bzip2? ( app-arch/bzip2 ) + fam? ( virtual/fam ) + gdbm? ( sys-libs/gdbm ) + ldap? ( >=net-nds/openldap-2.1.26 ) + libev? ( >=dev-libs/libev-4.01 ) + lua? ( >=dev-lang/lua-5.1 ) + memcache? ( dev-libs/libmemcache ) + mysql? ( >=virtual/mysql-4.0 ) + pcre? ( >=dev-libs/libpcre-3.1 ) + php? ( dev-lang/php[cgi] ) + rrdtool? ( net-analyzer/rrdtool ) + selinux? ( sec-policy/selinux-apache ) + ssl? ( >=dev-libs/openssl-0.9.7[kerberos?] ) + webdav? ( + dev-libs/libxml2 + >=dev-db/sqlite-3 + sys-fs/e2fsprogs + ) + xattr? ( kernel_linux? ( sys-apps/attr ) ) + zlib? ( >=sys-libs/zlib-1.1 )" + +DEPEND="${RDEPEND} + virtual/pkgconfig + doc? ( dev-python/docutils ) + test? ( + virtual/perl-Test-Harness + dev-libs/fcgi + )" + +# update certain parts of lighttpd.conf based on conditionals +update_config() { + local config="${D}/etc/lighttpd/lighttpd.conf" + + # enable php/mod_fastcgi settings + use php && { sed -i -e 's|#.*\(include.*fastcgi.*$\)|\1|' ${config} || die; } + + # enable stat() caching + use fam && { sed -i -e 's|#\(.*stat-cache.*$\)|\1|' ${config} || die; } + + # automatically listen on IPv6 if built with USE=ipv6. Bug #234987 + use ipv6 && { sed -i -e 's|# server.use-ipv6|server.use-ipv6|' ${config} || die; } +} + +# remove non-essential stuff (for USE=minimal) +remove_non_essential() { + local libdir="${D}/usr/$(get_libdir)/${PN}" + + # text docs + use doc || rm -fr "${D}"/usr/share/doc/${PF}/txt + + # non-essential modules + rm -f \ + ${libdir}/mod_{compress,evhost,expire,proxy,scgi,secdownload,simple_vhost,status,setenv,trigger*,usertrack}.* + + # allow users to keep some based on USE flags + use pcre || rm -f ${libdir}/mod_{ssi,re{direct,write}}.* + use webdav || rm -f ${libdir}/mod_webdav.* + use mysql || rm -f ${libdir}/mod_mysql_vhost.* + use lua || rm -f ${libdir}/mod_{cml,magnet}.* + use rrdtool || rm -f ${libdir}/mod_rrdtool.* + use zlib || rm -f ${libdir}/mod_compress.* +} + +pkg_setup() { + if ! use pcre ; then + ewarn "It is highly recommended that you build ${PN}" + ewarn "with perl regular expressions support via USE=pcre." + ewarn "Otherwise you lose support for some core options such" + ewarn "as conditionals and modules such as mod_re{write,direct}" + ewarn "and mod_ssi." + fi + if use mmap; then + ewarn "You have enabled the mmap option. This option may allow" + ewarn "local users to trigger SIGBUG crashes. Use this option" + ewarn "with EXTRA care." + fi + enewgroup lighttpd + enewuser lighttpd -1 -1 /var/www/localhost/htdocs lighttpd + + DOC_CONTENTS="IPv6 migration guide:\n + http://redmine.lighttpd.net/projects/lighttpd/wiki/IPv6-Config" +} + +src_prepare() { + base_src_prepare + #dev-python/docutils installs rst2html.py not rst2html + sed -i -e 's|\(rst2html\)|\1.py|g' doc/outdated/Makefile.am || \ + die "sed doc/Makefile.am failed" + # Experimental patch for progress bar. Bug #380093 + if use uploadprogress; then + epatch "${FILESDIR}"/${PN}-1.4.29-mod_uploadprogress.patch + fi + eautoreconf +} + +src_configure() { + econf --libdir=/usr/$(get_libdir)/${PN} \ + --enable-lfs \ + $(use_enable ipv6) \ + $(use_enable mmap) \ + $(use_with bzip2) \ + $(use_with fam) \ + $(use_with gdbm) \ + $(use_with kerberos kerberos5) \ + $(use_with ldap) \ + $(use_with libev) \ + $(use_with lua) \ + $(use_with memcache) \ + $(use_with mysql) \ + $(use_with pcre) \ + $(use_with ssl openssl) \ + $(use_with webdav webdav-props) \ + $(use_with webdav webdav-locks) \ + $(use_with xattr attr) \ + $(use_with zlib) +} + +src_compile() { + emake + + if use doc ; then + einfo "Building HTML documentation" + cd doc || die + emake html + fi +} + +src_test() { + if [[ ${EUID} -eq 0 ]]; then + default_src_test + else + ewarn "test skipped, please re-run as root if you wish to test ${PN}" + fi +} + +src_install() { + emake DESTDIR="${D}" install + + # init script stuff + newinitd "${FILESDIR}"/lighttpd.initd lighttpd + newconfd "${FILESDIR}"/lighttpd.confd lighttpd + use fam && has_version app-admin/fam && \ + { sed -i 's/after famd/need famd/g' "${D}"/etc/init.d/lighttpd || die; } + + # configs + insinto /etc/lighttpd + doins "${FILESDIR}"/conf/lighttpd.conf + doins "${FILESDIR}"/conf/mime-types.conf + doins "${FILESDIR}"/conf/mod_cgi.conf + doins "${FILESDIR}"/conf/mod_fastcgi.conf + # Secure directory for fastcgi sockets + keepdir /var/run/lighttpd/ + fperms 0750 /var/run/lighttpd/ + fowners lighttpd:lighttpd /var/run/lighttpd/ + + # update lighttpd.conf directives based on conditionals + update_config + + # docs + dodoc AUTHORS README NEWS doc/scripts/*.sh + newdoc doc/config//lighttpd.conf lighttpd.conf.distrib + use ipv6 && readme.gentoo_create_doc + + use doc && dohtml -r doc/* + + docinto txt + dodoc doc/outdated/*.txt + + # logrotate + insinto /etc/logrotate.d + newins "${FILESDIR}"/lighttpd.logrotate lighttpd + + keepdir /var/l{ib,og}/lighttpd /var/www/localhost/htdocs + fowners lighttpd:lighttpd /var/l{ib,og}/lighttpd + fperms 0750 /var/l{ib,og}/lighttpd + + #spawn-fcgi may optionally be installed via www-servers/spawn-fcgi + rm -f "${D}"/usr/bin/spawn-fcgi "${D}"/usr/share/man/man1/spawn-fcgi.* + + use minimal && remove_non_essential + + use systemd && systemd_dounit "${FILESDIR}/${PN}.service" +} + +pkg_postinst () { + use ipv6 && readme.gentoo_print_elog + + if [[ -f ${ROOT}etc/conf.d/spawn-fcgi.conf ]] ; then + einfo "spawn-fcgi is now provided by www-servers/spawn-fcgi." + einfo "spawn-fcgi's init script configuration is now located" + einfo "at /etc/conf.d/spawn-fcgi." + fi + + if [[ -f ${ROOT}etc/lighttpd.conf ]] ; then + elog "Gentoo has a customized configuration," + elog "which is now located in /etc/lighttpd. Please migrate your" + elog "existing configuration." + fi + + if use uploadprogress; then + elog "WARNING! mod_uploadprogress is a backported module from the" + elog "1.5x-branch, which is not considered stable yet. Please go to" + elog "http://redmine.lighttpd.net/wiki/1/Docs:ModUploadProgress" + elog "for more information. This configuration also is NOT supported" + elog "by upstream, so please refrain from reporting bugs. You have" + elog "been warned!" + fi +} |