I’m moving four small, simple websites to a new droplet at Digital Ocean. I hope this post will help other new Digital Ocean users, also.
I’ve setup plenty of websites over the years, but as these sites are live elsewhere — and I’ve never configured the “bones” and setup Apache from scratch, etc — I want to make sure that I didn’t miss a step somewhere before flipping the switch at the domain registrar. Thank you.
1) I setup an Ubuntu 12.04.3 x64 droplet using these instructions:
2) I used these initial server setup instructions to change the root password, create a user login that isn’t direct root, improve security, etc:
3) I installed Apache using these instructions:
These sites are simple HTML/CSS, so MySQL and PHP aren’t even needed. Going directly to the assigned IP address in a web browser displays the default “It works!” HTML page.
4) I setup four virtual host files for each of the domain names using these instructions:
As the sites are live on another host at the moment, I didn’t want to point the domain names to the VPS IP address yet, but sample home pages in each of the directories loaded correctly in a browser (i.e. IP Address/directory[site name]/public_html/ loads an HTML page).
Are pages loading in each directory sufficient to determine that the virtual hosts are configured correctly? My assumption is no and this just confirms that the directories are setup correctly.
5) I setup hostnames using these instructions:
I found this part of the instructions a little confusing.
Specifically, I setup:
A @ [IP Addresss]
CNAME www @
NS [1-3] NS1.DIGITALOCEAN.COM, etc.
I believe that is sufficient and correct. Is anything else needed in the hostname file? I would like to have non-www redirect to www, which I can do via .htaccess, if needed, but nothing atypical in terms of subdomains.
I haven’t changed the DNS entries at the domain registrar to point to Digital Ocean’s domain servers yet.
6) I don’t use e-mail for any of these domain names, so mail server configuration is not needed (I didn’t setup any MX records).
7) I have logged into the IP address directly via FTP with the non-root default user and uploaded the files in the correct directories and copied over the .htaccess files via SSH, as well.
Is that everything? Can I safely switch over the DNS entries at the domain name registry or have I missed something? Thank you, again.
8) After the switchover, I would like to setup the droplet so the IP address (and directories directly beneath the IP address) either don’t load or redirect to the default domain or applicable domain names.
Perhaps this happens automatically. I couldn’t find documentation about this on Digital Ocean, but I think this might be helpful (although the ServerName already is set as specified by the virtual hosts tutorial):
If anything needs to be done to disable/mask/redirect the exposed IP in a web browser and/or there are directly applicable instructions on Digital Ocean, please do let me know that as well. Thank you very much!
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.