Linode Forum Index Linode Forum
Linode Community Forums
 


Server IP resolving to the wrong site

Click here to go to the original topic

 
       Linode Forum Index -> Linux Networking
Author Message
shodan_uk



Joined: 26 Sep 2010
Posts: 20
Location: Southampton, UK

Posted: Fri Jan 06, 2012 2:12 pm    Post subject: Server IP resolving to the wrong site  

Hi all,

I'm hosting several sites on my Linode with a fairly standard vhost based Apache set up.

Unfortunately, the IP address of the server is resolving to one of the sites and this has been picked up and indexed by Google.

Now when the client searchs for their site by keyword, it comes up listed as the IP address.

The IP is "178.79.137.105" and if you search for "aspire fitness gym essex", you'll see it. The full URL is also indexed: http://www.aspirefitnessgym.co.uk.

I've set up a reverse DNS entry via the control panel, which I hoped would resolve the IP to another URL: www.centralmediauk.com but that doesn't seem to be working.

Any ideas?

Cheers,
Terry
Back to top  
obs



Joined: 07 Mar 2010
Posts: 1403
Location: Earth

Posted: Fri Jan 06, 2012 2:19 pm    Post subject:  

The first virtual host is used for any host that doesn't match one of the other virtual hosts.

If you have your virtual hosts in separate files set your centralmediauk.com file to be the first lexicographically i.e. start it with a 00 if they're all in the same file just put that host at the top of the file.

Then restart apache.
Back to top  
hybinet



Joined: 02 May 2008
Posts: 1058

Posted: Fri Jan 06, 2012 5:08 pm    Post subject:  

After you add a virtual host to handle the raw IP as @obs said, consider setting up a 301 redirect to the website that was indexed by Google. (You can do this in the virtual host config, or just add an .htaccess file.) After a while, Google will pick up the 301 and start indexing the proper domain. This way, your search rating won't be negatively affected while the transition is taking place, and anyone who may have bookmarked the IP address will also be able to go to your real site.
Back to top  
shodan_uk



Joined: 26 Sep 2010
Posts: 20
Location: Southampton, UK

Posted: Fri Jan 06, 2012 6:36 pm    Post subject:  

Thanks for the advice guys, renaming the vhost has worked.

The correct aspire site has already been indexed by Google and has only been up for a couple of weeks so hopefully the 301 won't be necessary.

Cheers,
Terry
Back to top  
 
       Linode Forum Index -> Linux Networking
Page 1 of 1