Lighttpd 虚拟主机和多域名的配置
Lighttpd也是一款轻巧不错的web服务器,和apachehttpserver一样,我最开始用lighttpd是在07年的时候,刚好lighttpd支持flv的流媒体播放和防盗链功能,所以就要用了起来。今天这里着重讲下如何配置多个虚拟主机和域名的设置,以Lighttpd的V1.7版本为例:
1、配置多个虚拟主机
打开Lighttpd安装目录下的etc/lighttpd.conf文件,在最后添加如下段:
$HTTP["host"] == "www.linuxany.com" {
server.document-root = "/webapps/linuxany/website"
server.errorlog = "/usr/local/lighttpd/logs/linuxany.com-error.log"
accesslog.filename = "/usr/local/lighttpd/logs/linuxany.com-access.log"}
server.document-root = "/webapps/linuxany/website"
server.errorlog = "/usr/local/lighttpd/logs/linuxany.com-error.log"
accesslog.filename = "/usr/local/lighttpd/logs/linuxany.com-access.log"}
如果需要多个虚拟主机,则将上面的段复制设置多个即可。