|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Redirect by Availability
Is there a way to redirect visitors to a site to different servers based upon whether or not those servers are up? In other words, I'd like for this to happen:
1) Visitor goes to www.mydomain.com 2) They are directed to server1.mydomain.com if that server is up 3) They are directed to server2.mydomain.com if server1.mydomain.com is down. I'm sure there is a way to do this in PHP or Perl but I'm unsure how to go about accomplishing this goal. Any ideas? |
|
#2
|
|||
|
|||
|
What you could do is have a test page on each server that you know what the content should be. Use a script as the default page on mydomain.com. This script will get the test page from server1.mydomain.com. If it gets the expected content back, redirect to that server. Otherwise, redirect to server1.mydomain.com.
For example, in Perl you could use LWP::Simple to get the web page and test to see if you actually are able to get that web page.
__________________
. |
|
#3
|
||||
|
||||
|
It's called load balancing. You can either purchase a hardware load balancer or use your OS to do it for you. For more info on how to load balance using your favourite OS, google for "load balancing <name_of_your_os>"
Hope this helps. ![]() |
| Viewing: Dev Shed Forums > Other > Dev Shed Lounge > Redirect by Availability |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|