Archive for the 'lighttpd' Category
把lighttpd的虚拟主机配置放到数据库
MySQL现在成了一个垃圾桶,什么都能够往里面装:
pam_mysql 做PAM认证
mysql做ftp/mail后端认证数据库,
mod_mysql_vhost为apache乃至lighttpd做vhost
只有想不到,没有做不到,下面就是ligttpd的vhost模块支持
MySQL-based vhosting Module: mod_mysql_vhost
Table of Contents
Description Options Description With MySQL-based vhosting you can store the path to a given host’s document root in a MySQL database.
Note
Keep in mind that only one vhost module should be active at a time. Don’t mix mod_simple_vhost with mod_mysql_vhost.
Options 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 lighttpd@localhost 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/’);
除了apache还有什么?

