我在Debian上运行lighttpd。是否有一种方法可以将虚拟主机的名称放在/etc/lighttpd/ttttpd.conf文件之外?我想尝试一种更干净的方法,因为我的文件有点长。
发布于 2010-08-14 22:29:34
您可以在多个文件上拆分lighttpd vhost,如apache中的那样。
例如,要在两个单独的文件中添加两个vhost配置,首先需要在默认情况下包含这个文件/etc/lighttpd/ttttpd.conf:
1)在文件底部添加:
include "domain1.com.conf"
include "domain2.net.conf"
2)Open /etc/lighttpd/domain1.com.conf文件:
vi /etc/lighttpd/domain1.com.conf
添加以下配置指令:
$HTTP["host"] =~ "domain1\.com" { server.document-root = "/dir/to/www" accesslog.filename = "/dir/to/logs/access.log" }
保存并关闭文件。
对其他domain2.net.conf重复相同的操作,等等.
https://serverfault.com/questions/170595
复制相似问题