This is strange. AEM displather has 2 dirs under conf.d:
What we have found is AEM ignores all xxx.vhosts files in enabled_vhosts except for one called default.vhost.
in avaliable_vhosts we have 3 xxx.vhost files
in enabled_vhosts we create a symbolic link to each.
only default.vhost is actually used.
Our workaround is to put all our vhosts in into default.vhost, but its not ideal.
Anyone else have this issue?
All our vhosts look like this:
Solved! Go to Solution.
Well, I found the problem, but not a real solution.
the problem is that one of the vhosts had "ServerAlias *". Removing this, allows all our vhost files to be correctly read and used. However, now we are seing some strange inexplicable problems with our site, and one of the devs says the severalias * is required by adobe to work. This means, to ensure this directive is the very last one, we have to put all our many virtual hosts entries into one giant vhost file, and put the * allies on the last of them. This means we cant use any of the nice available/enabled functionality - we have to edit the file to add/remove virtual hosts.
That explanation is technically correct, but I just want to give some more context.
In this case the order matters. If a request comes in and the correct vhost is about to determined, a "ServerAlias *" is a catch-all definition, and it will be used. So you should make sure that this definition is the last one to be loaded. More specific vhosts should be loaded before.
So you can try to rename the "default.vhost" to "999_default.vhost" (alphabetical order matters here) and try again.
Would love to hear if this helps.
@Jörg_Hoh - Changing the default.vhost to 999_default.vhost also didn't help - The default.vhost was loaded first. Changing it to zzz_default.vhost worked as that ensured the default.vhost is the last to be loaded.
It's working as expected, you are facing this issue because you are using "" (Quotes) with the ServerAlias. It should be without quotes and you can name the vhost files with the following order,
Hello This indeed work but it would be incredibly useful if this is documented somewhere instead of letting developers wonder around in loop not knowing why their hosts are not matching. Especeially since the config works with the local sdk.