Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've set up Apache to send requests to to an a webcam accessible via an IP address not associated with the server Apache's running on, using ProxyPass:

[camera] -- [nat / prt frwrd] -- []-- [internets] -- [webserver]

Relevant entry in the Apache's virtual host directive for the '':

<VirtualHost *>
  ProxyRequests Off
  ProxyPass /
  ProxyPassReverse /

Works like a charm, however, the camera is not always turned on. In that case, instead of having Apache serve a 'not found' error upon visiting my camera , I'd like it to serve an alternative web page.

Would it be possible to set some sort of 'fall-back' address in case the first one (the camera's) is not available?

share|improve this question
up vote 7 down vote accepted

you can use load balancing capability of apache, it has automatic failover built-in as well.

your config would look as follows:

ProxyPass / balancer://hotcluster/
<Proxy balancer://hotcluster>
 BalancerMember timeout=15 retry=300
 BalancerMember http://address.of.backup.server status=+H

you just mark backup-server with +H - hot standby. as long as camera answers [ in timeout sec ] - traffic is sent to it; if it does not - apache starts sending traffic to the backup machine, and will check camera every retry seconds.

share|improve this answer
Awesome! Exactly what I was looking for. Thanks. – klokop Dec 24 '09 at 18:49

If this is a public IP address, certain DNS providers will ping your IP address, and failover to a backup IP address if it is not available. We use for this.

One thing to be aware of however, is that it may only check every 5 minutes or so, so failover and failback are not instantaneous.

share|improve this answer

Your Answer


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.