LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 05-22-2011, 10:43 PM   #1
kitek
Member
 
Registered: Apr 2005
Posts: 252

Rep: Reputation: 15
Web Server server down but I want to display a page.


Is there a way to configure dns somehow that if a web server goes down that is hosting sites to make it hit another server or something to display a page that it is offline for maintenance or something instead of a page not display since that particular server is down? Maybe like round robin or something. I have never used round robin myself.
 
Old 05-23-2011, 12:19 AM   #2
raskin
Senior Member
 
Registered: Sep 2005
Location: France
Distribution: approximately NixOS (http://nixos.org)
Posts: 1,900

Rep: Reputation: 69
You can have multiple A (or AAAA) records for the same domain name. Note that you will need as many IP addresses (which is becoming a scarce resource for IPv4). Most likely behaviour is that they will be given out in random order (so, effectively one will be selected at random for use by client).

If you have multiple servers serving the same content, this will reduce the percentage of clients connecting to a broken one (and give a small - small because of DNS caching - chance that they will have better luck after reload).

In general, unless you implement special measures to inform DNS server that your web server is down there is always a chance that client will use the IP of a broken server and get an error.

Maybe you can use some reverse-proxy like Nginx: it is quite reliable, so if your web server with a heavy application on it goes down because of an obscure programming error, Ngnix (separate lightweight webserver that you configured to forward requests to your real server and forward replies to clients) will stay up and show preconfigured error page. It is said that Nginx by itself is most often seen on the net when the servers behind it give in to DoS attacks, which is a good compliment to it. Of course, there is also Lighttpd and you can configure Squid for the same effect.
By the way, well-configured Nginx can even serve some part of your site (static pages) when main server is down.
 
Old 05-23-2011, 12:30 AM   #3
kitek
Member
 
Registered: Apr 2005
Posts: 252

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by raskin View Post
You can have multiple A (or AAAA) records for the same domain name. Note that you will need as many IP addresses (which is becoming a scarce resource for IPv4). Most likely behaviour is that they will be given out in random order (so, effectively one will be selected at random for use by client).

If you have multiple servers serving the same content, this will reduce the percentage of clients connecting to a broken one (and give a small - small because of DNS caching - chance that they will have better luck after reload).

In general, unless you implement special measures to inform DNS server that your web server is down there is always a chance that client will use the IP of a broken server and get an error.

Maybe you can use some reverse-proxy like Nginx: it is quite reliable, so if your web server with a heavy application on it goes down because of an obscure programming error, Ngnix (separate lightweight webserver that you configured to forward requests to your real server and forward replies to clients) will stay up and show preconfigured error page. It is said that Nginx by itself is most often seen on the net when the servers behind it give in to DoS attacks, which is a good compliment to it. Of course, there is also Lighttpd and you can configure Squid for the same effect.
By the way, well-configured Nginx can even serve some part of your site (static pages) when main server is down.
I will have to look into that Nginx. I haven't heard of it. I also haven't toyed with squid much. The good thing about the DNS server is that I have 4 off them and I have 16 IP's with a couple left over. I did think of the multiple A records, but like you said, how would you set one like a priority one of choose one first then fail over to the other? So if the whole server is taken offline say for instance I took it out of the rack to blow all the dust out of it and all that, there just going to get a page can't be found or server can't be found error. /shrug
 
Old 05-23-2011, 12:36 AM   #4
raskin
Senior Member
 
Registered: Sep 2005
Location: France
Distribution: approximately NixOS (http://nixos.org)
Posts: 1,900

Rep: Reputation: 69
You cannot set DNS priorities and even if you could no client will go beyond trying one IP.

Reverse proxying is simple if you can spare some minimal resources on it.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Cant make web server run my local web page... Nik0s Linux - Newbie 22 10-08-2006 10:30 PM
vmware server mui - no web page Storm16 Linux - Software 0 09-09-2006 01:12 AM
shutdown linux from server's web page satish Linux - Networking 1 03-04-2006 12:39 AM
Setting up a web server for a single page? DrDoug Linux - Newbie 1 10-17-2004 11:21 AM
Sysinfo link on web server main page hrp2171 Slackware 0 10-13-2004 05:10 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 04:29 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration