Linux - Server This forum is for the discussion of Linux Software used in a server related context. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
05-22-2011, 10:43 PM
|
#1
|
Member
Registered: Apr 2005
Posts: 252
Rep:
|
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.
|
|
|
05-23-2011, 12:19 AM
|
#2
|
Senior Member
Registered: Sep 2005
Location: France
Distribution: approximately NixOS (http://nixos.org)
Posts: 1,900
Rep:
|
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.
|
|
|
05-23-2011, 12:30 AM
|
#3
|
Member
Registered: Apr 2005
Posts: 252
Original Poster
Rep:
|
Quote:
Originally Posted by raskin
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
|
|
|
05-23-2011, 12:36 AM
|
#4
|
Senior Member
Registered: Sep 2005
Location: France
Distribution: approximately NixOS (http://nixos.org)
Posts: 1,900
Rep:
|
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.
|
|
|
All times are GMT -5. The time now is 02:27 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|