15

I recently installed IIS on a Windows 2012 R2 server and can't seem to connect to localhost, the IP, server DNS, etc. I've tried the following and nothing seems to be helping:

  1. In CMD run netstat -ano to check that port :80 is listening (it is)
  2. Bound the site to All Unassigned and the IP address on port 80 (no hostname)
  3. Adjusting the security permissions on the wwwroot folder to confirm that IIS_IUSRS has access and tried adding IUSR
  4. Changed the Application Pool settings for Load User Profile from False to True
  5. Edit the hosts file to add the line 127.0.0.1 localhost
  6. Ensured that Anonymous Authentication is enabled and no others are enabled
  7. Temporarily disable the MacAfee running on the machine

Not sure what else to try or where it might be failing here.

Stan
  • 1,191
  • 2
  • 15
  • 27
  • what do you mean cannot connect.. Are you deploying a project on IIS and try to run? Did you enable the Directory Browsing of your project? – Vijunav Vastivch Apr 27 '17 at 02:51
  • I was just trying to get the default iis site to work by browsing to http://localhost in IE. Figured out what the problem was, which I'll answer below. – Stan Apr 27 '17 at 10:24

3 Answers3

14

I was struggling with a similar problem - I didn't have any connections and couldn't connect to even localhost with IIS.

Turns out I had forgotten to open IIS as an administrator. That fixed the problem.

Lauri Peltonen
  • 1,432
  • 15
  • 29
3

You will need to Regiis your .Net.

Open CMD and browse to:

"%windir%\Microsoft.NET\Framework64\v4.0.30319"

Then run the following command: "aspnet_regiis -ir"

**Update for windows server 2016/ Win10 /IIS8: No longer need to RegIIS , instead, you'll need to open "Turn windows Features on or off" Than Enable .Net Framework4.X Advanced services and "IIS/World Wide web/Application development features/ASP.Net 4.X"

  • gives this error `'aspnet_regiis' is not recognized as an internal or external command, operable program or batch file.` – Reyneer Leon Dec 10 '19 at 04:17
  • @ReyneerLeon, probably IIS management is not installed, or, if you run the command in PowerShell, ".\" in the beginning. – Aviw Feb 01 '20 at 21:24
  • Look for the exe file in C:\Windows\WinSxS\amd64_netfx-aspnet_regiis_exe_b03f5f7f11d50a3a_10.0.19041.1_none_8b6323099e7e4441 This is from the Windows installation package, browse to it using your cmd window before you rum the command (So win can find ASPNET_REGIIS.EXE File) – Hanan Ohayon Sep 29 '20 at 21:35
  • "C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_regiis.exe" from your local Win – Hanan Ohayon Sep 29 '20 at 21:40
2

Turns out I needed to grant permission to the Application Pool that the application was using. The Application Pool's identity was NetworkService, so as so as I granted Network Service read/execute permissions I was able to navigate to the site.

Stan
  • 1,191
  • 2
  • 15
  • 27