Servus Sahsanu,
OK, I thought that made sense. I have now made the settings as you suggested and the redirect to port 443 still works. But the error when renewing the certificate is still the same. Here are both virtual host configuration files:
<VirtualHost *:80>
ServerAdmin towi@prontosystems.de
DocumentRoot /var/www/prontosystems.de/test/wordpress
ServerName test.prontosystems.de
ErrorLog ${APACHE_LOG_DIR}/test.prontosystems.de_error.log
CustomLog ${APACHE_LOG_DIR}/test.prontosystems.de_access.log combined
# SSLEngine on
# SSLCertificateFile /etc/letsencrypt/live/test.prontosystems.de/cert.pem
# SSLCertificateKeyFile /etc/letsencrypt/live/test.prontosystems.de/privkey.pem
# SSLCertificateChainFile /etc/letsencrypt/live/test.prontosystems.de/chain.pem
RewriteEngine on
RewriteCond %{SERVER_NAME} =test.prontosystems.de
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
---snip---
<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerAdmin towi@prontosystems.de
DocumentRoot /var/www/prontosystems.de/test/wordpress
ServerName test.prontosystems.de
ErrorLog ${APACHE_LOG_DIR}/test.prontosystems.de_error.log
CustomLog ${APACHE_LOG_DIR}/test.prontosystems.de_access.log combined
SSLCertificateFile /etc/letsencrypt/live/test.prontosystems.de/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/test.prontosystems.de/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
</VirtualHost>
</IfModule>
For the sake of completeness, here is the output of the certbot renew --dry-run
command regarding this vhost:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Processing /etc/letsencrypt/renewal/test.prontosystems.de.conf
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Cert not due for renewal, but simulating renewal for dry run
Plugins selected: Authenticator apache, Installer apache
Renewing an existing certificate
Performing the following challenges:
http-01 challenge for test.prontosystems.de
Waiting for verification...
Cleaning up challenges
Attempting to renew cert (test.prontosystems.de) from /etc/letsencrypt/renewal/test.prontosystems.de.conf produced an unexpected error: Failed authorization procedure. test.prontosystems.de (http-01): urn:ietf:params:acme:error:unauthorized :: The client lacks sufficient authorization :: Invalid response from http://test.prontosystems.de/.well-known/acme-challenge/fp-hH7OAWWOktXXyheARq919pfn5P0tf-rFYey-Y_Hg [185.216.178.34]: "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\n<html><head>\n<title>400 Bad Request</title>\n</head><body>\n<h1>Bad Request</h1". Skipping.
But I have discovered something else mystery. I have four vhosts on the system, all four are issued with letsencrypt certificates and have been configured in the same way (except for the one that we have now changed) but only three of them return the above-mentioned error message, one, however, seems to be working. This was also the case tonight and I must have overseen it (sorry, but it was very late). Here is the complete output of the renewal process. Please pay attention to the vhost www.prontosystems.de
(Sorry long):
# certbot renew --dry-run
Saving debug log to /var/log/letsencrypt/letsencrypt.log
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Processing /etc/letsencrypt/renewal/cloud.prontosystems.de.conf
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Cert not due for renewal, but simulating renewal for dry run
Plugins selected: Authenticator apache, Installer apache
Renewing an existing certificate
Performing the following challenges:
http-01 challenge for cloud.prontosystems.de
Waiting for verification...
Cleaning up challenges
Attempting to renew cert (cloud.prontosystems.de) from /etc/letsencrypt/renewal/cloud.prontosystems.de.conf produced an unexpected error: Failed authorization procedure. cloud.prontosystems.de (http-01): urn:ietf:params:acme:error:unauthorized :: The client lacks sufficient authorization :: Invalid response from http://cloud.prontosystems.de/.well-known/acme-challenge/gTUCbdXVg_YzZQaRMeFIDzV5yV29eqyt5oMuO9G-4TQ [185.216.178.34]: "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\n<html><head>\n<title>400 Bad Request</title>\n</head><body>\n<h1>Bad Request</h1". Skipping.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Processing /etc/letsencrypt/renewal/test.prontosystems.de.conf
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Cert not due for renewal, but simulating renewal for dry run
Plugins selected: Authenticator apache, Installer apache
Renewing an existing certificate
Performing the following challenges:
http-01 challenge for test.prontosystems.de
Waiting for verification...
Cleaning up challenges
Attempting to renew cert (test.prontosystems.de) from /etc/letsencrypt/renewal/test.prontosystems.de.conf produced an unexpected error: Failed authorization procedure. test.prontosystems.de (http-01): urn:ietf:params:acme:error:unauthorized :: The client lacks sufficient authorization :: Invalid response from http://test.prontosystems.de/.well-known/acme-challenge/fp-hH7OAWWOktXXyheARq919pfn5P0tf-rFYey-Y_Hg [185.216.178.34]: "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\n<html><head>\n<title>400 Bad Request</title>\n</head><body>\n<h1>Bad Request</h1". Skipping.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Processing /etc/letsencrypt/renewal/www.lampenfischer.de.conf
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Cert not due for renewal, but simulating renewal for dry run
Plugins selected: Authenticator apache, Installer apache
Renewing an existing certificate
Performing the following challenges:
http-01 challenge for www.lampenfischer.de
Waiting for verification...
Cleaning up challenges
Attempting to renew cert (www.lampenfischer.de) from /etc/letsencrypt/renewal/www.lampenfischer.de.conf produced an unexpected error: Failed authorization procedure. www.lampenfischer.de (http-01): urn:ietf:params:acme:error:unauthorized :: The client lacks sufficient authorization :: Invalid response from http://www.lampenfischer.de/.well-known/acme-challenge/iOHEkaCHk5-HKV6eJ0TQILgfltZlMzhT-x27gAKs7VU [185.216.178.34]: "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\n<html><head>\n<title>400 Bad Request</title>\n</head><body>\n<h1>Bad Request</h1". Skipping.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Processing /etc/letsencrypt/renewal/www.prontosystems.de.conf
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Cert not due for renewal, but simulating renewal for dry run
Plugins selected: Authenticator apache, Installer apache
Renewing an existing certificate
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
new certificate deployed with reload of apache server; fullchain is
/etc/letsencrypt/live/www.prontosystems.de/fullchain.pem
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
The following certs could not be renewed:
/etc/letsencrypt/live/cloud.prontosystems.de/fullchain.pem (failure)
/etc/letsencrypt/live/test.prontosystems.de/fullchain.pem (failure)
/etc/letsencrypt/live/www.lampenfischer.de/fullchain.pem (failure)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
** DRY RUN: simulating 'certbot renew' close to cert expiry
** (The test certificates below have not been saved.)
The following certs were successfully renewed:
/etc/letsencrypt/live/www.prontosystems.de/fullchain.pem (success)
The following certs could not be renewed:
/etc/letsencrypt/live/cloud.prontosystems.de/fullchain.pem (failure)
/etc/letsencrypt/live/test.prontosystems.de/fullchain.pem (failure)
/etc/letsencrypt/live/www.lampenfischer.de/fullchain.pem (failure)
** DRY RUN: simulating 'certbot renew' close to cert expiry
** (The test certificates above have not been saved.)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
3 renew failure(s), 0 parse failure(s)
IMPORTANT NOTES:
- The following errors were reported by the server:
Domain: cloud.prontosystems.de
Type: unauthorized
Detail: Invalid response from
http://cloud.prontosystems.de/.well-known/acme-challenge/gTUCbdXVg_YzZQaRMeFIDzV5yV29eqyt5oMuO9G-4TQ
[185.216.178.34]: "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML
2.0//EN\">\n<html><head>\n<title>400 Bad
Request</title>\n</head><body>\n<h1>Bad Request</h1"
To fix these errors, please make sure that your domain name was
entered correctly and the DNS A/AAAA record(s) for that domain
contain(s) the right IP address.
- The following errors were reported by the server:
Domain: test.prontosystems.de
Type: unauthorized
Detail: Invalid response from
http://test.prontosystems.de/.well-known/acme-challenge/fp-hH7OAWWOktXXyheARq919pfn5P0tf-rFYey-Y_Hg
[185.216.178.34]: "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML
2.0//EN\">\n<html><head>\n<title>400 Bad
Request</title>\n</head><body>\n<h1>Bad Request</h1"
To fix these errors, please make sure that your domain name was
entered correctly and the DNS A/AAAA record(s) for that domain
contain(s) the right IP address.
- The following errors were reported by the server:
Domain: www.lampenfischer.de
Type: unauthorized
Detail: Invalid response from
http://www.lampenfischer.de/.well-known/acme-challenge/iOHEkaCHk5-HKV6eJ0TQILgfltZlMzhT-x27gAKs7VU
[185.216.178.34]: "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML
2.0//EN\">\n<html><head>\n<title>400 Bad
Request</title>\n</head><body>\n<h1>Bad Request</h1"
To fix these errors, please make sure that your domain name was
entered correctly and the DNS A/AAAA record(s) for that domain
contain(s) the right IP address.
Here are the two vhost configuration files of the vhost that seems to have no problems:
<VirtualHost *:80>
ServerName www.prontosystems.de
DocumentRoot /var/www/prontosystems.de/www/wordpress
Redirect permanent / https://www.prontosystems.de/
</VirtualHost>
<VirtualHost *:443>
ServerAdmin towi@prontosystems.de
DocumentRoot /var/www/prontosystems.de/www/wordpress
ServerName www.prontosystems.de
SSLEngine on
SSLCertificateFile /etc/letsencrypt/live/www.prontosystems.de/cert.pem
SSLCertificateKeyFile /etc/letsencrypt/live/www.prontosystems.de/privkey.pem
SSLCertificateChainFile /etc/letsencrypt/live/www.prontosystems.de/chain.pem
ErrorLog ${APACHE_LOG_DIR}/www.prontosystems.de_error.log
CustomLog ${APACHE_LOG_DIR}/www.prontosystems.de_access.log combined
RewriteEngine on
RewriteCond %{SERVER_NAME} =www.prontosystems.de
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
---snip---
<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerAdmin towi@prontosystems.de
DocumentRoot /var/www/prontosystems.de/www/wordpress
ServerName www.prontosystems.de
ErrorLog ${APACHE_LOG_DIR}/www.prontosystems.de_error.log
CustomLog ${APACHE_LOG_DIR}/www.prontosystems.de_access.log combined
SSLCertificateFile /etc/letsencrypt/live/www.prontosystems.de/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/www.prontosystems.de/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
</VirtualHost>
</IfModule>
I hope this brings us a little closer to the problem. Thank you for your attention.
Thx & Bye Tom