Solved

How to make a maintenance page during the outage?

Posted on 2012-03-26
9
618 Views
Last Modified: 2013-12-02
During the mainteance, upgrades, and outages.  How to point users to the page shows 'Sorry the system is on maintenance, please be patient'
What's the way to do that? Do I need to redirect via DNS that takes hours to propagate and back?  I never done that before. Please advise.
Thanks.
0
Comment
Question by:Tiras25
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
  • +1
9 Comments
 
LVL 110

Accepted Solution

by:
Ray Paseur earned 200 total points
ID: 37771036
No, DNS propagation is not the way to go.  Presumably you have a common script that is used to start every web page.  (If you do not, this is the right time to set it up.)  That script is the place to put information about maintenance.  Here is an example using the PHP scripting language; the same principles apply to other languages, too.

Every script on the site starts with this
<?php require_once('common.php');

Open in new window

Then when you are ready to perform maintenance, you flip on a maintenance switch that redirects the client browser like this
<?php // common.php
error_reporting(E_ALL);


// DEMONSTRATE HOW TO REDIRECT EVERYTHING TO THE MAINTENANCE SCRIPT


// THE NORMAL SETTING
$maintenance=FALSE;

// THE DEMONSTRATION SETTING
// $maintenance=TRUE;

// IF MAINTENANCE IS IN PLAY
if ($maintenance)
{
    // CONSTRUCT THE URL WE WANT
    $my_uri
    = '/maintenance.html'
    . '?'
    . $_SERVER["QUERY_STRING"]
    ;

    // BAIL OUT WITH AUTOMATIC 302 AND LOCATION
    header("Location: $my_uri");
    exit;
}

// MAINTENANCE IS NOT IN PLAY - START THE NORMAL SCRIPTS HERE

Open in new window

And just for demonstration purposes, here is a page that will get loaded if the maintenance is underway
<h1>Maintenance</h1>

Open in new window

You may need to generate a 302 header yourself; if you are using PHP the 302 header is generated automatically by header("Location").

HTH, ~Ray
0
 
LVL 110

Assisted Solution

by:Ray Paseur
Ray Paseur earned 200 total points
ID: 37771047
0
 
LVL 16

Assisted Solution

by:Rose Babu
Rose Babu earned 100 total points
ID: 37771051
use App_Offline.htm file with some maintenance content/design in your website root.

it will restrict all access to the website.

after you have updated your files then you can delete this file.

http://weblogs.asp.net/scottgu/archive/2005/10/06/426755.aspx

Try this.
0
Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

 
LVL 17

Author Comment

by:Tiras25
ID: 37772323
We are using a Tomcat.  Are these instruction applicable to any environment?
0
 
LVL 27

Assisted Solution

by:mrcoffee365
mrcoffee365 earned 200 total points
ID: 37834416
It depends a lot on your physical as well as network setup.

You're right, pointing DNS to a different machine is one way to go.  

If this is scheduled maintenance and you want to change the DNS pointer to a different machine, about 24 hours before the maintenance change your time-to-live on the DNS entry to a very small amount -- 15 minutes can be good.  On the maintenance day, 30 minutes before the downtime, change the time-to-live to 1 minute.  At downtime, change your DNS to point to a different IP address, where there's a simple web server configured to respond with a single page.  Change DNS time-to-live back to whatever the normal amount is after your maintenance is over and you are returning to your normal IP address.

If you are not taking down the whole machine, and it's okay for it to still serve pages, then you can have a small Tomcat or Apache instance which you switch on for maintenance.  It just has one page, which says you're down for maintenance.

A lot of companies have a router which they can change to point to a different machine internally when a request from outside comes in for the Web server IP address.  The different machine can have a small Web server and simple maintenance page.  Externally you don't change DNS entries -- you don't change anything externally.  If you can do it, this is a fast way to handle maintenance.

Some people have a maintenance webapp under Tomcat.  In that case, Tomcat is still running, but the webapp you don't want running doesn't answer on 80 any more.  Usually that means changing server.xml, then stopping and starting Tomcat.

It all depends on your physical and network layout and what you find easiest.

Ray Paseur's first answer was most similar to my last one for Tomcat.  In his answer, the web server had to still be running and answering on the IP address, and the main PHP app had to be switched out for the maintenance one.
0
 
LVL 17

Author Comment

by:Tiras25
ID: 38273999
I read your solutions again.
Which of these solutions still work if the entire environment is in maintenance? #1 I guess is technically feasible. The TTL solution I guess works but seems messy.
0
 
LVL 27

Assisted Solution

by:mrcoffee365
mrcoffee365 earned 200 total points
ID: 38278623
Have you actually tried any of these?  Why don't you test a few of the solutions and see if they do what you want.  You can ask questions about them if you have more questions.

>>Which of these solutions still work if the entire environment is in maintenance?
It depends, of course, on what you consider your entire environment.  Try asking a specific question and perhaps we can help.  Or as I mentioned above, try some of these and see if they do what you want.
0

Featured Post

Free eBook: Backup on AWS

Everything you need to know about backup and disaster recovery with AWS, for FREE!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Lease-to-own eliminates the expenditure of hardware replacement and allows you to pay off the server over time. Usually, this is much cheaper than leasing servers. Think of lease-to-own as credit without interest.
When it comes to security, close monitoring is a must. According to WhiteHat Security annual report, a substantial number of all web applications are vulnerable always. Monitis offers a new product - fully-featured Website security monitoring and pr…
The viewer will learn how to count occurrences of each item in an array.
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…

690 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question