Project

General

Profile

Docs ModTriggerBeforeDownload » History » Revision 9

Revision 8 (Anonymous, 2008-09-04 09:34) → Revision 9/13 (stbuehler, 2009-02-17 10:09)

h1. Module mod_trigger_b4_dl - [[TracNav(DocsToc)]] 

 <pre> 

 #!rst 
 ======================= 
 Trigger before Download 
 ======================= 

 {{>toc}} ------------------------- 
 Module: mod_trigger_b4_dl 
 ------------------------- 

 h2. .. meta:: 
   :keywords: lighttpd, hot-linking, deep-linking 

 .. contents:: Table of Contents 

 Description 
 =========== 

 Anti Hotlinking: 
 

  * if user requests "download-url" ''download-url'' directly, the request is denied and he is redirected to "deny-url" 
 ''deny-url' 
  * if user visits "trigger-url" ''trigger-url'' before requesting "download-url", ''download-url'', access is granted 
 
  * if user visits "download-url" ''download-url'' again after "trigger-timeout" ''trigger-timeout'' has elapsed, the request is denied and he is redirected to "deny-url" ''deny-url'' 

 The trigger information is either stored locally in a gdbm file or remotely in memcached. 

 h2. Requirements 

 
 ------------ 

  * libpcre 
 
  * libgdbm or libmemcache (install the C client API,visit http://people.freebsd.org/~seanc/libmemcache/ and http://danga.com/memcached/apis.bml for detail.) 

 h2. Example config Options 
 ======= 

 <pre> 
 :: 

   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://192.168.1.5:1025/index.html" 
 
   trigger-before-download.trigger-timeout = 10 
 </pre> 

 If both @trigger-before-download.gdbm-filename@ trigger-before-download.gdbm-filename and @trigger-before-download.memcache-hosts@ 
 trigger-before-download.memcache-hosts is set gdbm will take precedence. 

 h2. Installation 
 ============ 

 memcached should be started with the option -M as we don't want to remove entry if the memory is full. 
 

 </pre>