Solved

How to make a maintenance page during the outage?

Posted on 2012-03-26
9
609 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
  • 2
  • 2
  • 2
  • +1
9 Comments
 
LVL 108

Accepted Solution

by:
Ray Paseur earned 200 total points
Comment Utility
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 108

Assisted Solution

by:Ray Paseur
Ray Paseur earned 200 total points
Comment Utility
0
 
LVL 16

Assisted Solution

by:Rose Babu
Rose Babu earned 100 total points
Comment Utility
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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 17

Author Comment

by:Tiras25
Comment Utility
We are using a Tomcat.  Are these instruction applicable to any environment?
0
 
LVL 26

Assisted Solution

by:mrcoffee365
mrcoffee365 earned 200 total points
Comment Utility
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
Comment Utility
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 26

Assisted Solution

by:mrcoffee365
mrcoffee365 earned 200 total points
Comment Utility
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 book by J.Peter Bruzzese, Microsoft MVP

Are you using Office 365? Trying to set up email signatures but you’re struggling with transport rules and connectors? Let renowned Microsoft MVP J.Peter Bruzzese show you how in this exclusive e-book on Office 365 email signatures. Better yet, it’s free!

Join & Write a Comment

Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
This tutorial will give a an overview on how to deploy remote agents in Backup Exec 2012 to new servers. Click on the Backup Exec button in the upper left corner. From here, are global settings for the application such as connecting to a remote Back…
This tutorial will walk an individual through configuring a drive on a Windows Server 2008 to perform shadow copies in order to quickly recover deleted files and folders. Click on Start and then select Computer to view the available drives on the se…

763 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now