I'm having issues on making /.well-known/acme-challenge/ public accessible on Apache.
I created the file test on /.well-known/acme-challenge/ folder, when I visit http://staging.hiddendomain.com/.well-known/acme-challenge/test I always get 404.
sudo apachectl -S returns:
VirtualHost configuration:
*:80 is a NameVirtualHost
default server staging.hiddendomain.com (/etc/httpd/conf.d/01-staging-hidden-domain-p80.conf:1)
port 80 namevhost staging.hiddendomain.com (/etc/httpd/conf.d/01-staging-hidden-domain-p80.conf:1)
This is the apache configuration (01-staging-hidden-domain-p80.conf) I currently have:
<VirtualHost *:80>
ServerName staging.hiddendomain.com
DocumentRoot /var/www/html/hidden-domain/web/
LogLevel trace8
<Directory "/var/www/html/hidden-domain/web/">
Options FollowSymLinks
AllowOverride All
Order Allow,Deny
Allow from All
#Require all granted
Header set X-Robots-Tag "noindex, nofollow"
# Apache 2.x
<IfModule !mod_authz_core.c>
Order allow,deny
Allow from all
</IfModule>
# Apache 2.4
<IfModule mod_authz_core.c>
Require all granted
</IfModule>
</Directory>
ErrorLog logs/staging/error.log
CustomLog logs/staging/access.log combined
</VirtualHost>
I guess you could try to put other test files in lower levels to see what that does. E.g., try /var/www/html/hidden-domain/web/test and /var/www/html/hidden-domain/web/.well-known/test or even /var/www/html/hidden-domain/web/.test/test and see what those do.
Also there is an error in the log so that's means the request is hitting the server & vhost entry. The error is auth phase 'translate' gave status 404, google that a lot and can't find how to avoid it.
Modules can determine the file name, or alter the given URI in this step. For example, mod_vhost_alias will translate the URI's path into the configured virtual host, mod_alias will translate the path to an alias path, and if the request falls back on the core, the DocumentRoot is prepended to the request resource.
So the actual result could be due to any of the active modules taking part of URI translation, such as the modules mentioned.