Project

General

Profile

Mod access » History » Revision 16

Revision 15 (zkv, 2008-11-21 20:00) → Revision 16/28 (zkv, 2008-11-21 20:32)

h1. Module mod_access 

 {{>toc}} 

 h2. Description 

 The access module is used to deny access to files. 

 h2. Options 

 table{border:1px table{background-color:#efefef;border:1px solid #dddddd;}. 
 |_.Name|_.Description|_.Default value| 
 |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 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 deny access to all files ended with a tilde (~) or .inc because of:     

 # 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> 

     <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> 

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

 $PHYSICAL["path"] =~ "(~|\.inc)$" { 
         
     access.deny-all = "enable" 
     
 } 

 </pre> 

 h3. Directory deny access 

 <pre> 

     <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/" { 
         
     access.deny-all = "enable" 
     
 } 

 </pre> 

 h3. Directory deny access (1.4x versions) 

 <pre> 

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

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

 </pre>