How can I configure SSL in my domain in a droplet with multi domains when I have one domain in use?

Posted April 3, 2020 1.1k views

Hello DO community.

I am try configuring SSL for my domain ( this is a wordpress site and I am using Let’s Encrypt for that.

So, I am following this article to learn about this question:

My situation is that:

  1. I am using a single droplet on DigitalOcean for my personal sites;

  2. In this droplet, I have one site works right now and this site are using a Wordpress (Apache, PHP, etc);

  3. In the future (less them one month) I will install a new domain on this droplet;

I am reading this article to help me configure many domains in the same Apache, in the same droplet:

My question is:

If I create multi domains structure in my apache server, what can I do with de main domain ( The domain that are works now.

Can I use the backup to restore the site? Or can I move the files to the folder correspondent (Eg: var/www/html/georodrigues, var/www/html/secondsite etc) before I made changes In apache setting? The site will works or I need to change other configuration?

If the community can help me with some tutorial will be very nice.

Thanks :)

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer

Hi there @georodrigues,

Indeed it is recommended to create separate virtual hosts for each website. In your case what you could do is to create a virtual host for your domain name as described here:

One thing that you need to keep in mind is that if you change your document root from /var/www/html to /var/www/georodrigues you might have to update any references that you have in your WordPress database as well from /var/www/html to /var/www/georodrigues.

If you would like to avoid doing this, then you could just create a separate virtual host for your domain name as described, but keep the document root set to /var/www/html, that way you would not have to update any references in your database.

Hope that this helps!

by Justin Ellingwood
by Kathleen Juell
The Apache HTTP server is the most widely-used web server in the world. It provides many powerful features including dynamically loadable modules, robust media support, and extensive integration with other popular software. In this guide, you will learn how to install an Apache web server on your Ubuntu 18.04 server, as well as information about important Apache files and directories.