Project

General

Profile

Mod access » History » Revision 15

Revision 14 (moo, 2007-07-07 15:30) → Revision 15/28 (zkv, 2008-11-21 20:00)

h1. Module [[TracNav(DocsToc)]] 

 <pre> 

 #!rst 
 ====== 
 Access 
 ====== 

 ------------------ 
 Module: mod_access 
 ------------------ 

 {{>toc}} .. meta:: 
   :keywords: lighttpd, trailing path access control 
  
 .. contents:: Table of Contents 

 h2. Description 
 =========== 

 The access module is used to deny access to files. files with given trailing path names. 

 h2. Options 
 ======= 

 table{background-color:#efefef;border:1px solid #dddddd;}. 
 |_.Name|_.Description|_.Default value| 
 |url.access-deny|Denies url.access-deny 
   Denies access to all files with any of given trailing path names.|empty| 
 |access.deny-all|Denies access to all files. |empty| 

 Note: *access.deny-all* should be used with a conditional to limit it (only from lighty 1.5x) 

 h2. Usage examples 

 We might want to names. 

   Default: empty 

   Example: :: 
    
     url.access-deny = ( "~", ".inc") 

   will deny access to all files ended with a tilde (~) or .inc because of:     

 # 
   such as example~ or example.inc.    Text editors often use a trailing tilde for 
   backup files. 
 #    And the .inc extension is often used 
   for include files with code. 

 h3. url.access-deny 

 <pre style='background-color:#dfefef; border:1px solid #dddddd; margin:0; margin-top:10px; margin-bottom:10px; padding:10px; padding-left:30px;'> 

 url.access-deny = ( "~", ".inc") 

 </pre> 

 h3. access.deny-all usage 

 <pre style='background-color:#dfefef; border:1px solid #dddddd; margin:0; margin-top:10px; margin-bottom:10px; padding:10px; padding-left:30px;'>     

 
   Denies access to all files. It should be used with a conditional to limit it (only from lighty 1.5x): :: 

     $PHYSICAL["path"] =~ "(~|\.inc)$" !~ "^/srv/example.org/" { 
     
       access.deny-all = "enable" 
 
     } 

 </pre> 

 h3. Directory deny access 

 <pre style='background-color:#dfefef; border:1px solid #dddddd; margin:0; margin-top:10px; margin-bottom:10px; padding:10px; padding-left:30px;'> 

 
    
     $PHYSICAL["path"] !~ "^/srv/example.org/" =~ "(~|\.inc)$" { 
     
       access.deny-all = "enable" 
 
     } 

 </pre> 

 h3. Directory 

   directory deny access (1.4x versions) 

 <pre style='background-color:#dfefef; border:1px solid #dddddd; margin:0; margin-top:10px; margin-bottom:10px; padding:10px; padding-left:30px;'> 

 (1.4x): :: 

     $HTTP["url"] =~ "^/libraries" { 
     
       url.access-deny = ("") 
 
     } 

 </pre>