Docs ModVhostDbi » History » Revision 2
« Previous |
Revision 2/10
(diff)
| Next »
ver, 2011-02-14 06:00
formatting, linking wiki pages, general cleanup of the page.
Docs:ModVhostDbi¶
Module: mod_vhost_dbi
- Table of contents
- Docs:ModVhostDbi
Description¶
mod_vhost_dbi is a modified version of mod_vhost_mysql which instead uses libDBI to read vhost to document root associations.
The syntax is almost identical as that used by mod_vhost_mysql with the following changes:
- Module is named mod_vhost_dbi, obviously.
- The username parameter is now optional as some database drivers do not require a username.
- Parameters are prefixed as dbi-vhost. instead of mysql-vhost.
- Added variables dbi-vhost.dbtype and dbi-vhost.encoding
Installation¶
This module is a 3rd party module and is not included in the official distribution. You can download the patch from here:
- For lighttpd 1.4.28: http://riverroadcable.com/~doneill/lighttpd-1.4.28-dbi.patch
Once applied, run autogen.sh and pass the option --with-dbi
to let the GNU tools find it, or --with-dbi=/path/to/dbi
to specify the location.
Options¶
dbi-vhost.db - Required
The name of the database for network database connections, or a path to a database file for local database implementations (Sqlite).
dbi-vhost.dbtype - Required
Set this to your database type. This is usually included in the DBD file name. Eg., libdbdmysql.so is "mysql", and libdbdpgsql.so is "pgsql".
dbi-vhost.encoding - Optional
For example, "UTF-8
". This parameter compatibility and available options depend on the driver. I use it to tell the MySQL DBD to use UTF-8.
dbi-vhost.user - Optional
The username to use for opening a database connection.
dbi-vhost.pass - Optional
A password used to authenticate to a database connection.
dbi-vhost.hostname - Optional
A hostname used in establishing a database connection.
dbi-vhost.sql - Optional
The actual query used to get the document root for a vhost. Use '?' in place of the hostname, for example:
dbi-vhost.sql = "SELECT docroot FROM vhosts WHERE host='?'"
Updated by ver almost 14 years ago · 2 revisions