OS: Ubuntu 24.04.3 LTS x86_64
Webmin version: 2.520
The problem is that apache2 is already running on port 80 (and will continue to be).
I’m having some difficulty figuring out how to get certbot --pre-hook and --post-hook running via Webmin. For now I’m just trying to get setup for Webmin to use Let’s Encrypt rather than the default self-signed cert. However I will also be migrating other domains to the server later, and want to have this sorted out in advance.
I’ve tried adding the files with root execute permission (or all users, it doesn’t matter):
/etc/letsencrypt/renewal-hooks/pre/000-apache2-stop.sh
/etc/letsencrypt/renewal-hooks/post/000-apache2-start.sh
However they appear to be ignored when using certbot via Webmin. Nor is there a configuration option (that I could find) for adding them via Webmin Configuration → SSL Encryption → Let’s Encrypt. Also, apart from the FQDN I’m using the “Certbot built-in webserver” option, and the rest left to defaults.
What is the best place to add these hooks so that apache2 doesn’t interfere with Webmin’s management of certbot certificate requests and auto-renewals?
Or, is it safe to simply execute: certbot certonly --standalone --pre-hook "service apache2 stop" --post-hook "service apache2 start" -d $DOMAIN via the command line (as I normally would)?
FYI, I do have Virtualmin installed also, though my setup is already on a VPS and I don’t expect to be deploying additional virtual servers via Virtualmin. I also couldn’t locate any relevant setting in the Virtualmin configuration.
I’m open to suggestions if I’m overlooking something or there’s a better approach.