Cert is due for renewal, auto-renewing…
Could not choose appropriate plugin: The apache plugin is not working; there may be problems with your existing configuration.
The error was: PluginError(‘There has been an error in parsing the file /etc/apache2/sites-available/default.conf on line 53: Syntax error’,)
Attempting to renew cert from /etc/letsencrypt/renewal/[mydomain].conf produced an unexpected error: The apache plugin is not working; there may be problems with your existing configuration.
The error was: PluginError(‘There has been an error in parsing the file /etc/apache2/sites-available/default.conf on line 53: Syntax error’,). Skipping.
All renewal attempts failed. The following certs could not be renewed:
/etc/letsencrypt/live/[mydomain]/fullchain.pem (failure)
1 renew failure(s), 0 parse failure(s)
Saving debug log to /var/log/letsencrypt/letsencrypt.log
My web server is (include version): Apache/2.4.18
The operating system my web server runs on is (include version):
ubuntu 16.04
My hosting provider, if applicable, is:
amazon ec2
I can login to a root shell on my machine (yes or no, or I don’t know):
When I updated certbot, it became necessary to add:
post_hook = /bin/run-parts /etc/letsencrypt/post-hook.d/
renew_hook = /bin/run-parts /etc/letsencrypt/renew-hook.d/
pre_hook = /bin/run-parts /etc/letsencrypt/pre-hook.d/
to /etc/letsencrypt/renewal/.conf
Which I did.
However, when I run certbot renew, I am still given the same error:
Could not choose appropriate plugin: The apache plugin is not working; there may be problems with your existing configuration.
The error was: PluginError(‘There has been an error in parsing the file /etc/apache2/sites-available/default.conf on line 53: Syntax error’,)
Attempting to renew cert from /etc/letsencrypt/renewal/[mydomain].conf produced an unexpected error: The apache plugin is not working; there may be problems with your existing configuration.
The error was: PluginError(‘There has been an error in parsing the file /etc/apache2/sites-available/default.conf on line 53: Syntax error’,). Skipping.
I then attempted to run the following (as suggested):
certbot certonly --cert-name [mydomain] --domains $(sudo openssl x509 -in /etc/letsencrypt/live/[mydomain]/cert.pem -noout -text | grep DNS | sed ‘s/ DNS://g’) --authenticator webroot --installer apache --webroot-path /home/www-data/web2py && apachectl -k graceful
And I get the following message:
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Starting new HTTPS connection (1): acme-v01.api.letsencrypt.org
Cert is due for renewal, auto-renewing…
Renewing an existing certificate
Performing the following challenges:
http-01 challenge for [mydomain]
Using the webroot path /home/www-data/web2py for all unmatched domains.
Waiting for verification…
Cleaning up challenges
Failed authorization procedure. [mydomain] (http-01): urn:acme:error:unauthorized :: The client lacks sufficient authorization :: Invalid response from http://[mydomain]/.well-known/acme-challenge/Iw6dgjFITU6v_rSGC035QXc6ZzcccNOVfm8MFOlB8RM [52.38.183.173]: 400
To fix these errors, please make sure that your domain name was
entered correctly and the DNS A record(s) for that domain
contain(s) the right IP address.
I know the domain is correct. As it was working just fine until the certificate expired. I did try changing the permissions on the .well-known directory from root to reflect the same ownership as that of all the other web directories. That didn’t work.
at the very end. That line does not belong there and does not make sense in that context. I think if you remove it, you’ll stop encountering the syntax error that you were experiencing before.