I have a global entry
Alias /.well-known/acme-challenge /var/www/letsencrypt/.well-known/acme-challenge/
in my apache configuration, outside any virtual host. This way, the above Alias is effective for all virtual hosts. Unfortunately, there are still virtual hosts where this does not work as intended, e.g. due to redirects, authetication requirements etc.
Is there a way to tell apache to consider this alias before even reading the configuration of the particular virtual host?
You can try to add this before all your virtual host :
I came across your question with the same letsencrypt acme apache alias problem. After reading through the apache documentation, I still don't undestand why the global alias doesn't work as expected (according to the documentation it should).
Anyway, here is a workaround that uses RedirectMatch (which according to the documentation is evaluated before alias). It requires one additional host and one global configuration file:
Create (and enable) a global configuration that redirects all acme-requests to that host, excluding the host itself from redirection:
This works for all my VirtualHosts which had problems with the old alias approach.
According to Apache 2.4 documentation you have these options:
May be you can give it a try use one of the containers mentioned above and add the alias that you need to be globally for all requests. See details here: https://httpd.apache.org/docs/2.4/sections.html#mergin.
I handled the issue with a global alias
Create a global config
Alias /.well-known/acme-challenge/ /my-acme-challenge-directory