{"id":218,"date":"2026-01-29T10:21:51","date_gmt":"2026-01-29T10:21:51","guid":{"rendered":"https:\/\/myjetsonnano.perseus314.com\/?p=218"},"modified":"2026-01-29T12:59:58","modified_gmt":"2026-01-29T12:59:58","slug":"changing-server-domain-name","status":"publish","type":"post","link":"https:\/\/myjetsonnano.perseus314.com\/index.php\/2026\/01\/29\/changing-server-domain-name\/","title":{"rendered":"Changing server domain name"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Today I find myself having to change the domain name of my server. Here are the steps, though the order can be shuffled.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">File names on the server<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">In case I ever need to do it again, I am changing the directory name on the server which files are served from. Instead of<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/var\/www\/myjetsonnano.olddomainname.com<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">files will now be located in <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/var\/www\/myjetsonnano<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Apache2 Sites-Available<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Go into the directory and the edit file<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/etc\/apache2\/sites-available\/\nsite.newdomainname.com.conf<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">replacing all references to the old domain name with the new domain name. The new file can be created by copying the old one, or renaming it if you feel confident.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Enable the site and get an SSL certificate<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>a2ensite site.newdomain.com\nsystemctl reload apache2\ncertbot --apache -d site.newdomain.com<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Temporary domain name override in WordPress<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">To get wordpress back up running, it needs to know the domain name, which is normally stored in its database, but which can be overridden by a couple of lines in the file<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>wp-config.php<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">by adding lines like<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>define('WP_HOME','https:\/\/site.newdomain.com');\ndefine('WP_SITEURL','https:\/\/site.newdomain.com');<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Cleaning up wordpress<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">When wordpress is working, any old links can be tidied up using this tool.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"411\" height=\"241\" src=\"https:\/\/myjetsonnano.perseus314.com\/wp-content\/uploads\/2026\/01\/image-3.png\" alt=\"\" class=\"wp-image-221\" srcset=\"https:\/\/myjetsonnano.perseus314.com\/wp-content\/uploads\/2026\/01\/image-3.png 411w, https:\/\/myjetsonnano.perseus314.com\/wp-content\/uploads\/2026\/01\/image-3-300x176.png 300w\" sizes=\"auto, (max-width: 411px) 100vw, 411px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Today I find myself having to change the domain name of my server. Here are the steps, though the order can be shuffled. File names on the server In case I ever need to do it again, I am changing the directory name on the server which files are served from. Instead of files will [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":221,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16,14,15],"tags":[],"class_list":["post-218","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-apache2","category-dns","category-lamp-server"],"_links":{"self":[{"href":"https:\/\/myjetsonnano.perseus314.com\/index.php\/wp-json\/wp\/v2\/posts\/218","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/myjetsonnano.perseus314.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/myjetsonnano.perseus314.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/myjetsonnano.perseus314.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/myjetsonnano.perseus314.com\/index.php\/wp-json\/wp\/v2\/comments?post=218"}],"version-history":[{"count":5,"href":"https:\/\/myjetsonnano.perseus314.com\/index.php\/wp-json\/wp\/v2\/posts\/218\/revisions"}],"predecessor-version":[{"id":226,"href":"https:\/\/myjetsonnano.perseus314.com\/index.php\/wp-json\/wp\/v2\/posts\/218\/revisions\/226"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/myjetsonnano.perseus314.com\/index.php\/wp-json\/wp\/v2\/media\/221"}],"wp:attachment":[{"href":"https:\/\/myjetsonnano.perseus314.com\/index.php\/wp-json\/wp\/v2\/media?parent=218"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/myjetsonnano.perseus314.com\/index.php\/wp-json\/wp\/v2\/categories?post=218"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/myjetsonnano.perseus314.com\/index.php\/wp-json\/wp\/v2\/tags?post=218"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}