I was working on a ASP.NET application lastnight and noticed when I published it up to my server (i was RDP’ed into it at the same time) I noticed a file got created named app_offline.htm in the root of the site, certainly not something in my application. When i then browsed to the application (Whilst Visual Studio was still publishing it) i got a really nice message saying the application was offline….so i did some digging.
Turns out app_offline.htm was introduced in the .NET 2.0 framework and the second one is found in an IIS application folder then the application is unloaded and SQL connections are dropped…pretty damn handy if you ask me! So being powered by BlueDragon.NET these days i thought i’d see if it worked in a CF app (no reason why it wouldn’t since afterall it bd.NET!) and sure enough it works….! What’s more the app_offline.htm can be made pretty so it’s not just a plain error message but can follow the look and feel of your website whilst maintenance is being performed!
February 20th, 2006 at 6:05 am
Hi John, is this just for BD or will it work under a normal CF installation?
February 20th, 2006 at 9:06 am
just BD(.Net) I’m afraid, CF (Adobe) does not require/need application pools to be defined in IIS if .cfm/.cfc is mapped at a global level.
You could mimmick something similar by creating an app_offline.htm file and then redirecting all traffic in the virtual server to app_offline.htm but it’s a manual process, although something which possibly ANT could help with.
December 16th, 2006 at 3:49 am
In just about every app I have written is an admin function for setting the application into MAINT_MODE.
It is simply a boolean value stored in the DB of the app and stored as an application variable within the app.
Much like just about everyone does
<cfif session.logged_in EQ ‘true’> at the start of all templates I have an extra
<cfif application.maint_mode EQ ‘true’>
<cflocation "maint-mode template….">
Not as automatic as having Visual Studio do it for you.
But for tall the non BD.NET users out there a handy alternative.
A note for young-players… make sure you use a DB - so as to protect Maint_mode concurrency even after server restartes / power outtages.