

How to Gracefully Take a Site Down For Maintenance? - edgeztv

YouTube and others are putting up a nice looking message page while they are doing a release or maintenance.  I'm wondering what's the best way of redirecting all requests to this "Sorry we're temporarily down" page.<p>Would you modify the VirtualHost entry in Apache's httpd.conf?<p>Would you change the DNS entry?<p>Any other ideas?<p>The technique should ideally be easy to turn on and off.
======
drusenko
Have a backup directory ready to go, and modify the DocumentRoot on your
virtual host.

If your home page doesn't involve dynamic content (and even if it does, but
you aren't touching those parts of it), keep your home page up.

If you aren't taking down your DB, keep the user sign-up up.

When someone tries to log-in, then display the message.

Keep your roll-out window to under 30 mins if at all possible (rolling out
features in smaller batches makes this easier).

------
staunch
Whatever you do, don't try redirecting using DNS. Many DNS servers don't
properly respect TTLs and this will cause you endless pain.

------
tocomment
For smaller sites, I would just redirect everyone but my own IP address over
to a maint.html page.

I wrote up how I did it with .htaccess here:
[http://www.answermysearches.com/htaccess-block-everyone-
exce...](http://www.answermysearches.com/htaccess-block-everyone-except-one-
ip-address/226/)

~~~
BrandonM
Good thing it's impossible to spoof an IP address. Then again, as long as
you're only relying on this for customer service and not for security, I
suppose you're fine.

~~~
tocomment
How do you spoof an IP address?

~~~
BrandonM
[http://www.google.com/search?q=how+to+spoof+ip+address&i...](http://www.google.com/search?q=how+to+spoof+ip+address&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-
US:official&client=firefox-a)

------
patrickg-zill
Why do you need to take the site down to do maintenance? Even if moving
physically from one server to another you should be able to migrate with
almost zero downtime.

