Re: [PHP] check server status...please help

2005-01-27 Thread Tom
Sarcasm was also my first thought on this one, then I thought I'd tell 
the world how I handle it !

For one of my sites there are two solutions implemented to two 
situations (that's two solutions in total, not four :)).

1) User is already in site, and makes another request.
Load up a very small js with the site. When the request times out, this 
script either pops an error message or redirects the requests to the 
failover.

2) User is trying to get to the site for the first time.
The domain is actually pointed to a GSLOB (load balancer). This 
continually polls both primary and secondary (and tertiary...) sites and 
directs traffic to whichever has the lowest load, or to whichever site 
the rules are set to.
This is of course a more expensive solution that may not be at all 
applicable in your instance (expense is the purchase and hosting of the 
load balancer hardware).

Tom
Jay Blanchard wrote:
[snip]
I want to write a script that will check if the server is down if it is
I 
want to redirect the user to another site, the backup server.

Similarly I want users who go on to the seondary site when the main
server 
is UP to be redirected to the main site.

Can this be done using PHP. If not can you point me in the right
direction?
Kind regards,
[/snip]
So I'm on this server at this URL right? And the HTTP server is down,
right? The script would have to be aware of an HTTP request, right? 

Let us say I am on http://foo.com and I click a link or enter an address
for http://bar.com . If the server is down that is hosting
http://bar.com  well, I think you see where I am going.
Now, you could requests to port 80 maybe. And PHP CLI could be set in a
loop to handle the request, but this may be a really bad plan. You would
probably want some sort of port sniffer to monitor the port for
activity.
 

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] check server status...please help

2005-01-26 Thread Marek
> I want to write a script that will check if the server is down if it is I
> want to redirect the user to another site, the backup server.
>
> Similarly I want users who go on to the seondary site when the main server
> is UP to be redirected to the main site.
>
> Can this be done using PHP. If not can you point me in the right
direction?
PHP can help you if you have multiple sql servers... but for true site
redundancy php alone can not do what you ask.

Some things to look at CISCO CSS, excellent for load balancer and many other
things.
However if you are concerned about the Internet connection being down to
your server, well, that topic has been around for ages.
The most simple one:
two networks, one dns server on each network pointing to ips on the network.


> Kind regards,
>
>
> Ross Hulford
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] check server status...please help

2005-01-26 Thread John Nichel
Ross Hulford wrote:
I want to write a script that will check if the server is down if it is I 
want to redirect the user to another site, the backup server.
If I go to http://www.yoursite.com and yoursite.com is down, how is it 
going to redirect me somewhere else?

--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] check server status...please help

2005-01-26 Thread Jay Blanchard
[snip]
I want to write a script that will check if the server is down if it is
I 
want to redirect the user to another site, the backup server.

Similarly I want users who go on to the seondary site when the main
server 
is UP to be redirected to the main site.

Can this be done using PHP. If not can you point me in the right
direction?

Kind regards,
[/snip]

So I'm on this server at this URL right? And the HTTP server is down,
right? The script would have to be aware of an HTTP request, right? 

Let us say I am on http://foo.com and I click a link or enter an address
for http://bar.com . If the server is down that is hosting
http://bar.com  well, I think you see where I am going.

Now, you could requests to port 80 maybe. And PHP CLI could be set in a
loop to handle the request, but this may be a really bad plan. You would
probably want some sort of port sniffer to monitor the port for
activity.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php