多个文档根
我有一个特殊的要求。我将 evhost 与 lighttpd 一起使用,除此之外一切正常:
$HTTP["host"] =~ "^[^.]+\.[^.]+$" {
evhost.path-pattern = vhosts_dir + "/customers/%2.%1/public/"
evhost.path-pattern = vhosts_dir + "/customershops/%2.%1/public/"
evhost.path-pattern = vhosts_dir + "/company/%2.%1/public/"
}
所以我想使我的模式上方的目录成为“动态”。或者实际上只是查看这三个目录,然后使用正确的虚拟主机目录。
最好的问候
反叛先生
I´ve got a special request. I use evhost with lighttpd and everything works fine except this:
$HTTP["host"] =~ "^[^.]+\.[^.]+$" {
evhost.path-pattern = vhosts_dir + "/customers/%2.%1/public/"
evhost.path-pattern = vhosts_dir + "/customershops/%2.%1/public/"
evhost.path-pattern = vhosts_dir + "/company/%2.%1/public/"
}
So I would like to make the directory above my pattern to be "dynamic". Or actually just look inside the three directories and then use the right vhost directory.
Best regards
Mr Rebel
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
mod_evhost 必须能够从提交的主机名的各个部分中找出一个文档根。它无法猜测三个选项,也无法尝试找出存在哪一个(特别是如果无意中碰巧有多个选项)。
您要么必须在主机名中为 mod_evhost 提供足够的信息才能明确地选择路径,要么必须在文件系统中进行至少一级重定向。
选项 1:
This loses all the customer/store/company information you want to capture, but it actually makes it possible for mod_evhost to work.
选项 2:您可以根据需要拆分目录,并创建一个充满这些目录链接的目录。 FS 具有可见的结构,mod_evhost 只需猜测重定向到您的结构的链接的名称。
Then your evhost pattern is
Note that directory_containing_links and directory_containing_sites can be the same directory.
mod_evhost has to be able to figure out the one document root from the parts of the submitted hostname. It can't guess among three options, nor try to figure out which one exists (especially if more than one inadvertently happens to do so).
You will either have to give mod_evhost enough information in the host names to unambiguously pick out a path, or you will have to engage in at least one level of redirection in your filesystem.
Option 1:
This loses all the customer/store/company information you want to capture, but it actually makes it possible for mod_evhost to work.
Option 2: You have the directories split out as you want, and a directory full of links to those directories. The FS has the visible structure and mod_evhost only has to guess the name of the link that redirects into your structure.
Then your evhost pattern is
Note that directory_containing_links and directory_containing_sites can be the same directory.