Transferring Website to Linode with Existing Subdomain

I am currently trying to migrate a WordPress website to my Linode server from GoDaddy's hosting service. While I have followed all of the tutorials in uploading files, setting up databases, etc., I believe I may be having some DNS issues due to an existing subdomain already on the Linode. The existing site on the server is a subdomain of the website I am trying to transfer over.

I have the RDNS record setup for the subdomain, pointing to the Linode's IP, as well as the following record in my DNS Zone File at GoDaddy:

A Record

Host = vote, Points to = 50.116.53.66 (my Linode's IP)

In a tutorial I read, it appears that I must update the A record for the main domain ("@" in GoDaddy's Zone File) and point it to the Linode IP (50.116.xx.xx). I have done this but now when I go to the main/root domain, I get forwarded to the subdomain and cannot access the old website, neither through GoDaddy hosting nor through the files I have migrated to the Linode (including the MySQL database which is migrated).

I have a couple specific questions regarding this issue:

1) Do I need to update the Nameserver (NS) Records in the GoDaddy Zone File to point to the Linode nameservers?

2) Do I need to setup a Zone File through the Linode Manager? If so, should I copy all of my existing (or some of) records from GoDaddy's Zone File?

3) I attempted to update the RDNS to point to my root domain (it's currently the subdomain), and while it works, you can only have one RDNS. Should I leave the RDNS as my subdomain or should I use my root domain?

Lastly, I have setup the necessary sites-available and hosts files as seen below:

/etc/hosts:

127.0.0.1 localhost

50.116.53.66 vote.comparemycandidates.com comparemycandidates

50.116.53.66 comparemycandidates.com cmcmainsite

The following lines are desirable for IPv6 capable hosts

::1 ip6-localhost ip6-loopback

fe00::0 ip6-localnet

ff00::0 ip6-mcastprefix

ff02::1 ip6-allnodes

ff02::2 ip6-allrouters


/etc/apache2/sites-available/comparemycandidates.com:

domain: comparemycandidates.com

public: /home/comparemycandidates/public/comparemycandidates.com/

# Admin email, Server Name (domain name), and any aliases

ServerAdmin xxx@comparemycandidates.com

ServerName http://www.comparemycandidates.com

ServerAlias comparemycandidates.com

Index file and Document Root (where the public files are located)

DirectoryIndex index.html index.php

DocumentRoot /home/comparemycandidates/public/comparemycandidates.com/public

Log file locations

LogLevel warn

ErrorLog /home/comparemycandidates/public/comparemycandidates.com/log/error.log

CustomLog /home/comparemycandidates/public/comparemycandidates.com/log/access.log combined


Thank you advance for your support as this is only my second Linode (the other on a different account), but the first time migrating a site and hosting multiple sites on the same Linode.

8 Replies

I am not sure if you did this step or not… But you might have to run````
a2ensite mydomain.com

There is sites-available, and sites-enabled. I am pretty sure that apache includes all the vhost files in sites-enabled. So you have to enable the site by using the command above and then restart apache with````
service apache2 restart

.

Lets see, I'm running a public website, listed in public Domain Name Servers, running on not one but two public web servers (while being moved).

Yet when I want help, I'll mask any and all public information so that at best people who know how to help will have to play 20 questions getting to the root of the problem.

Yeah, that's a great idea.

Can't be toooooooo paranoid about divulging those PUBLIC DOMAIN NAMES AND IP's.

So try this:

or this

<*>

and see if that helps.

mwisner - no problems there

vonskippy - I really didn't think anyone would have an issue making head or tails of it but I have uncensored everything (except the e-mail address) to help you.

And yes… the interwebs are a scary place ;)

Seems to be working. From here, http://www., vote., and bare comparemycandidates.com all point to 50.116.53.66. Visiting any of the sites in a browser redirects me to the same page: https://vote.comparemycandidates.com/accounts/login/

Regarding your questions:

1. No, this is not necessary. It is your choice whether to use Linode's nameservers or continue using GoDaddy.

Edit: Your NS records should reflect the same servers designated with your domain registrar. Right now this points to ns##.domaincontrol.com (GoDaddy).

2. You only need to set up name records on Linode if you are going to switch to using Linode's nameservers. In that case, you would need to create records for all names you want to resolve - it's not possible to split a domain and have some names on GoDaddy's DNS and some on Linode's.

3. Not sure if there are any rules against having a bare example.org as your reverse DNS. I would generally suggest using the name that your server thinks it is called (see what hostname -q gets you).

In your /etc/hosts, you should not have more than one line with the same IP address. If you need more names, simply add them to the end of the existing line. For your purposes, I really don't think you need to have anything other than the default localhost and ipv6 entries in there anyway.

Thanks for the suggestions and answers.

I'm not certain we are on the same page, however. When I type in the subdomain, vote.comparemycandidates.com, I want to arrive there or some page that's part of it (depends on if you're logged in or not). However, if I type in the root domain, comparemycandidates.com, I want to arrive at that site, the WordPress one that I am trying to migrate, not the subdomain.

I'm not sure what I'm missing but there's gotta be some broken link in the chain of pointing and dns records. /shrug :?

I guess another way to put it would be: I have two websites on the same linode. One is a subdomain of the other. How do I make it so visitors can visit both websites under the same IP?

It doesn't matter if it's a 'subdomain' or a completely different domain: Apache's logic for routing the request is the same:

1) Find all of the stanzas with the best match for the interface the request arrived on

2) Out of that set, find a stanza with an exactly-matching ServerName or ServerAlias, or find one that matches a wildcard, or find the first one it learned about.

What does the following command say: apache2ctl -S

Also, it appears that you aren't running Apache. nginx is what's issuing the redirect:

rtucker@witte:~$ curl -I http://comparemycandidates.com/

HTTP/1.1 301 Moved Permanently

Server: nginx/0.7.65

Date: Fri, 13 Jul 2012 19:44:10 GMT

Content-Type: text/html

Content-Length: 185

Connection: keep-alive

Location: https://vote.comparemycandidates.com/

So, please post your nginx configurations as well.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct