Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question

3 Answers 3

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]
share|improve this answer
    
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 '10 at 22:33

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.

share|improve this answer

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.

share|improve this answer
    
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. –  Chris Lercher Aug 18 '10 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 '10 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 '10 at 14:54
    
Thanks - in that case, it's probably the best solution for the problem (i.e. if there's no reverse proxy). –  Chris Lercher Aug 20 '10 at 12:47

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.