How to enable SSL certificate for virtual host ?

October 29, 2019 164 views
WordPress Let's Encrypt Ubuntu Apache DigitalOcean

Hello Team,

I have set up the virtual host for my website. Directory structure is
www/html/-virtual host( files
-main website’s files(

i.e in html folder I have main website’s all files and domain name of virtual host . I have followed all the steps given in . It only enable SSL certificate for main website but not enabling SSL certificate for website which is on virtual host. It is showing that website is not secure for website who is set up on the virtual host.

Can you please guide me so that I can enable SSL certificate for website that is on virtual host?

1 Answer

Hi @Web1developer,

I assume you have certbot installed as you’ve already managed to issue some certificates, can you try the following now

 certbot --apache -d -d

For this example, the base domain will be and you’ll need to change it to the one you wish

If you have multiple virtual hosts, you should run certbot once for each to generate a new certificate for each. You can distribute multiple domains and subdomains across your virtual hosts in any way.


Have another answer? Share your knowledge.