Windows Server 2003 - IIS6.0 Do not delete the Default Web Site!

I being a very intelligent web developer (This is true). Decided it might be fun to delete the Default Web Site in IIS6.0 not thinking much of it. Of course it wouldn't have mattered at all, at least until I decided to install commerce server 2007 enterprise on the production server that I had deleted the Default Web Site.

Why was this a problem you ask? Wow good question. Here's the long and short of it.

When installing Microsoft Commerce Server 2007 sp1 you can get about oh I'd say 5 minutes into the install until you get to Web Site configuration settings. You put your user name in the little sign in box as well as your password like any good little wizard following monkey. Then terror err I mean error strikes you. The error says hey idiot I cannot find your "Default Web Site" you cannot continue. Well gall darn you say I will just right click on the web site folder and create a new web  site called "Default Web Site". Ah doesn't that feel better? You say to the Monkey wizard (Commerce Server 2007 sp1 config wizard). No says the error again. So you jump up and down screaming at the server. What the brown bananas do you mean its right there!

Well turns out that there is a super er... uber  secret metadatabase that keeps a ID stored for every site created and the one you just created "Default Web Site" is W3SVC/890987799887.... on and on for about 6 more decimals. Problem is Windows likes the "Default Web Site" to be W3SVC/1. What do you do? Uninstall IIS? Holy foolish that would be.

Try this before moving on.

There is a fun little vb script built just for this occasion. "adsutil"! Remember it and love it.

First we need to make sure there for whatever reason isn't a W3SVC/1 already there ( I know you are saying: but the story you took me down this long path and....) No worries its always good to dot your T's and Cross your I's or is that wrong too?

Go to your nearest command prompt.

make sure you are at the root of C:\

cd\Inetpub\AdminScripts

once there run this: cscript adsutil.vbs enum w3svc/1

If it comes back with "path requested could not be found" you know your hosed.

Try this: cscript adsutil.vbs enum w3svc

All kinds of data will fly by and the world will turn upside down (unless you are in Australia. However if you are there you are smart enough not to delete the web site in the first place.).

You should get: w3svc/Info w3svc/Filters and at least one w3svc/### where the number is the interesting part.

To find your new default web site number will take some looking up. Hunt by using this: cscript adsutil.vbs enum w3svc/### putting the numbers you saw in the list.

Ok the good part.

Create the new W3SVC/1

     cscript adsutil.vbs create_vserv W3SVC/1

Copy it

    cscript adsutil.vbs copy W3SVC/### W3SVC/1

Set It

    cscript adsutil.vbs set w3svc/1/ServerComment "Default Web Site"

So now you have a new Default Web Site and you now know not to delete it again or there will be consequences.

 

 

 

No Comments