Many a times you will find people delete the “Default Web Site” and then they install some application which require “Default Web Site”. Now, once you have deleted the Web Site how can you recreate or undelete the Web Site. Not possible unless you have a backup.
Fortunately, there are workarounds in IIS 6 / 7 / 7.5 through which you can recreate the deleted “Default Web Site”. Does that mean you accidentally deleted a working Web Site and you can recreate it, the answer is “NO”. You can only recreate the skeleton and then you will have to configure the Web Site again with all the Virtual Directory’s and Applications. I will show you how you can recreate “Default Web Site” in IIS 6 and then in IIS 7 / 7.5.
In IIS 6.0
- Right click on Web Sites folder and click New–> click Web Site…
- Under Web Site Description type “Default Web Site” –> click Next
- Under IP Address and Port Settings, keep everything as default –> click Next
- Under Web Site Home Directory, click Browse and select “C:\Inetpub\wwwroot” –> click Next
- Under Web Site Access Permissions, select Read and Run scripts (such as ASP)–> click Next
- Click Finish
Image may be NSFW.
Clik here to view. - Now, you have a new “Default Web Site” created but the identity of the Web Site is not 1. Some applications like Microsoft Exchange and Microsoft Office Communications Server requires “Default Web Site” with identity 1.
- Open the command prompt as an Administrator
- Go to C:\Inetpub\AdminScripts and type cscript adsutil.vbs enum /w3svc
- At the very bottom, you will see something like
[/w3svc/1403756263]
[/w3svc/998577302] - type cscript adsutil.vbs move /w3svc/998577302 /w3svc/1 and then do IISRESET
C:\Inetpub\AdminScripts>cscript adsutil.vbs move /w3svc/998577302 /w3svc/1
Microsoft (R) Windows Script Host Version 5.6
Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.moved from /w3svc/998577302 to /w3svc/1
C:\Inetpub\AdminScripts>iisresetAttempting stop...
Internet services successfully stopped
Attempting start...
Internet services successfully restarted - Refresh IIS Manager and the “Default Web Site” has now the identity 1.
Image may be NSFW.
Clik here to view.
In IIS 7 / 7.5
- Right click on Sites folder and click Add Web Site…
- Under Site name: type “Default Web Site”
- Under Application pool: select DefaultAppPool
- Under Physical path: “C:\Inetpub\wwwroot”
- Click OK
Image may be NSFW.
Clik here to view. - Fortunately for me, the “Default Web Site” was created with the ID 1.
- But just incase, if in your case the “Default Web Site” does not show ID 1 and if ID 1 is not in use.
- Open command prompt as an Administrator
- Go to C:\Windows\System32\inetsrv\config and type notepad applicationHost.config
- Find “Default Web Site” and change id=”x” to id=”1”.
- Save applicationHost.config
- Now refresh IIS Manager and start the Web Site.
Hope this helps,
Vivek Kumbhar
Quote of the day:
Love is a snowmobile racing across the tundra and then suddenly it flips over, pinning you underneath. At night, the ice weasels come. - Matt Groening