?
Solved

How to make a maintenance page during the outage?

Posted on 2012-03-26
9
Medium Priority
?
621 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 111

Accepted Solution

by:
Ray Paseur earned 800 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 111

Assisted Solution

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

Assisted Solution

by:Rose Babu
Rose Babu earned 400 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
Get MySQL database support online, now!

At Percona’s web store you can order your MySQL database support needs in minutes. No hassles, no fuss, just pick and click. Pay online with a credit card.

 
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 800 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 800 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

Are You Using the Best Web Development Editor?

The worlds of web hosting and web development are constantly evolving. Every year we see design trends change, coding standards adapt and new frameworks/CMS created. With such a quick pace of change it’s easy to get lost trying to keep up.

See if your editor made the list.

Question has a verified solution.

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

Originally, this post was published on Monitis Blog, you can check it here . It goes without saying that technology has transformed society and the very nature of how we live, work, and communicate in ways that would’ve been incomprehensible 5 ye…
Dramatic changes are revolutionizing how we build and use technology. Every company is automating, digitizing, and modernizing operations. We need a better, more connected way to work together as teams so we can harness the insights from our system…
This tutorial will walk an individual through setting the global and backup job media overwrite and protection periods in Backup Exec 2012. Log onto the Backup Exec Central Administration Server. Examine the services. If all or most of them are stop…
The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.
Suggested Courses

770 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