Windows Administration

Quickly backup iis metabase on a Windows Cloud Server

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. 

image.png

Default Environment Variable Values in Microsoft Windows

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

image

JessCoburn.Com running on ARR! and that not be Pirate speak thar Matey!

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:

  1. Discusses the first stage of Applied Innovations Cloud Initiative.
  2. 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.