29

配置Lighttpd下的虚拟主机

分类:FreeBSD, Ubuntu, linux | 1查看380次 | 给我留言

在 server.modules 部分将以下几个模块前的注释去掉:

mod_simple_vhost

这里将配置以下几个虚拟主机:

www.liumin.name
www.zzxxw.net

对应的目录分别为:

# For virtual host: www.liumin.name

/var/www/lighttpd/vhosts/liumin.name/
/var/www/lighttpd/vhosts/liumin.name/htdocs/
/var/www/lighttpd/vhosts/liumin.name/logs/



# For virtual host: www.zzxxw.net

/var/www/lighttpd/vhosts/zzxxw.net/
/var/www/lighttpd/vhosts/zzxxw.net/htdocs/
/var/www/lighttpd/vhosts/zzxxw.net/logs/

设置目录和权限:

# mkdir -p /var/www/lighttpd/vhosts/liumin.name/{htdocs,logs}

# mkdir -p /var/www/lighttpd/vhosts/zzxxw.net/{htdocs,logs}

# chown -R www:www /var/www/lighttpd/

配置:

$HTTP["host"] == “www.liumin.name” {
server.document-root = “/var/www/lighttpd/vhosts/liumin.name/htdocs/”
server.errorlog = “/var/www/lighttpd/vhosts/liumin.name/logs/error”
accesslog.filename = “/var/www/lighttpd/vhosts/liumin.name/logs/access”
server.error-handler-404 = “/index.php”
}

$HTTP["host"] == “www.zzxxw.net” {
server.document-root = “/var/www/lighttpd/vhosts/zzxxw.net/htdocs/”
server.errorlog = “/var/www/lighttpd/vhosts/zzxxw.net/logs/error”
accesslog.filename = “/var/www/lighttpd/vhosts/zzxxw.net/logs/access”
server.error-handler-404 = “/index.php”
}

在FreeBSD系统中安装Lighttpd 配置Lighttpd支持php5
  • 标签 : 
  • 原文链接 : http://www.liumin.name/20080129/lighttpd-simple-vhost/
  • 转载原创文章请注明 : 刘敏的Blog
  • 收藏到 : Google书签 新浪ViVi 365Key网摘 天极网摘 我摘 POCO网摘 博采网摘 YouNote网摘 和讯网摘 博拉网 igooi网摘 I2Key网摘 天下图摘 百特门网摘 Del.icio.us Yahoo书签 奇贴 QQ娱乐摘 添加到Digg! 添加到Facebook!
  •  “配置Lighttpd下的虚拟主机”才1条评论

      反向链接/文章引用

    发表留言