Book Image

Lighttpd

By : Andre Bogus
Book Image

Lighttpd

By: Andre Bogus

Overview of this book

Table of Contents (20 chapters)
Lighttpd
Credits
About the Author
About the Reviewer
Preface
HTTP Status Codes

Putting it All Together


As we have seen on the last pages, Lighttpd has a lot to offer for setting up a download or streaming server. But we might be puzzled about how they relate to each other, and how we can use them together for optimal benefit. Therefore, here is a huge example configuration that has it all:

# use all modules we need
server.modules = (...,
"mod_rewrite", "mod_trigger_b4_dl", "mod_flv_streaming",
"mod_evasive", "mod_extforward", "mod_secdownload", "mod_alias",
"mod_accesslog", ...)
server.document-root = "/web/public"
# use the rewrite trick
$HTTP["cookie"] =~ "download/([0-9a-f]){32}/([0-9a-f]){8}" {
url.rewrite = ("/download/(.*)$" => "/download/%1/%2/$1")
} else {
# rewrite to avert mod_secdownload
url.rewrite = ("^/download/" => "/freeload/")
}
# configure mod_secdownload
secdownload.secret = "foo bar qux!!!1one!eleven"
secdownload.document-root = server.document-root
secdownload.uri-prefix = "/download/"
secdownload.timeout = 120
# configure mod_dirlisting...