Matomo config fails if the Matomo name is a ServerAlias
If the users_apache_server_name
matches the Matomo name
then the site ID is correctly found, if the Matomo name is in the users_apache_server_aliases
array then it fails.
It would be better to use the Matomo API.