使用正则表达式将多个 .txt 文件包含到 httpd.conf 中?

Including multiple .txt files into httpd.conf using regex?

我希望能够将多个虚拟主机文件包含到 httpd.conf 中。我知道可以包括一个使用类似的东西:

include virtualhost-1.txt

但是,我希望能够导入特定目录中的所有虚拟主机文件,而无需对包含语句进行硬编码。有合适的 command/syntax 吗?我知道目录并且有合适的正则表达式:

^.+-[0-9]+\.txt

Include directive 的语法如下:

Include file-path|directory-path|wildcard

你可以这样做,例如:

 Include /usr/local/apache2/conf/vhosts/dom1-*.conf

包括目录 /usr/local/apache2/conf/vhosts/ 中以 dom1- 开头的所有配置。请注意,您可以使用通配符,但不能使用完整的正则表达式。