Can't renew certs with multiple vhosts

I had this issue as well. Creating a separate vhost for each site isn’t a good option. I have several sites, with several subdomains each, which would cause multiplicative growth of vhost files. For example, 5 sites with 5 subdomains each would lead to 25 separate configurations, making things unmanageable. Furthermore, I use defines and macros, so one simple vhost file handles everything. Breaking this structure is a deal-breaker. Further-furthermore, I had set letsencrypt to generate certonly, so I don’t understand why it’s searching through the vhost files at all. Doesn’t it have all the information it needs from the existing certificates and renewal files?

As a work-around, I created a new vhost 999-dummy.conf containing the following:

# Dummy for letsencrypt
<VirtualHost *:999>
        ServerName dummy.com
        ServerAlias *
</VirtualHost>

My server isn’t actually listening in on port 999, but this seems to be sufficient to let letsencrypt pass its vhost search and actually renew the certificates.