我有一个像这样使用macros的虚拟主机configuration:
<Macro vhost_begin $host> <VirtualHost *:80> Use vhost_root $host </Macro> <Macro vhost_end> </VirtualHost> </Macro> <Macro vhost_root $host> ServerName $host ServerAlias www.$host DocumentRoot /srv/http/$host/docroot # ... more other common config ... </Macro>
然后,我使用这样的站点可用的configuration中的macros:
vhost_begin example.com # ... other virtualhost-specific config here if needed vhost_end
它会让事情变得很糟糕,因为如果一个简单的虚拟主机不需要任何特殊的configuration,那么它只是两行,但是如果需要的话,它不会限制可能性(就像我将整个虚拟主机定义从开始结束于一个macros)。
它工作(看起来像),但启动Apache后,它会在daemon.log中引发以下和类似的警告。
AH02795: bad cumulated nesting (+1) in macro "vhost_begin"
AH02793: bad (negative) nesting on line 2 of macro "vhost_end"
AH02795: bad cumulated nesting (-1) in macro "vhost_end"
这些是什么意思?
我怀疑这是因为不成对的<Virtualhost>标签,但似乎没有logging,至lessGoogle没有帮助。
这是一个不好的做法或对这个问题不好的解决办法吗? 如果是这样的话,将会有什么build议呢?
提前致谢!