Lighttpd MySQL virtual hosting

来自开放百科 - 灰狐
跳转到: 导航, 搜索

Module: mod_mysql_vhost

This module provides virtual hosts (vhosts) based on a MySQL table

Example: ::

 mysql-vhost.db             = "lighttpd"
 mysql-vhost.user           = "lighttpd"
 mysql-vhost.pass           = "secret"
 mysql-vhost.sock           = "/var/mysql.lighttpd.sock"
 mysql-vhost.sql            = "SELECT docroot FROM domains WHERE domain='?'"


MySQL setup: ::

 GRANT SELECT ON lighttpd.* TO [email protected] IDENTIFIED BY 'secret';
 CREATE DATABASE lighttpd;
 USE lighttpd;
 CREATE TABLE domains (
   domain varchar(64) not null primary key,
   docroot varchar(128) not null
 );
 INSERT INTO domains VALUES ('host.dom.ain','/http/host.dom.ain/');
分享您的观点
个人工具
名字空间

变换
操作
导航
工具箱