Recreate the default website in IIS

前端 未结 8 684
北荒
北荒 2020-12-02 09:46

I\'ve accidentally deleted the default website in IIS; It no longer shows up in the tree of IIS manager and browsing \"localhost\" returns a 404 error.

I\'ve re-inst

相关标签:
8条回答
  • 2020-12-02 10:06

    Other answers are basically right, thanks to them I was able to restore my default web site, they're just missing some more or less important details.

    This was the complete process to restore the Default Web Site in my case (IIS 7 on Windows 7 64bit):

    1. open IIS Manager
    2. right click Sites node under your machine in the Connections tree on the left side and click Add Website
    3. enter "Default Web Site" as a Site name
    4. set Application pool back to DefaultAppPool!
    5. set Physical path to %SystemDrive%\inetpub\wwwroot
    6. leave Binding and everything else as is

    Possible issues:

    1. If the newly created web site cannot be started with the following message:

      Internet Information Services (IIS) Manager - The process cannot access the file because it is being used by another process. (Exception from HRESULT: 0x80070020)

      ...it's possible that port 80 is already assigned to another application (Skype in my case :). You can change the binding port to e.g. 8080 by right clicking Default Web Site and selecting Edit Bindings... and Edit.... See Error 0x80070020 when you try to start a Web site in IIS 7.0 for details. Or you can just close the application sitting on the port 80, of course.

    2. Some applications require Default Web Site to have the ID 1. In my case, it got ID 1 after recreation automatically. If it's not your case, see Re-create “default Website” in IIS after accidentally deleting. It's different for IIS 6 and 7.


    Note: I had to recreate the Default Web Site, because I wasn't able to even open a project configured to run under IIS in Visual Studio. I had a solution with a couple of projects inside. One of the projects failed to load with the following 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 the Default Web Site in IIS Manager, I was able to reload and open that specific project.

    0 讨论(0)
  • 2020-12-02 10:08

    Follow these Steps Restore your "Default Website" Website :

    1. create a new website
    2. set "Default Website" as its name
    3. In the Binding section (bottom panel), enter your local IP address in the "IP Address" edit.
    4. Keep the "Host" edit empty
    0 讨论(0)
  • 2020-12-02 10:11

    You can try to restore your previous state by doing the following:

    1. Go to IIS Manager
    2. Right-click on your Local Computer.
    3. Point to All Tasks
    4. Point to Backup/Restore Configuration
    5. Select the configuration you want to restore
    6. Wait untill configuration applies
    0 讨论(0)
  • 2020-12-02 10:14

    I deleted the C:\inetpub folder and reinstalled IIS which recreated the default website and settings.

    0 讨论(0)
  • 2020-12-02 10:17

    Try this:

    In the IIS Manager right click on Web sites, chose New, then Web site...

    This way you can recreate the Default Web Site.

    After these steps restart IIS: Right click on local computer, All Tasks, Restart IIS...

    0 讨论(0)
  • 2020-12-02 10:18

    Check out this answer on SuperUser:

    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

    This approach fixed the problem for me.

    0 讨论(0)
提交回复
热议问题