TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

How to Gracefully Take a Site Down For Maintenance?

2 点作者 edgeztv将近 18 年前
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.

4 条评论

drusenko将近 18 年前
Have a backup directory ready to go, and modify the DocumentRoot on your virtual host. <p>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. <p>If you aren't taking down your DB, keep the user sign-up up. <p>When someone tries to log-in, then display the message. <p>Keep your roll-out window to under 30 mins if at all possible (rolling out features in smaller batches makes this easier).
staunch将近 18 年前
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将近 18 年前
For smaller sites, I would just redirect everyone but my own IP address over to a maint.html page.<p>I wrote up how I did it with .htaccess here: <a href="http://www.answermysearches.com/htaccess-block-everyone-except-one-ip-address/226/" rel="nofollow">http://www.answermysearches.com/htaccess-block-everyone-exce...</a>
评论 #33439 未加载
patrickg-zill将近 18 年前
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.