Hi everyone.
This is now 2 days I’m having issue setting up new certificate using letsencrypt and certbot on my servers.
The issue : Whatever I try, I always got the 404 issue while trying the acme-challenge
The details.
I try to validate my domain using the comman "sudo certbot -v --apache -d “subdomain.domain.lu”
I’m using Apache VirtualHost with Separate rule for :80 and :443 (:443 using proxypass for a tomcat application)
My temporary “http website” is on /opt/letsencrypt folder and I can reach http://subdomain.domain.lu/index.html without issues.
Here is what my /etc/apache2/sites-available/002-subdomain.conf looks like
<VirtualHost *:80>
ServerName subdomain.domain2.local
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
ProxyPreserveHost On
ProxyPass /subdomain/ http://subdomain.domain2.local:8080/subdomain/
ProxyPassReverse /subdomain/ /subdomain/
Redirect "/" "/subdomain/"
</VirtualHost>
<VirtualHost *:80>
ServerName subdomain.domain.lu
ServerAdmin webmaster@localhost
LogLevel Info
ErrorLog ${APACHE_LOG_DIR}/errorCERTBOT.log
CustomLog ${APACHE_LOG_DIR}/accessCERTBOT.log combined
DocumentRoot /opt/letsencrypt
</VirtualHost>
<VirtualHost *:443>
ServerName subdomain.domain.lu
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
ProxyPreserveHost On
ProxyPass /subdomain/ http://subdomain.domain2.local:8080/subdomain/
ProxyPassReverse /subdomain/ /subdomain/
Redirect "/" "/subdomain/"
</VirtualHost>
I added those lines in my /etc/apache2/apache2.conf file :
<Directory /opt/letsencrypt>
#Options Indexes FollowSymLinks
#AllowOverride None
Require all granted
</Directory>
<Directory /var/lib/letsencrypt/http_challenges>
Options Indexes FollowSymLinks
#AllowOverride None
Require all granted
</Directory>
I looked deeper while it is validation, I can see a file (with random key) is created under /var/lib/letsencrypt/http_challenges and a rewrite rule is added in my apache virtualhost config file (and removed automatically after)
I aso tried to put a file under /opt/letsencrypt/.well-known, => I can reach it on http page.
If I put a file on /opt/letsencrypt/.well-known/acme-challenge folder, I ALWAYS get a 404
I’m not using any .htaccess files.
Logs files only says me “we ot a 404 erreoe while trying to acce the key”
Could anyone help me find the issue or any cause of this non-validation of the challenge. This 404 error is just driving me crazy !
Thanks