Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot connect to Localhost on server running IIS

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.

like image 648
Stan Avatar asked Apr 26 '17 15:04

Stan


People also ask

Why can I not connect to localhost?

The localhost simulates a web server running on your computer. When the “localhost refused to connect” error appears, it is likely due to misconfigured port. Other common reasons include insufficient permissions and the Apache webserver not running properly.

Why IIS server is not working?

Make sure the website has been started in IIS: In the left pane of IIS Manager under "Sites", select the appropriate site. If your site is configured under the "Default Web Site", select that one. In the right pane under "Manage Website", there are "Start" and "Stop" links.


2 Answers

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.

like image 69
Lauri Peltonen Avatar answered Sep 28 '22 05:09

Lauri Peltonen


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"

like image 40
Hanan Ohayon Avatar answered Sep 28 '22 05:09

Hanan Ohayon