{"id":7023,"date":"2020-09-12T22:23:56","date_gmt":"2020-09-13T03:23:56","guid":{"rendered":"https:\/\/www.rushworth.us\/lisa\/?p=7023"},"modified":"2020-09-12T22:57:06","modified_gmt":"2020-09-13T03:57:06","slug":"testing-a-new-server-without-dns-changes","status":"publish","type":"post","link":"https:\/\/www.rushworth.us\/lisa\/?p=7023","title":{"rendered":"Testing A New Web Server Without DNS Changes"},"content":{"rendered":"<p>When migrating to a new server, it\u2019s good to validate site functionality before redirecting users to the new host. i.e. I have anya.rushworth.us set up in the httpd config on both server1 and server2. DNS currently points traffic to server1, but I need to test the site on server2.<\/p>\n<p><em><strong>Approach #1 \u2013 With administrative access to the host<\/strong><\/em><\/p>\n<p>Edit your hosts file \u2013 open an administrative command prompt<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"818\" height=\"667\" class=\"wp-image-7024\" src=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2020\/09\/word-image-4.png\" srcset=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2020\/09\/word-image-4.png 818w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2020\/09\/word-image-4-300x245.png 300w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2020\/09\/word-image-4-768x626.png 768w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2020\/09\/word-image-4-750x612.png 750w\" sizes=\"auto, (max-width: 818px) 100vw, 818px\" \/><\/p>\n<p>Edit %SYSTEMROOT%\\system32\\drivers\\etc\\hosts and add lines with the IP address WHITESPACE and the hostname(s). E.G.<br \/>\n127.0.0.1 lisatest lisatest.rushworth.us lisatest2 lisatest2.rushworth.us<br \/>\n10.1.2.3 otherhost otherhost.rushworth.us<br \/>\n10.2.3.4 anya anya.rushworth.us<\/p>\n<p>Clear your DNS cache (ipconfig \/flushdns) and navigate to the URL. You\u2019ll be directed the IP address from your hosts file instead of the DNS registered address.<\/p>\n<p><em><strong>Approach #2 \u2013 No admin access<\/strong><\/em><\/p>\n<p>Install <a href=\"https:\/\/chrome.google.com\/webstore\/detail\/modheader\/idgpnmonknjnojddfkpgkljpfnnfcklj?hl=en\" target=\"_blank\" rel=\"noopener noreferrer\">ModHeader<\/a> in your Chrome browser and click the extension to modify the headers or install <a href=\"https:\/\/addons.mozilla.org\/en-US\/firefox\/addon\/modheader-firefox\/\" target=\"_blank\" rel=\"noopener noreferrer\">ModHeader<\/a> in your Firefox browser. Click on the extension icon to set a header value.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"815\" height=\"606\" class=\"wp-image-7025\" src=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2020\/09\/word-image-5.png\" srcset=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2020\/09\/word-image-5.png 815w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2020\/09\/word-image-5-300x223.png 300w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2020\/09\/word-image-5-768x571.png 768w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2020\/09\/word-image-5-750x558.png 750w\" sizes=\"auto, (max-width: 815px) 100vw, 815px\" \/><\/p>\n<p>Add a \u201cHost\u201d header with the value of the virtual host name you need to test<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"644\" height=\"320\" class=\"wp-image-7026\" src=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2020\/09\/word-image-6.png\" srcset=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2020\/09\/word-image-6.png 644w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2020\/09\/word-image-6-300x149.png 300w\" sizes=\"auto, (max-width: 644px) 100vw, 644px\" \/><\/p>\n<p>Navigate to the hostname of the new server \u2013 <a href=\"https:\/\/server2.rushworth.us\">https:\/\/server2.rushworth.us<\/a> \u2013 but the web server will receive the Host header you configured in ModHeader and serve the web site based on that host header.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1920\" height=\"318\" class=\"wp-image-7027\" src=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2020\/09\/word-image-7.png\" srcset=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2020\/09\/word-image-7.png 1920w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2020\/09\/word-image-7-300x50.png 300w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2020\/09\/word-image-7-1024x170.png 1024w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2020\/09\/word-image-7-768x127.png 768w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2020\/09\/word-image-7-1536x254.png 1536w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2020\/09\/word-image-7-750x124.png 750w\" sizes=\"auto, (max-width: 1920px) 100vw, 1920px\" \/><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>When migrating to a new server, it\u2019s good to validate site functionality before redirecting users to the new host. i.e. I have anya.rushworth.us set up in the httpd config on both server1 and server2. DNS currently points traffic to server1, but I need to test the site on server2. Approach #1 \u2013 With administrative access &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[30],"tags":[100,352,1036],"class_list":["post-7023","post","type-post","status-publish","format-standard","hentry","category-system-administration","tag-dns","tag-httpd","tag-web-development"],"_links":{"self":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/7023","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=7023"}],"version-history":[{"count":2,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/7023\/revisions"}],"predecessor-version":[{"id":7029,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/7023\/revisions\/7029"}],"wp:attachment":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=7023"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=7023"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=7023"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}