Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

We've got one server running our company's website. Unfortunately, it sometimes experiences problems. Is there a way to set up another server to serve the static websites, in case the original server doesn't respond to pings?

share|improve this question
    
Are you setting this up at the same IP address? –  Kenzo Jan 22 '13 at 8:37
    
@Kenzo No, at a distinct server at a distinct IP. –  Anna Jan 22 '13 at 8:43
add comment

3 Answers 3

You will need to setup a load balancer after setting up another server. You can setup software based load balancer with apache's mod_proxy_balancer, buy a dedicate load balancer, or consult your webhosting company/data center for load balancer service.

share|improve this answer
add comment

There are multiple solutions to this. The key decision is how much downtime can you tolerate.

DNS-Based Approaches

There are DNS services (such as DNS Made Easy) that do DNS fail-over. If they detect a server is down, they will change your DNS record to point to the other location.

Pros: Simple to setup. Just replicate files between the two locations with something like rsync/ftp.

Cons: Even with short TTLs values in DNS, there will always be a lag.

CDN/Caching Approaches

This is a good short-term fix. Many web site acceleration & CDN providers (Cloudflare, Yotta) allow you to set a cache period for when the backend is not available. They will serve up a cached version of the site while you fix the problem. Retention usually varies from minutes to days depending on the plan and vendor.

Pros: Easy to setup and avoids DNS issues. May also speed up your site.

Cons: Can be costly if you have high bandwidth. Still requires you to fix the backend quickly.

Load Balancing/High Availability Solutions

There are multiple approaches to this but generally this involves a load balancer and one ore more servers.

Pros: Can be fully automated to provide 99.9% and above. Instant fail over in most cases.

Cons: Cost and complexity depending on setup.

IP Mapping

This is a newer approach I've recommend to some businesses. Some providers such as SoftLayer & Amazon Web Services can assign you a IP ranges that can be re-mapped to alternate locations. The strategy is to setup the site in two locations and then re-map your IP when needed.

Pros: Simple setup for simple sites and little lag time for failures.

Cons: Limited provider choice.

share|improve this answer
add comment

Assumption: Backup site serving static pages is hosted on different server.

You can handle this at DNS Zone level itself, by adding two SRV records as

_http._tcp.example.com 86400 IN SRV 10 0 5060 httpserver.example.com.

_http._tcp.example.com 86400 IN SRV 20 0 5060 backupbox.example.com.

When server with priority 10 is unavailable, the record with next highest priority value will be chosen, which is backupbox.example.com. Please note, The weight value is relevant only in relation to other weight values for the service, and only among records with the same priority value.

Further, ensure that the target in SRV records must point to hostname with an address record (A or AAAA record).

A detailed explanation could be found here.

share|improve this answer
1  
SRV is not an option for HTTP/HTTPS as browsers are competing for speed, and many other reasons. code.google.com/p/chromium/issues/detail?id=22423 –  neo Jan 22 '13 at 14:48
1  
As @neo has said. SRV is not widely supported and would not recommend it -- especially with the proliferation of mobile browsers. –  jeffatrackaid Jan 22 '13 at 15:34
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.