File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / lighttpd / doc / outdated / mysqlvhost.txt
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Mon Oct 14 10:32:48 2013 UTC (11 years, 5 months ago) by misho
Branches: lighttpd, MAIN
CVS tags: v1_4_41p8, v1_4_35p0, v1_4_35, v1_4_33, HEAD
1.4.33

    1: ====================
    2: MySQL-based vhosting
    3: ====================
    4: 
    5: -----------------------
    6: Module: mod_mysql_vhost
    7: -----------------------
    8: 
    9: :Author: ada@riksnet.se
   10: :Date: $Date: 2013/10/14 10:32:48 $
   11: :Revision: $Revision: 1.1.1.1 $
   12: 
   13: :abstract:
   14:   This module provides virtual hosts (vhosts) based on a MySQL table
   15: 
   16: .. meta::
   17:   :keywords: lighttpd, mysql, vhost
   18: 
   19: .. contents:: Table of Contents
   20: 
   21: Description
   22: ===========
   23: 
   24: With MySQL-based vhosting you can store the path to a given host's
   25: document root in a MySQL database.
   26: 
   27: .. note:: Keep in mind that only one vhost module should be active at a time.
   28:           Don't mix mod_simple_vhost with mod_mysql_vhost.
   29: 
   30: Options
   31: =======
   32: 
   33: Example: ::
   34: 
   35:   mysql-vhost.db             = "lighttpd"
   36:   mysql-vhost.user           = "lighttpd"
   37:   mysql-vhost.pass           = "secret"
   38:   mysql-vhost.sock           = "/var/mysql.lighttpd.sock"
   39:   mysql-vhost.sql            = "SELECT docroot FROM domains WHERE domain='?'"
   40: 
   41: 
   42: MySQL setup: ::
   43: 
   44:   GRANT SELECT ON lighttpd.* TO lighttpd@localhost IDENTIFIED BY 'secret';
   45: 
   46:   CREATE DATABASE lighttpd;
   47: 
   48:   USE lighttpd;
   49: 
   50:   CREATE TABLE domains (
   51:     domain varchar(64) not null primary key,
   52:     docroot varchar(128) not null
   53:   );
   54: 
   55:   INSERT INTO domains VALUES ('host.dom.ain','/http/host.dom.ain/');
   56: 
   57: 
   58: 

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>