Project

General

Profile

Mod evhost » History » Revision 11

Revision 10 (Anonymous, 2008-09-04 14:19) → Revision 11/23 (Anonymous, 2008-09-04 15:48)

[[TracNav(DocsToc)]] 
 {{{ 
 #!rst 
 ======================== 
 Enhanced Virtual-Hosting 
 ======================== 

 ------------------ 
 Module: mod_evhost 
 ------------------ 

 .. meta:: 
   :keywords: lighttpd, virtual hosting 
  
 .. contents:: Table of Contents 

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

 mod_evhost builds the document-root based on a pattern which contains 
 wildcards. Those wildcards can represent parts of the submitted hostname 
 

 :: 
  
   %% => % sign 
   %0 => domain name + tld 
   %1 => tld 
   %2 => domain name without tld 
   %3 => subdomain 1 name 
   %4 => subdomain 2 name 

   evhost.path-pattern = "/home/www/servers/%3/pages/" 

 Options 
 ======= 

 evhost.path-pattern  
   pattern with wildcards to be replace to build a documentroot 


 Samples 
 ======= 


 User vhosts 
 ------------ 


 :: 

   $HTTP["host"] =~ "users\.example\.org" { 
       evhost.path-pattern = "/home/%4/public_html/" 
   } 

 http://johndoe.users.example.org/ => /home/johndoe/public_html/ 


 --- 

 :: 

   server.document-root          = "/home/user/sites/" 
   

 (/home/user/sites/index.html = fall back page) 

 evhost.path-pattern             = "/home/user/sites/%0/site/" 

 If 


 if example.org is requested, and if /home/user/sites/example.org/site/ is found, found that path becomes the docroot. docroot 

 If if example.net is requested but and is not found in ''/home/user/sites/ /home/user/sites/ then the docroot remains as /home/user/sites/ /home/user/sites/(index.html) 

 -- 


 More examples please? 

 Is there a variable for the entire FQDN? since %0-5 break the domain name down into its individual components, it's hard to setup generic hosting so that sub.domain.com subsub.sub.domain.com other.sub.domain.com can all be created without multiple entries. 

 This also breaks for .co.uk domain names where %0 = co.uk and %2 = co, which is clearly not what's considered the "domain name" of the url.    We need a variable containing the full domain name. 
 }}}