2

I'd like to implement a "Website under maintenance" page on a Sitecore powered website, where CMS editors can switch on/off the maintenance mode. During the maintenance mode all requests are forwarded to the maintenance page. A solution with app_offline.htm in website root would be ok, however the problem is that website is load-balanced.

What is the best practice to implement what I want on load balanced websites, and specifically for Sitecore CMS?

lekso
  • 1,731
  • 3
  • 24
  • 46

3 Answers3

7

In any load-balanced environment you should avoid having this app_offline.html page as a part of your website. Please remember that if you are deploying new code the site may encounter some exceptions or config problems and even your plain html maintenance page won't be accessible.

You should rather think about having a app_offline page redirection set directly on the load balancer. In this case you need to set it only in one place and you don't need to worry about your site being unavailable. Of course you will not be able to manage this page from Sitecore in this case.

And the best solution in the load-balanced environment is not to have app_offline.html page at all. When you're doing any maintenance, you're performing it on one (of half) of the load-balanced servers at the time. The other servers should serve the responses to users' request in the meantime. And when you're ready with maintenance on one server, you put it back to load-balancer and start maintenance of the other servers (taking them out from the load-balancer before making any updates on them).

Marek Musielak
  • 26,832
  • 8
  • 72
  • 80
  • 1
    This is traditional method I have used however you have to be a little careful, there is a small window between updating CM+CD1 and publishing changes that CD2 is out of sync, depending on number of SC items. I've often had a static website in IIS what we would switch to to serve requests in those few minutes. – jammykam Sep 24 '13 at 17:07
2

You can create httpmodule that reads some setting that CMS editor can turn on/off inside sitecore, if the setting is turned off, you redirct to your custom maintainace page. Make sure that you dont redirect any http request coming from sitecore desktop, by checking logged in user domain.

Ahmed Okour
  • 2,392
  • 1
  • 16
  • 31
  • 1
    Thanks, I though about this option and probably will have to implement it. The redirect can be done in Sitecore with HttpRequestProcessor pipeline. – lekso Sep 24 '13 at 11:57
  • HttpRequestProcessor pipeline is the way to go, don't know why i didn't thought of that – Ahmed Okour Sep 24 '13 at 16:28
1

I used this article when I first started working with a CM to CD load balanced environment: http://csuwannarat.wordpress.com/2011/12/20/sitecore-deployment-process-in-load-balanced-production-environment/

Hopefully this helps you too.

Kyle Heon
  • 412
  • 3
  • 6