How to restore IIS settings and Default Web Site?
In short: Reinstall both IIS and WAS.
In details -
Step 1
- Go to "Add remove programs"
- "Turn windows features on or off"
- Remove both IIS and WAS (Windows Process Activation Service)
- Restart the PC
Step 2
- Go to "Add remove programs"
- "Turn windows features on or off"
- Turn on both IIS and WAS (Windows Process Activation Service)
Note: Reinstalling IIS alone won't help. You have to reinstall both IIS and WAS
You don't need to reinstall the whole IIS or WAS!
If it's just about creating the Default Web Site, reinstalling the whole IIS and WAS is little bit too much "aggressive" solution and absolutely the last thing to do if everything else fails. I was able to recreate it manually using IIS Manager.
Check my answer on StackOverflow where it's explained in detail.
I have deleted Default Web Site accidentally at some point of time most probably. When I was trying to open a project configured to run under IIS in Visual Studio, it failed to load with an error message:
"The Web Application Project is configured to use IIS. The Web server 'http://localhost:8080/' could not be found."
After I have recreated Default Web Site in IIS Manager as described in my answer, I was able to reload and open that specific project.
This was the complete process to restore the Default Web Site in my case (IIS 7 on Windows 7 64bit):
- open IIS Manager
- right click Sites node under your machine in the Connections tree on the left side and click Add Website
- enter "Default Web Site" as a Site name
- set Application pool back to DefaultAppPool!
- set Physical path to
%SystemDrive%\inetpub\wwwroot
- leave Binding and everything else as is
Check my answer on StackOverflow for more details.