Windows Web Hosting, Web Technologies, etc
Windows Administration
Quickly backup iis metabase on a Windows Cloud Server
Dec 22nd
Recently, I was invited to give a presentation at the Orlando DotNetNuke Usersgroup around DotNetNuke website performance. The first tidbit of information I provided was that when you’re running on a Windows Cloud Server or Windows VPS Server or a Managed Windows Server, you always to make backups of your configuration before making sweeping changes. The quickest way to backup the IIS Metabase is via command line:
Backing up the IIS Configuration via Command Line:
%windir%\system32\inetsrv\appcmd.exe add backup “RUTROH”
This runs the appcmd command that allows you completely manage the IIS configuration from commandline. and create a new backup called “RutRoh” (Just like scooby doo and when you need this backup the first thing you’re going to say is .. RUT ROH!
Restoring the IIS Configuration via Command Line:
Assuming your backup is named RUTROH you’ll execute the following:
%windir%\system32\inetsrv\appcmd.exe restore backup “RUTROH”
What if you don’t know which backup you want to restore? Then you can list your backups with the command:
%windir%\system32\inetsrv\appcmd.exe list backup
and then restore the appropriate backup.
What if I didn’t make a backup of my IIS Configuration? Am I stuck?
The good news is that in Windows Server 2008 and above IIS has a configuration history and automatically checks for configuration changes every 2 minutes and stores the last 10 backups for you AUTOMATICALLY in the c:\inetpub\history folder so there’s a good chance you have a backup already anyway. To restore one of those backups you just copy the applicationhost.config file from one of the backups over the top of your existing applicationhost.config file (I always make a copy of the current applicationhost.config file before replacing it, just in case!)
If you want to learn more about this feature and even how to increase the number of histories/backups it keeps visit: http://learn.iis.net/page.aspx/129/using-iis-configuration-history
Now it’s your turn
So there you have, a quick 2 minute introduction on how to backup and restore your IIS configuration quickly and how to restore your IIS configuration even if you didn’t make a backup yourself (because IIS did it for you). If this blog article helped you, I’d love it if you left a comment and even tweeted the article.
Error running Remove-DisabledMonitoringObject in System Center Operations Manager
Sep 8th
I’ve been experimenting with SCOM for a project I’m doing. One of the things that people frequently complain about in SCOM is that when you enable a management pack those monitors are enabled for EVERY SINGLE MACHINE it discovers. Annoying right? Well turns out you can work around this. Here’s what you have to do:
- Create a group under Authoring and assign it to a new Management Pack (DO NOT USE THE Default Management Pack.. you probably know this already though.)
- Go to object discoveries and override the rules you don’t want active for servers in your group.
- Add servers to your group.
- Open the Operations Powershell Console and run the command: Remove-DisabledMonitoringObject
What this does is tells SCOM not to discover these services/monitors on this group of servers. Then we run the powershell command because it tells SCOM to remove the monitors for any objects that are now disabled because otherwise these servers were already discovered and are already being monitored.
What’s great about this method is that later if you decide you want to monitor these servers for these rules afterall, you can just move them out of your group, they’ll get discovered and then monitored!
Where the error happens
If you’re like me, you probably enabled a bunch of rules and moved a bunch of machines into that group and then ran the command and then got an error message like:
Remove-DisabledMonitoringObject : Microsoft.EnterpriseManagement.Common.Discover
taFromRuleTargetedToDeletedMonitoringObjectException: Discovery data has been re
ved from a rule targeted at a non-existent monitoring object id.
MonitoringObjectId: 4387e24c-436a-4287-4e18-c2e72c1262a0
RuleId: 3e0afe54-5b47-96e7-1da0-fd6739c81623
at Microsoft.EnterpriseManagement.DataAbstractionLayer.InstanceSpaceOperation
eleteDisabledDiscoverySources()
at Microsoft.EnterpriseManagement.ManagementGroup.DeleteDisabledMonitoringObj
s()
at Microsoft.EnterpriseManagement.OperationsManager.ClientShell.RemoveDisable
nitoringObjectCmdlet.ProcessRecord()
At line:1 char:32
+ Remove-DisabledMonitoringObject <<<<
+ CategoryInfo : InvalidOperation: (Microsoft.Enter…ingObjectCmdl
:RemoveDisabledMonitoringObjectCmdlet) [Remove-DisabledMonitoringObject], Dis
overyDataFr…ObjectException
+ FullyQualifiedErrorId : ExecutionError,Microsoft.EnterpriseManagement.Oper
ionsManager.ClientShell.RemoveDisabledMonitoringObjectCmdlet
It’s at this point you’re probably scratching your head wondering what the heck is wrong with your install? Well, don’t worry.. The problem is that you have too many items getting executed at the same time. I’m not sure if it’s too many machines, too many rules or a combination thereof, but what I do know is that to get around this error you have two options:
- Reduce the number of machines you’re adding to your group and the command will execute without error.
- Just keep running it. It is doing what it’s supposed to do so just keep running it until you get no more errors after a run.
Anyway, I wasted a ton of time on this one so I hope this post helps someone else waste less time.

Default Environment Variable Values in Microsoft Windows
Sep 3rd
Today I needed to know what the environment variable for C:\Program Files (x86)\ would be for a project I was working. I found a great table of these on Wikipedia.org at: http://en.wikipedia.org/wiki/Environment_variable#Default_Values_on_Microsoft_Windows
Here’s that table though for quick reference
JessCoburn.Com running on ARR! and that not be Pirate speak thar Matey!
Aug 9th
3 Blog posts to say “Hey I’m running on my site load balanced using ARR”. This is the third and hopefully last blog post for tonight. I posted two other posts tonight:
- Discusses the first stage of Applied Innovations Cloud Initiative.
- Discusses ARR & Load balancing.
All of this was to explain how I’m running my website currently (which I tend to test everything on first so I break it a lot but you have to break eggs to make cake, right?).
ARR or Application Request Routing is a new extension to IIS7 that allows you to turn a Windows Server (or VPS as in my case) into an Application Aware Load Balancer with such features as offloading compression and SSL encryption!
How I’m running JessCoburn.com
For the past year and a half, JessCoburn.com has (and continues to) run on a shared web hosting server that runs IIS7 on top of Windows Server 2008. My site is treated identically to how my customers sites are treated as I firmly believe in eating your own dog food (no not ALPO but using the same services you sell). The site makes use of FastCGI to run the PHP engine and backends to a shared MySQL server. All of our shared web servers connect to the SQL servers via a private dedicated gigabit network for optimal performance. In addition, I make use of expiry headers for output caching of my images and also use the wordpress plugin supercache to reduce my reliance on MySQL queries so my pages render faster. So that’s why it’s been fast, I think you’d agree that’s pretty well optimized for a Windows shared hosting website (same thing you could for as little as $8.33 a month with one of our Windows hosting accounts.. Sure it’s optimized but there’s still a problem.
What’s the problem with JessCoburn.com?
The problem is my web site runs on a single web server. This means if there’s maintenance on the box (don’t worry we do this during load traffic times) there’s still potentially downtime. This also means if my site ever gets popular enough to make the first page of DIGG or REDDIT (use those social bookmarks please) then no matter how much I optimize my site on that one web server, I could have a problem… These are the trade-offs we accept with shared hosting (today).
But what if, I could run JessCoburn.com on multiple web servers and load balance them? Yeah who’s going to go out and spend 20K to load balance his little wordpress blog (the profit margins aren’t that good you know). Well thanks to our own cloud computing initiative and the good folks on the IIS Team at Microsoft I can do just that for peanuts! Today!
My new configuration
I have a Windows 2008 VPS running IIS7 with ARR 2.0 Beta 2 on it. It’s of course running on our High Availability Managed Windows VPS Hosting Cluster. I also have JessCoburn.com still running on the shared Windows Hosting server running on IIS7 and I setup another VPS server running on top of Virtuozzo running Windows 2003 and copied the site there. Just to show that you can route requests to any kind of server. Both servers back end to the same MySQL server.
All requests for JessCoburn.com come into the ARR server and it then proxies these requests between the Shared Server and the Win2003 VPS server. In the event one of the sites crashes, is down or has problems, ARR will redirect all requests to the other server.
A little info about Application Request Routing (or ARR) in IIS7.
Aug 8th
In the 10 years I’ve been working with Windows as a web hosting platform (and the 15 or so I’ve been working with web servers period), I can confidently say that IIS7 is without question the best web server platform to date. Microsoft has been working on a plug-in for IIS called Application Request Routing (or ARR). The first version of ARR provided a suite of tools that allowed it to function as a Application Layer Load Balancer! The recently updated beta version extends that functionality and now makes it easy to turn a Windows Server running IIS7 into not only a Load Balancer but also a Reverse Proxy / Cache Server. Meaning you could potentially power a CDN using a bunch of Windows Servers.
What’s an Application Layer Load Balancer?
First I should define a load balancer. When you have a very popular website (think yahoo, Amazon, etc) you need a bunch of web servers to accept all those web requests. One server just won’t cut it. In order to keep things all tidy and in order you use a machine that controls those requests and which web server it goes to. You extend that machine and have it start monitoring your web servers and your web visitors and it can start managing those requests and directing it based on things like:
- The visitor’s browser type
- The visitor’s IP address
- The type of content being called (JPEG, MOV, HTML, ASPX, etc)
Then you get a step fancier and not only direct those requests based on the request but also on the state of the server, who’s had the most bandwidth, which server do you prefer requests to go to, which server is working hardest? etc.
Now the Layer 7 Load Balancer or Application Level Load Balancer can distribute requests based on the various application specific information. This could be a cookie for instance or information within your app itself.
NOTE: I’m not going to go into this any further you have the basic understanding of a load balancer and I’m not going to deal with NLB and layer 4 and all that fun stuff. Go Bing! it (yeah I said Bing!).
Wait aren’t load balancers expensive, complicated and require a whole other level of geek?
You bet! But they’ve gotten better and there’s a fair number of open source ones out there (in fact, I was reading earlier that wordpress.com was running on an open source one).
Well didn’t Windows Always have this?
Not really. Windows had Network Load Balancing which would allow you to run a couple servers with the same application on it. It would monitor ping on the machines and if one machine died all requests went to the other. So that was really load balancing at the machine level. This was good enough for most but what if the machine was fine but your service (perhaps IIS itself crashed?) . Then they had Clustering services. Now clustering services was service aware. Meaning if your service (perhaps IIS ) crashed on one of the machines it would failover to the other machines but it didn’t really know anything about your website’s application (perhaps an ecommerce store) so you could have a server online and the web service online but the actual application on that server failed and still be sending requests to it. So in comes those clever folks in the IIS team at Microsoft with Application Request Routing (ARR … Matey!).
Video Introduction to Application Request Routing and more info
Microsoft has a great video on ARR and it’s geared towards webhosts but does a fantastic job of showing the functionality of ARR and just how easy it is to configure and make use of. You can see that video on the IIS.net site at:
http://www.iis.net/extensions/ApplicationRequestRouting
In addition to the video they really spell out all of the features and benefits to ARR in detail. Some of those features include:
- HTTP based routing decisions.
- The ability to offload SSL requests
- The ability to offload compression
- Health monitoring of live traffic and specific URLs to monitor and adjust routing of requests.
- Support for extensive debugging through Failed Request Tracing Rules.