Can't connect to local web server

13,652

Solution 1

Are you sure the web server are running? Type the following commands in a command prompt:

netstat -an | find "80"
netstat -an | find "23456"

If the web servers are running, you should have a similar output:

C:\Documents and Settings\Benoit>netstat -an | find "80"
  TCP    0.0.0.0:80             0.0.0.0:0              LISTENING

By the way, if Visual Studio web server is running on port 23456, you must use the following URIs:


According to your output, it really seems a firewall is running on your computer. Have you tried to connect from another computer on your network?

Solution 2

I turned the firewall off on this machine. I assumed it would stay off and no ports would be blocked. But this is a domain joined machine and group policy turned on the firewall within minutes of me turning it off, behind my back. So I opened up the ports and now everything is working.

Thanks to those who tried to help.

Share:
13,652

Related videos on Youtube

J. Christian
Author by

J. Christian

Updated on September 17, 2022

Comments

  • J. Christian
    J. Christian almost 2 years

    I can't access web content (like a simple HTML file) on my Windows 7 Ultimate x64 machine, either locally or remotely. I tried connecting to IIS (running on port 80) and the built-in Visual Studio web server (running on port 23456) but for some reason, the request never makes it to the web server and both IE and Firefox timeout. The firewall and antivirus have been stopped. I tried accessing the web server using http://localhost, http://127.0.0.1 and http://192.168.1.109 and none work. The hosts file looks like this:

        127.0.0.1       localhost
    #   ::1 
    

    I tried commenting out both lines and un-commenting both lines. No difference.

    So I assume something with the networking stack must be screwed up on this machine. Any advice on diagnosing/fixing this?

  • J. Christian
    J. Christian about 14 years
    Yes, I was using the port numbers for the VS web server. Here's the netstat output: C:\>netstat -an | find "23465" TCP 127.0.0.1:3482 127.0.0.1:23465 SYN_SENT TCP 127.0.0.1:23465 0.0.0.0:0 LISTENING C:\>netstat -an | find "80" TCP 0.0.0.0:80 0.0.0.0:0 LISTENING TCP [::]:80 [::]:0 LISTENING Looks good right?
  • J. Christian
    J. Christian about 14 years
    Sorry abt the formatting.
  • J. Christian
    J. Christian about 14 years
    No proxies set and firewall is off.
  • J. Christian
    J. Christian about 14 years
    Putty telnet-ing to port 80 also times out.
  • Kyle Smith
    Kyle Smith about 14 years
    @Sajee - That SYN_SENT is interesting, seems to indicate that, at a basic networking level, the Windows kernel is not responding to the connection. I think you're spot on when you say there is something wrong with the networking stack. Unfortunately I don't know too much about troubleshooting beyond that. Best of luck...