Hello,
I used certbot-auto apache to install a certificate for a website on an unbuntu server running PHP-FPM and Apache. This did not work without commenting out various sections of the virtual host configuration file which were causing certbot to fail. Once the offending lines had been removed the certificate was successfully obtained. I could then reinstate the necessary parts of the configuration to ensure the website was functional. However, the renewal of these certificates fails for the same reason as the initial certificate retrieval - the config cannot be parsed.
I later learned that using certbot-auto certonly --webroot meant that the configuration files did not need to be touched and I have therefore successfully acquired and renewed certificates for other websites without any trouble.
What I’m wondering is how to switch from the apache approach to the webroot approach with minimal disruption. At first glance it would seem I can simply update the letsencrypt/renewal configuration file with the necessary settings for the website in question.
Below is the contents of the renewal configuration file for the website in question in apache mode:
version = 0.9.3
cert = /etc/letsencrypt/live/mydomain.co.uk/cert.pem
privkey = /etc/letsencrypt/live/mydomain.co.uk/privkey.pem
chain = /etc/letsencrypt/live/mydomain.co.uk/chain.pem
fullchain = /etc/letsencrypt/live/mydomain.co.uk/fullchain.pem
[renewalparams]
authenticator = apache
installer = apache
account = 12345
And here’s what I intend to change it to after comparing it to the websites I have set up with the webroot method:
version = 0.12.0
archive_dir = /etc/letsencrypt/archive/mydomain.co.uk
cert = /etc/letsencrypt/live/mydomain.co.uk/cert.pem
privkey = /etc/letsencrypt/live/mydomain.co.uk/privkey.pem
chain = /etc/letsencrypt/live/mydomain.co.uk/chain.pem
fullchain = /etc/letsencrypt/live/mydomain.co.uk/fullchain.pem
[renewalparams]
authenticator = webroot
installer = None
account = 12345
[[webroot_map]]
mydomain.co.uk = /var/www/mydomain.co.uk/
www.mydomain.co.uk = /var/www/mydomain.co.uk/
I’m not 100% sure what the implication of changing the version number is. If I don’t change it will the syntax be correct? If I do change it might it somehow invalidate the certificate request?
Finally, is there anything other than the renewal configuration file that I need to consider changing?
Any help greatly appreciated.