Project

General

Profile

Actions

Docs ModVhostDbi » History » Revision 4

« Previous | Revision 4/10 (diff) | Next »
ver, 2011-02-14 08:29


Docs:ModDbiVhost

Module: mod_dbi_vhost

Description

mod_dbi_vhost is a modified version of mod_mysql_vhost which instead uses libDBI to read vhost to document root associations.

Installation

This module is a 3rd party module and is not included in the official distribution. You can download the patch from here:

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

vhost.dbi => ( "dbname" => "..." ) - Required

The name of the database for network database connections, or a database filename for local database implementations (Sqlite).

vhost.dbi => ( "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".

Some options include: mysql, pgsql, sqlite3, freetds, sqlite

vhost.dbi => ( "sql" => "..." ) - Required

The actual query used to get the document root for a vhost. Use '?' in place of the hostname, for example:

vhost.dbi += ( "sql" => "SELECT docroot FROM vhosts WHERE host='?'" )

Common Options

vhost.dbi += ( "user" => "..." ) - Optional

The username to use for opening a typical network-based database connection.

vhost.dbi += ( "pass" => "..." ) - Optional

A password used to authenticate to a database connection.

vhost.dbi += ( "hostname" => "..." ) - Optional

A hostname used in establishing a database connection.

vhost.dbi += ( "port" => i ) - Optional

A port number used to authenticate to a database connection. If not specified, the default for the specified database type will be used.

MySQL-Specific Options

vhost.dbi += ( "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.

Sqlite3-Specific Options

vhost.dbi += ( "sqlite3_dbdir" => "..." )

Updated by ver about 13 years ago · 4 revisions