Apache ServerName*通配符不适用于vhost_dbd_模块

Apache ServerName*通配符不适用于vhost_dbd_模块,apache,vhosts,virtual-hosts,dbd,mod-vhost-alias,Apache,Vhosts,Virtual Hosts,Dbd,Mod Vhost Alias,我正在尝试使用vhost_dbd_模块将虚拟主机迁移到mysql数据库 在我在线找到的各种示例中,它们指示我在VirtualHost中使用ServerName*作为通配符 当我以这种方式配置VirtualHost时,服务器默认返回默认的DocumentRoot。它不查询mysql数据库 <VirtualHost *:80> # catch all other requests that don't get caught above ServerName

我正在尝试使用vhost_dbd_模块将虚拟主机迁移到mysql数据库

在我在线找到的各种示例中,它们指示我在VirtualHost中使用ServerName*作为通配符

当我以这种方式配置VirtualHost时,服务器默认返回默认的DocumentRoot。它不查询mysql数据库

<VirtualHost *:80>
        # catch all other requests that don't get caught above
        ServerName *
        # fallbackDocumentRoot in case mysql server is down
        DocumentRoot /var/html/404

        DBDriver mysql
        DBDParams "host=<hostname> user=<user> dbname=<dbname>"
        DBDocRoot "SELECT documentRoot FROM virtualhosts WHERE serverName = %s" HOSTNAME
</VirtualHost>
但是,当我将其更改为将ServerName指定为domain.tld时,它可以正常工作,查询数据库中的domain.tld,并返回domain.tld的正确documentroot

<VirtualHost *:80>
        # catch all other requests that don't get caught above
        ServerName domain.tld
        # fallbackDocumentRoot in case mysql server is down
        DocumentRoot /var/html/404

        DBDriver mysql
        DBDParams "host=<hostname> user=<user> dbname=<dbname>"
        DBDocRoot "SELECT documentRoot FROM virtualhosts WHERE serverName = %s" HOSTNAME
</VirtualHost>

你知道什么是配置错误吗?

在又乱了一番之后,似乎只有当ServerName*是系统中的第一个虚拟主机时,它才起作用

我先按顺序移动了它,下面还有一些其他的虚拟主机,它们带有更具体的ServerName example.tld,DB主机和静态配置的主机都工作正常