Difference between revisions of "Lighttpd"
From Alessandro's Wiki
Porcelinux (talk | contribs) (Created page with " = modules = == x264-streaming == == aio-sendfile == ./configure --with-openssl --with-linux-aio * in lighttpd.conf server.network-backend = "linux-aio-sendfile"") |
Porcelinux (talk | contribs) |
||
| (3 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
= core = | |||
== Keep-Alive == | |||
Disabling keep-alive might help your server if you suffer from a large number of open file descriptors. | |||
* defaults: | |||
server.max-keep-alive-requests = 128 | |||
server.max-keep-alive-idle = 30 | |||
server.max-read-idle = 60 | |||
server.max-write-idle = 360 | |||
* less... | |||
server.max-keep-alive-requests = 8 | |||
server.max-keep-alive-idle = 8 | |||
* Disabling keep-alive | |||
server.max-keep-alive-requests = 0 | |||
| Line 12: | Line 33: | ||
* in lighttpd.conf | * in lighttpd.conf | ||
server.network-backend = "linux-aio-sendfile" | server.network-backend = "linux-aio-sendfile" | ||
== sec download == | |||
secdownload.secret = <string> | |||
secdownload.document-root = <string> | |||
secdownload.uri-prefix = <string> (default: /) | |||
secdownload.timeout = <short> (default: 60 seconds) | |||
secdownload.secret = "password" | |||
secdownload.document-root = "/export/mediaroot/auth/" | |||
secdownload.uri-prefix = "/dl/" | |||
secdownload.timeout = 120 | |||
* php then.. | |||
<uri-prefix>/<token>/<timestamp-in-hex>/<rel-path> | |||
PHP Example | |||
<syntaxhighlight lang="php" > | |||
<?php | |||
$secret = "verysecret"; | |||
$uri_prefix = "/dl/"; | |||
# filename | |||
# please note file name starts with "/" | |||
$f = "/secret-file.txt"; | |||
# current timestamp | |||
$t = time(); | |||
$t_hex = sprintf("%08x", $t); | |||
$m = md5($secret.$f.$t_hex); | |||
# generate link | |||
printf('<a href="%s%s/%s%s">%s</a>', | |||
$uri_prefix, $m, $t_hex, $f, $f); | |||
?> | |||
</syntaxhighlight> | |||
Latest revision as of 11:01, 29 July 2011
core
Keep-Alive
Disabling keep-alive might help your server if you suffer from a large number of open file descriptors.
- defaults:
server.max-keep-alive-requests = 128 server.max-keep-alive-idle = 30 server.max-read-idle = 60 server.max-write-idle = 360
- less...
server.max-keep-alive-requests = 8 server.max-keep-alive-idle = 8
- Disabling keep-alive
server.max-keep-alive-requests = 0
modules
x264-streaming
aio-sendfile
./configure --with-openssl --with-linux-aio
- in lighttpd.conf
server.network-backend = "linux-aio-sendfile"
sec download
secdownload.secret = <string> secdownload.document-root = <string> secdownload.uri-prefix = <string> (default: /) secdownload.timeout = <short> (default: 60 seconds)
secdownload.secret = "password" secdownload.document-root = "/export/mediaroot/auth/" secdownload.uri-prefix = "/dl/" secdownload.timeout = 120
- php then..
<uri-prefix>/<token>/<timestamp-in-hex>/<rel-path>
PHP Example
<?php
$secret = "verysecret";
$uri_prefix = "/dl/";
# filename
# please note file name starts with "/"
$f = "/secret-file.txt";
# current timestamp
$t = time();
$t_hex = sprintf("%08x", $t);
$m = md5($secret.$f.$t_hex);
# generate link
printf('<a href="%s%s/%s%s">%s</a>',
$uri_prefix, $m, $t_hex, $f, $f);
?>