{"id":1110,"date":"2019-08-11T18:50:45","date_gmt":"2019-08-11T18:50:45","guid":{"rendered":"http:\/\/dev.local\/?page_id=1110"},"modified":"2020-03-21T14:36:06","modified_gmt":"2020-03-21T14:36:06","slug":"digital-ocean-domain-settings","status":"publish","type":"page","link":"https:\/\/lamp.ciscoar.com\/?page_id=1110","title":{"rendered":"Digital Ocean Domain settings"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">Digital Ocean Domain settings<\/h2>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"alignleft is-resized\"><a href=\"https:\/\/m.do.co\/c\/d75f5d4e2583\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/lamp.ciscoar.com\/wp-content\/uploads\/2019\/08\/DigitalOcean_logo.png\" alt=\"Logo Digital Ocean\" class=\"wp-image-1122\" width=\"123\" height=\"123\" srcset=\"https:\/\/lamp.ciscoar.com\/wp-content\/uploads\/2019\/08\/DigitalOcean_logo.png 332w, https:\/\/lamp.ciscoar.com\/wp-content\/uploads\/2019\/08\/DigitalOcean_logo-150x150.png 150w, https:\/\/lamp.ciscoar.com\/wp-content\/uploads\/2019\/08\/DigitalOcean_logo-300x300.png 300w, https:\/\/lamp.ciscoar.com\/wp-content\/uploads\/2019\/08\/DigitalOcean_logo-100x100.png 100w\" sizes=\"auto, (max-width: 123px) 100vw, 123px\" \/><\/a><\/figure><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">In our particular case, we&#8217;ve already bought and also configured one domain(<strong><a href=\"\/11-ionos\/\">IONOS<\/a><\/strong>), and because of that we&#8217;ve decided that our Virtual Host is going to be accessed via a subdomain, the following steps are useful for people which use Digital Ocean to host their websites for example running Apache on one Digital Ocean Droplet (VPS &#8211; Virtual Private Server)<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>Click the logo to be redirected to Digital Ocean using our referral link to buy their products<\/p><cite>Referral Link<\/cite><\/blockquote>\n\n\n\n<h2 class=\"wp-block-heading\">Choosing the Domain<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">In order to see the list of Domains you have available to be modified (in this case we want to add a subdomain) you&#8217;ll have to first select <strong>Networking<\/strong> and then <strong>Domains<\/strong>, see screenshot below:<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><a href=\"https:\/\/lamp.ciscoar.com\/wp-content\/uploads\/2019\/08\/digital-ocean-domain-and-dns.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"585\" src=\"https:\/\/lamp.ciscoar.com\/wp-content\/uploads\/2019\/08\/digital-ocean-domain-and-dns-1024x585.png\" alt=\"\" class=\"wp-image-1115\" srcset=\"https:\/\/lamp.ciscoar.com\/wp-content\/uploads\/2019\/08\/digital-ocean-domain-and-dns-1024x585.png 1024w, https:\/\/lamp.ciscoar.com\/wp-content\/uploads\/2019\/08\/digital-ocean-domain-and-dns-300x171.png 300w, https:\/\/lamp.ciscoar.com\/wp-content\/uploads\/2019\/08\/digital-ocean-domain-and-dns-768x439.png 768w, https:\/\/lamp.ciscoar.com\/wp-content\/uploads\/2019\/08\/digital-ocean-domain-and-dns.png 1066w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/a><\/figure><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Create a new &#8220;A&#8221; Record<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Because we are creating a subdomain, we don&#8217;t have to define the NS (Name Server) as they were already defined when the main domain (example.com) was created.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">So, we are going to create only the &#8220;A&#8221; record and one &#8220;C-Name&#8221;, also known as &#8220;alias&#8221;.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><a href=\"https:\/\/lamp.ciscoar.com\/wp-content\/uploads\/2019\/08\/digital-ocean-create-dns-a-record-01.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1225\" height=\"417\" src=\"https:\/\/lamp.ciscoar.com\/wp-content\/uploads\/2019\/08\/digital-ocean-create-dns-a-record-01.png\" alt=\"\" class=\"wp-image-1129\" srcset=\"https:\/\/lamp.ciscoar.com\/wp-content\/uploads\/2019\/08\/digital-ocean-create-dns-a-record-01.png 1225w, https:\/\/lamp.ciscoar.com\/wp-content\/uploads\/2019\/08\/digital-ocean-create-dns-a-record-01-300x102.png 300w, https:\/\/lamp.ciscoar.com\/wp-content\/uploads\/2019\/08\/digital-ocean-create-dns-a-record-01-768x261.png 768w, https:\/\/lamp.ciscoar.com\/wp-content\/uploads\/2019\/08\/digital-ocean-create-dns-a-record-01-1024x349.png 1024w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/a><\/figure><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">As you can see below as soon as you start typing the subdomain the page will show you below how it looks with its domain attached, what is usually called the website&#8217;s URL.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"400\" height=\"260\" src=\"https:\/\/lamp.ciscoar.com\/wp-content\/uploads\/2019\/08\/digital-ocean-subdomain-v2.gif\" alt=\"Digital Ocean subdomain\" class=\"wp-image-1134\"\/><\/figure><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">Immediately after you type your subdomain you must select the Digital Ocean droplet IP address where this subdomain will be pointing, see below:<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"820\" height=\"180\" src=\"https:\/\/lamp.ciscoar.com\/wp-content\/uploads\/2019\/08\/digital-ocean-select-droplet-ip-address.gif\" alt=\"Digital Ocean select droplet IP\" class=\"wp-image-1138\"\/><\/figure><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">You&#8217;ll see at up right corner a confirmation about the new &#8220;A&#8221; record.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><a href=\"https:\/\/lamp.ciscoar.com\/wp-content\/uploads\/2019\/08\/digital-ocean-a-record-successfuly-created.png\"><img loading=\"lazy\" decoding=\"async\" width=\"465\" height=\"195\" src=\"https:\/\/lamp.ciscoar.com\/wp-content\/uploads\/2019\/08\/digital-ocean-a-record-successfuly-created.png\" alt=\"\" class=\"wp-image-1142\" srcset=\"https:\/\/lamp.ciscoar.com\/wp-content\/uploads\/2019\/08\/digital-ocean-a-record-successfuly-created.png 465w, https:\/\/lamp.ciscoar.com\/wp-content\/uploads\/2019\/08\/digital-ocean-a-record-successfuly-created-300x126.png 300w\" sizes=\"auto, (max-width: 465px) 100vw, 465px\" \/><\/a><\/figure><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">And effectively a new line will apperar containing all the information of the recently created entry.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><a href=\"https:\/\/lamp.ciscoar.com\/wp-content\/uploads\/2019\/08\/digital-ocean-new-a-record.png\"><img loading=\"lazy\" decoding=\"async\" width=\"761\" height=\"157\" src=\"https:\/\/lamp.ciscoar.com\/wp-content\/uploads\/2019\/08\/digital-ocean-new-a-record.png\" alt=\"\" class=\"wp-image-1145\" srcset=\"https:\/\/lamp.ciscoar.com\/wp-content\/uploads\/2019\/08\/digital-ocean-new-a-record.png 761w, https:\/\/lamp.ciscoar.com\/wp-content\/uploads\/2019\/08\/digital-ocean-new-a-record-300x62.png 300w\" sizes=\"auto, (max-width: 706px) 89vw, (max-width: 767px) 82vw, 740px\" \/><\/a><\/figure><\/div>\n\n\n\n<h2 class=\"wp-block-heading\"> Create a new &#8220;C-NAME&#8221; Record <\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Creating a &#8220;C-Name&#8221; entry is quite similar, first, be sure to select CNAME, the third option, see below screenshot:<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><a href=\"https:\/\/lamp.ciscoar.com\/wp-content\/uploads\/2019\/08\/digital-ocean-create-cname-01.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"249\" src=\"https:\/\/lamp.ciscoar.com\/wp-content\/uploads\/2019\/08\/digital-ocean-create-cname-01-1024x249.png\" alt=\"\" class=\"wp-image-1152\" srcset=\"https:\/\/lamp.ciscoar.com\/wp-content\/uploads\/2019\/08\/digital-ocean-create-cname-01-1024x249.png 1024w, https:\/\/lamp.ciscoar.com\/wp-content\/uploads\/2019\/08\/digital-ocean-create-cname-01-300x73.png 300w, https:\/\/lamp.ciscoar.com\/wp-content\/uploads\/2019\/08\/digital-ocean-create-cname-01-768x187.png 768w, https:\/\/lamp.ciscoar.com\/wp-content\/uploads\/2019\/08\/digital-ocean-create-cname-01.png 1065w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/a><\/figure><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">You&#8217;ll notice that the title for Hostname hasn&#8217;t changed but now we see the word &#8220;alias&#8221; in the title of the next box, and that&#8217;s the key here, that actually a CNAME acts as an alias of our previously create subdomain.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">One useful feature that Digital Ocean page has is that we can easily copy just hovering the cursor over the data we want to copy and a little icon apperar allowing us to click to copy, see the below animation.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"1196\" height=\"324\" src=\"https:\/\/lamp.ciscoar.com\/wp-content\/uploads\/2019\/08\/digital-ocean-cname-creation.gif\" alt=\"\" class=\"wp-image-1174\"\/><\/figure><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">That&#8217;s it! DNS settings completed<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">And that&#8217;s it, you&#8217;ve successfully created both the &#8220;A&#8221; record and also the &#8220;CNAME&#8221; record, your subdomain is now sending visitors to your Apache&#8217;s Virtual Host, either they decide to use the &#8220;www&#8221; or not, it doesn&#8217;t matter, you&#8217;ve got them covered.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Verify using your browser<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">If you type either of the URLs, with or without the &#8220;www&#8221; in your web browser you&#8217;ll see the &#8220;<a href=\"\/apache-virtual-host-index-html\/\">index.html<\/a>&#8221; page.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><a href=\"https:\/\/lamp.ciscoar.com\/wp-content\/uploads\/2019\/08\/browser-verify-ok.png\"><img loading=\"lazy\" decoding=\"async\" width=\"447\" height=\"172\" src=\"https:\/\/lamp.ciscoar.com\/wp-content\/uploads\/2019\/08\/browser-verify-ok.png\" alt=\"\" class=\"wp-image-1179\" srcset=\"https:\/\/lamp.ciscoar.com\/wp-content\/uploads\/2019\/08\/browser-verify-ok.png 447w, https:\/\/lamp.ciscoar.com\/wp-content\/uploads\/2019\/08\/browser-verify-ok-300x115.png 300w\" sizes=\"auto, (max-width: 447px) 100vw, 447px\" \/><\/a><\/figure><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">As you can see below the &#8220;C-NAME&#8221; records acts as an &#8220;alias&#8221; of the subdomain.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><a href=\"https:\/\/lamp.ciscoar.com\/wp-content\/uploads\/2019\/08\/browser-verify-ok-02.png\"><img loading=\"lazy\" decoding=\"async\" width=\"485\" height=\"183\" src=\"https:\/\/lamp.ciscoar.com\/wp-content\/uploads\/2019\/08\/browser-verify-ok-02.png\" alt=\"\" class=\"wp-image-1183\" srcset=\"https:\/\/lamp.ciscoar.com\/wp-content\/uploads\/2019\/08\/browser-verify-ok-02.png 485w, https:\/\/lamp.ciscoar.com\/wp-content\/uploads\/2019\/08\/browser-verify-ok-02-300x113.png 300w\" sizes=\"auto, (max-width: 485px) 100vw, 485px\" \/><\/a><\/figure><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Congratulations!!! We did it!<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">We&#8217;ve successfully completed all the tasks necessary to add a new Virtual Host to our Apache web server that is running on a Digital Ocean VPS (Droplet), congratulations! job well done!<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How to remove Apache&#8217;s Virtual Host<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">It is always a good idea to reinforce all the things you&#8217;ve learnt so far, a good exercise would be of course to repeat all the steps and do it all once again, and for that purpose you may want to delete the Virtual Host and build it from scratch.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><a href=\"\/removing-an-apaches-virtual-host\/\">Removing an Apache&#8217;s Virtual Host<\/a><\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Where to go now?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Your brand new website is now live and accessible from all over the world, the next step would be to get the SSL certificates and forward HTTP traffic to HTTPS to be compliant with current security standards, we&#8217;re going to configure the free SSL certificates provided by Let&#8217;s encrypt and the installation will be done using Certbot, see the following article to learn how.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><a href=\"https:\/\/lamp.ciscoar.com\/ssl\/\">Let&#8217;s Encrypt SSL Certificates and Certbot<\/a><\/li><\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Digital Ocean Domain settings In our particular case, we&#8217;ve already bought and also configured one domain(IONOS), and because of that we&#8217;ve decided that our Virtual Host is going to be accessed via a subdomain, the following steps are useful for people which use Digital Ocean to host their websites for example running Apache on one &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/lamp.ciscoar.com\/?page_id=1110\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Digital Ocean Domain settings&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-1110","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/lamp.ciscoar.com\/index.php?rest_route=\/wp\/v2\/pages\/1110","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lamp.ciscoar.com\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/lamp.ciscoar.com\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/lamp.ciscoar.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/lamp.ciscoar.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1110"}],"version-history":[{"count":79,"href":"https:\/\/lamp.ciscoar.com\/index.php?rest_route=\/wp\/v2\/pages\/1110\/revisions"}],"predecessor-version":[{"id":4352,"href":"https:\/\/lamp.ciscoar.com\/index.php?rest_route=\/wp\/v2\/pages\/1110\/revisions\/4352"}],"wp:attachment":[{"href":"https:\/\/lamp.ciscoar.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1110"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}