Question

Migration to Digital Ocean & DNS

Hi All,

I am looking for some advice around the best way to achieve the following, essentially i currently run 3 wordpress websites all hosted on 3 different shared hosting accounts. Lets call them r2d2.com, C3P0.com & BB8.com i want to consolidate these down and move over to a VPS on DO. I do however need to minimise any downtime and would like to take the opportunity of the move to do some testing on new features in advance. This is my plan so far"

  1. Build a new droplet based on Ubuntu 16.04, secure it and then install a LEMP stack. Add on a management platform (VirtualMin or ServerPilot).
  2. Deploy 3 new virtual sites on the server (testing.r2d2.com, testing.c3po.com & testing.bb8.com). At this point i will add NS Record with my naming provider to point these subdomains to the DO name servers. 3.Clone the live sites and deploy to the DO droplet, Make and test any changes.
  3. When Ready clone to testing sites to 3 new sites in the DO droplet using the original names.
  4. Create a records on my dns to point r2d2.com, C3P0.com and BB8.com to my droplet.

Hopefully the above makes sense, i have three questions though.

  1. Will the above work, the bit i am really unsure about is the DNS? 2.What size of Droplet will i need to achieve this(I appreciate this will only be rough estimates without the full details of the sites) 3.Which management platform do people recommend, i do have a long term view of potentially hosting other peoples sites in DO.

Thanks in advance for the help.

W

Subscribe
Share

Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

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.

Great decision on moving to DigitalOcean. I moved my personal workloads to here some years ago and have loved the platform while using it in various capacities.

What you are trying to achieve is quite possible and not without the possibility of achieving it through various methods.

One approach I would take is as follows for a single droplet setup using the DigitalOcean DNS + Firewalls etc…: - Note: No admin panel outside DigitalOcean is used

EXAMPLE: /home/c3po
- home
- - c3po
- - - public_html
- - - logs
- - - backups
EXAMPLE: /etc/php/7.0/fpm/pool.d/c3po.conf
[c3po]
user = c3po
group = c3po
listen = /var/run/php/php7.0-fpm-c3po.sock
listen.owner = nginx
listen.group = nginx
request_terminate_timeout = 300
pm = dynamic
pm.max_children = 5
pm.start_servers = 2
pm.min_spare_servers = 1
pm.max_spare_servers = 3
chdir = /
  • Clone the first first site into the respective user account and web root

  • Add NGINX entry

EXAMPLE: /etc/nginx/conf.d/c3po.com.conf
upstream php7 {
  server unix:/var/run/php/php7.0-fpm-c3po.sock;
}
server {
  listen       80;
  server_name  dev.c3po.com c3po.com www.c3po.com;
  charset utf-8;
  access_log  /home/c3po/logs/access.log;
  error_log     /home/c3po/logs/error_log;
  location / {
    root   /home/c3po/public_html;
    index  index.php index.html index.htm;
  }
  location ~ \.php$ {
    fastcgi_pass php7;
    fastcgi_split_path_info ^(.+\.php)(/.+)$;
    fastcgi_index index.php;
    include fastcgi_params;
    fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;
    fastcgi_read_timeout 300;
  }
}
  • Add an entry to the DNS zone file for dev.* - dev.c3po.com to your registrar or previous hosting zone file that points to the Droplets Floating IP - Test everything out to ensure it is working as expected. Remove dev.* entry from the DigitalOcean DNS and NGINX Config once complete.

  • Update your domain(s) to DigitalOceans nameservers ns1.digitalocean.com, ns2.digitalocean.com, ns3.digitalocean.com

  • Secure the LEMP stack with LetsEncrypt once domain propagation is complete https://www.digitalocean.com/community/tutorials/how-to-secure-nginx-with-let-s-encrypt-on-ubuntu-16-04

Rinse and repeat for each domain as required. As stated before this is one possible way. Depending on the application you are running some details may need to be adjusted accordingly.

Another approach - https://blog.ssdnodes.com/blog/tutorial-using-docker-and-nginx-to-host-multiple-websites/

Setting up Vanity Name Servers - https://www.digitalocean.com/community/tutorials/how-to-create-vanity-or-branded-nameservers-with-digitalocean-cloud-servers

To avoid downtime you could design an infrastructure that spans multiple droplets with redundancy systems built in - https://www.digitalocean.com/community/tags/high-availability?type=tutorials