My domain is: Multiple domains
My web server is: Apache/2.4.46 (Ubuntu)
The operating system my web server runs on is: Ubuntu Bionic
I can login to a root shell on my machine : Yes
The version of my client is: certbot 0.31.0
My employer provides microsites to charities and I'm looking to automate certificate requests so emailing me stops being a bottleneck. We have automated processes that let the web designers provision new URLS as needed, but none of those processes run as root, and for sites where the client is mapping a subdomain of their site to our servers there's a delay between provisioning the site and getting a certificate through Let's Encrypt is possible.
I want to grab the list of all the virtual sites configured on the server and request certificates for all of them, skipping the ones that already have SSL. The requests will fall well within the Let's Encrypt weekly new certificate limits.
I was thinking of writing code to do the following:
- Piping the results of sudo apachectl -S to a file
- Parsing the file to build a list of all the URLS and their port number.
- Remove the URLS that already have an SSL configuration
- Call certbot for each of the remaining URLS to request a certificate.
I wanted to see if anything like that already existed before I dove in. My hope is there's something obvious I just don't know about yet.