Domain redirect to Backup server if main server is down?

Whether you are using Linux on the desktop or as a server, it's still good that you're using Linux. Linux related questions go here.

Moderator: General Moderators

User avatar
jaoudestudios
DevNet Resident
Posts: 1483
Joined: Wed Jun 18, 2008 8:32 am
Location: Surrey

Domain redirect to Backup server if main server is down?

Post 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
User avatar
Eran
DevNet Master
Posts: 3549
Joined: Fri Jan 18, 2008 12:36 am
Location: Israel, ME

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

Post 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
User avatar
jaoudestudios
DevNet Resident
Posts: 1483
Joined: Wed Jun 18, 2008 8:32 am
Location: Surrey

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

Post 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.
User avatar
Eran
DevNet Master
Posts: 3549
Joined: Fri Jan 18, 2008 12:36 am
Location: Israel, ME

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

Post 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.
User avatar
jaoudestudios
DevNet Resident
Posts: 1483
Joined: Wed Jun 18, 2008 8:32 am
Location: Surrey

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

Post 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.
User avatar
Eran
DevNet Master
Posts: 3549
Joined: Fri Jan 18, 2008 12:36 am
Location: Israel, ME

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

Post 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)
User avatar
jaoudestudios
DevNet Resident
Posts: 1483
Joined: Wed Jun 18, 2008 8:32 am
Location: Surrey

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

Post by jaoudestudios »

That sounds easier :)

Do I have to setup a nameserver on my local machine?
User avatar
Eran
DevNet Master
Posts: 3549
Joined: Fri Jan 18, 2008 12:36 am
Location: Israel, ME

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

Post 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
User avatar
jaoudestudios
DevNet Resident
Posts: 1483
Joined: Wed Jun 18, 2008 8:32 am
Location: Surrey

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

Post by jaoudestudios »

Cool. I will have a play.

Might need some more help though :?
User avatar
jaoudestudios
DevNet Resident
Posts: 1483
Joined: Wed Jun 18, 2008 8:32 am
Location: Surrey

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

Post by jaoudestudios »

You just need to setup the domain-name to ip matching I think
How do I do that?
User avatar
Eran
DevNet Master
Posts: 3549
Joined: Fri Jan 18, 2008 12:36 am
Location: Israel, ME

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

Post by Eran »

User avatar
jaoudestudios
DevNet Resident
Posts: 1483
Joined: Wed Jun 18, 2008 8:32 am
Location: Surrey

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

Post 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.
User avatar
jaoudestudios
DevNet Resident
Posts: 1483
Joined: Wed Jun 18, 2008 8:32 am
Location: Surrey

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

Post 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.
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

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

Post by John Cartwright »

I believe if your primary nameservers do not succesfully make the connection, by default, it will use the secondary.

Wheres Vlad? :)
User avatar
jaoudestudios
DevNet Resident
Posts: 1483
Joined: Wed Jun 18, 2008 8:32 am
Location: Surrey

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

Post by jaoudestudios »

So I could simulate this by blocking port 80 (firewall) on the production box?
Post Reply