Page 1 of 2

Domain redirect to Backup server if main server is down?

Posted: Fri May 01, 2009 8:13 am
by jaoudestudios
Is it possible to have a domain redirect to another server (backup) if the main server can not be found (down)?

If so, how? and where? on the domain?

Cheers

Re: Domain redirect to Backup server if main server is down?

Posted: Fri May 01, 2009 9:01 am
by Eran
The main way I know of to implement this is by clustering your servers. Linux-HA and Heartbeat are the way to go if you are using Linux. http://www.linux-ha.org/HomePage

Re: Domain redirect to Backup server if main server is down?

Posted: Fri May 01, 2009 9:10 am
by jaoudestudios
Yep using linux.

Was not thinking of heart beat, but thinking more for, if I want to do some major maintence to the production server, then I could switch on the backup machine and turn off apache on the production while I do maintence (i.e. reboots and stuff).

Did not want the backup machine on all the time, only when I need too.

Re: Domain redirect to Backup server if main server is down?

Posted: Fri May 01, 2009 9:15 am
by Eran
Ah, I see :) I thought you wanted a fail-over system
Do you have a dedicated server? if so you could run virtualized apache instances on it and switch the routing between them when you take one offline.

Re: Domain redirect to Backup server if main server is down?

Posted: Fri May 01, 2009 9:25 am
by jaoudestudios
Yep I have a dedicated server.

But I still think I explained myself badly. When I run maintence on the production server I want to take it offline completely and have the websites run on a similar server at home.

Re: Domain redirect to Backup server if main server is down?

Posted: Fri May 01, 2009 9:31 am
by Eran
I'm guess I over complicated it then :)
You can add your home server as an alternative name server for the domain (where you registered it). When your server is down it will go to second server to resolve the domain (there you can route it to wherever you'd like)

Re: Domain redirect to Backup server if main server is down?

Posted: Fri May 01, 2009 9:35 am
by jaoudestudios
That sounds easier :)

Do I have to setup a nameserver on my local machine?

Re: Domain redirect to Backup server if main server is down?

Posted: Fri May 01, 2009 10:01 am
by Eran
If you are running linux on it it should already be installed (BIND ships with most distributions). You just need to setup the domain-name to ip matching I think. Probably Vladsun has more input on this

Re: Domain redirect to Backup server if main server is down?

Posted: Fri May 01, 2009 11:23 am
by jaoudestudios
Cool. I will have a play.

Might need some more help though :?

Re: Domain redirect to Backup server if main server is down?

Posted: Fri May 01, 2009 11:34 am
by jaoudestudios
You just need to setup the domain-name to ip matching I think
How do I do that?

Re: Domain redirect to Backup server if main server is down?

Posted: Fri May 01, 2009 11:46 am
by Eran

Re: Domain redirect to Backup server if main server is down?

Posted: Fri May 01, 2009 12:12 pm
by jaoudestudios
Thanks, I am having a read.

Installing Fedora10 now and hopefully set up the local failover server today/tomorrow.

I have done a lot of maintenance on my production server and it needs a reboot, but there is a chance it wont turn back on :cry: and i cant afford for it to be down. This is not ideal, but at least the websites will still be live even if it is local - if I manage to get it all working.

Re: Domain redirect to Backup server if main server is down?

Posted: Sat May 02, 2009 1:20 pm
by jaoudestudios
Ok, server is pretty much setup with IPs, websites, databases.

But I just realised something, but correct me if I am wrong. If my production server is down but its nameservers are fine (different server), users will see an error message (page cannot be displayed or something to that effect). They would only be redirected to my local machine by the secondary nameserver if the primary nameserver is down? If this is the case, it is not what I was trying to achieve, I was trying to...if my production server is down, go to the backup server.

Re: Domain redirect to Backup server if main server is down?

Posted: Sat May 02, 2009 1:30 pm
by John Cartwright
I believe if your primary nameservers do not succesfully make the connection, by default, it will use the secondary.

Wheres Vlad? :)

Re: Domain redirect to Backup server if main server is down?

Posted: Sat May 02, 2009 2:17 pm
by jaoudestudios
So I could simulate this by blocking port 80 (firewall) on the production box?