Project

General

Profile

Mod vhostdb » History » Revision 2

Revision 1 (gstrauss, 2017-02-27 21:16) → Revision 2/9 (gstrauss, 2017-02-27 21:17)

h1. Virtual Host database 

 {{>toc}} 

 *Module: mod_vhostdb* 

 h2. Description 

 (since lighttpd 1.4.46) 

 virtual host database to provide vhost docroot 

 *Note:* STATUS: experimental    (testing and feedback appreciated) 

 


 h2. Options 

 table{margin-left: 2em}. 
 |_.option |_. description | 
 | vhostdb.backend | "dbi", "ldap", "mysql", or "pgsql" | 
 | vhostdb.dbi | mod_vhostdb_dbi config | 
 | vhostdb.ldap | mod_vhostdb_ldap config | 
 | vhostdb.mysql | mod_vhostdb_mysql config | 
 | vhostdb.pgsql | mod_vhostdb_pgsql config | 


 h2. Examples 

 <pre> 
 server.modules += ( "mod_vhostdb" ) 

 # DBI 
 #server.modules += ( "mod_vhostdb_dbi" ) 
 #vhostdb.backend = "dbi" 
 #vhostdb.dbi += ( 
 #        # required 
 #        "sql"             => "SELECT docroot FROM vhosts WHERE host='?'" 
 #        "dbtype"          => "pgsql",         # DBI database driver string name 
 #        "dbname"          => "lighttpd", 
 #        # optional 
 #        "username"        => "lighttpd",      # (some dbtype do not require username, e.g. sqlite) 
 #        "password"        => "",              # (default: empty) 
 #        "socket"          => "/path/sock",    # (default: dbtype default) 
 #        "host"            => "localhost",     # (if set, overrides "socket") 
 #        "port"            => 5432             # (default: dbtype default) 
 #        "encoding"        => "UTF-8",         # (default: dbtype default) 
 #) 

 # LDAP 
 #server.modules += ( "mod_vhostdb_ldap" ) 
 #vhostdb.backend = "ldap" 
 #vhostdb.ldap += ( 
 #        # required 
 #        "host"            => "localhost", 
 #        "filter"          => "(vhost=?)" 
 #        "base-dn"         => "dc=my-domain,dc=com", # base distinguished name 
 #        # optional 
 #        "attr"            => "documentRoot",# (LDAP attribute with docroot; default "documentRoot") 
 #        "bind-dn"         => "uid=admin,dc=my-domain,dc=com", # distinguished name to which to bind 
 #        "bind-pw"         => "mysecret",      # password associated with bind-dn 
 #        "ca-file"         => "",              # certificate authority file 
 #        "starttls"        => "enable",        # require TLS 
 #) 

 # MySQL/MariaDB 
 #server.modules += ( "mod_vhostdb_mysql" ) 
 #vhostdb.backend = "mysql" 
 #vhostdb.mysql += ( 
 #        # required 
 #        "sql"             => "SELECT docroot FROM vhosts WHERE host='?'" 
 #        "dbname"          => "lighttpd", 
 #        "user"            => "lighttpd", 
 #        # optional 
 #        "password"        => "",              # (default: empty) 
 #        "socket"          => "/path/sock",    # (default: mysql default) 
 #        "host"            => "localhost",     # (if set, overrides "socket") 
 #        "port"            => 3306             # (default: 3306) 
 #) 

 # Postgres 
 #server.modules += ( "mod_vhostdb_pgsql" ) 
 #vhostdb.backend = "pgsql" 
 #vhostdb.pgsql += ( 
 #        # required 
 #        "sql"             => "SELECT docroot FROM vhosts WHERE host='?'" 
 #        "dbname"          => "lighttpd", 
 #        "user"            => "lighttpd",      # (required unless dbname is a pgsql conninfo URI) 
 #        # optional 
 #        "password"        => "",              # (default: empty) 
 #        "host"            => "localhost", 
 #        "port"            => 5432             # (default: 5432) 
 #) 
 </pre> 


 h2. Related modules 

 [[lighttpd:Docs_ModEVhost|mod_evhost]] 
 [[lighttpd:Docs_ModSimpleVhost|mod_simple_vhost]] 

 [[lighttpd:Docs_ModVhostDbi|mod_dbi_vhost]] (ancient; user-contributed; YMMV)