Do I need to configure virtual hosts in Apache first?

I have a few domains that go to the root http directory /var/www/html

I don’t have virtual hosts configured as there is no need for it in my case. Is it still possible to get lets encrypt to work without using virtualhosts?


If you are using certbot --apache, then you must configtured virtual host (and let’s encrypt will obtain & install the certificate for you)

However, you could use certbot certonly to only obtain an certificate. (You’ll need to install the certificate yourself, configture it in apache virtual host)

Another difference between certonly & Apache is that after renew, certbot Apache will automatically reload the server so it’ll pickup the new certificate. In certonly, you’ll need to manually reload the server.

Thank you

Well, if you use certbot certonly and install the certificate 100 % manually, there is no need for that VirtualHost :wink: It's very much possible to add a TLS certificate to Apache without using VirtualHosts.

This can be scripted with hooks very simply.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.