2

I am reinstalling my server and I have 3 domain names that are registered via. godaddy.com. I have a VPS and I am goin to reinstall cPanel on it tonight but I wanted to know how I can put a temporary "Our site is Currently Offline" message upon enter while I do so.

3 Answers 3

2

without another element between you users and your website (a reverse proxy), you probably won't find a suitable solution.

What we typically do is temporarily switch rules on our proxy to redirect to another web host with the maint page on it.

2

Point the DNS for those services to another server for the duration of the upgrade. Prior to the upgrade, reduce the TTLs on the DNS records to something short.

4
  • I'm also interested in a solution for this problem. Do (most) caching nameservers really respect the short TTL? If not, I'm afraid, this would risk a longer downtime. Aug 18, 2010 at 10:55
  • 1
    At this point so many things use tiny TTLs that I think it is a solved problem. Services like akamai seem to use a chain of 3 cnames, each with a 20-30 second TTL. www.apple.com, for instance, has the following cname chain: www.apple.com c -> ttl:1600 www.isg-apple.com.akadns.net. c -> ttl:30 www.apple.com.edgekey.net. c -> ttl:4096 e3191.c.akamaiedge.net. a -> ttl30 184.85.29.15
    – chris
    Aug 18, 2010 at 14:53
  • So, yes, caching the wrong data may cause problems with weird clients that don't respect TTLs but I think those are getting rarer and rarer because so many things on the internet rely on short TTLs to properly deliver their dynamic (and interesting) content.
    – chris
    Aug 18, 2010 at 14:54
  • Thanks - in that case, it's probably the best solution for the problem (i.e. if there's no reverse proxy). Aug 20, 2010 at 12:47
1

you can use a mod_rewrite rule in the apache configuration and do a 302 (or temporary redirect) Make sure it's 302 and not 301 so google doesn't start thinking the page has permanently moved...

something like...

RewriteEngine On
RewriteCond %{REQUEST_URI} ^/.*$ [nc]
RewriteRule    (.*)  http://www.yoursite.com/maint.php [L,R=302]
1
  • 1
    assuming he will be re-installing cpanel apache may not be available at some point which would make the domains unavailable at some point.
    – Prix
    Aug 17, 2010 at 22:33

You must log in to answer this question.