-2

i am using xampp 1.7.1 PHP 5.2.9

pinged localhost on cmd and it showed

Reply from ::1: time<1ms
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Reply from ::1: time<1ms

hosts file has

127.0.0.1 localhost
127.0.0.1 localhost.com
127.0.0.1 www.localhost.com

any other ideas? http://127.0.0.1 and http://ipaddress works

kapitanluffy
  • 139
  • 1
  • 1
  • 8
  • Please do elaborate what your problem is/what you are trying to do. – Tie-fighter Oct 29 '10 at 16:32
  • What is it you are trying to accomplish? –  Oct 29 '10 at 16:35
  • @Jim mm..trying to browse http://localhost on a browser? – kapitanluffy Oct 29 '10 at 17:13
  • Does the error log (of the apache) show anything if you access `http://localhost`? – bitmask Oct 29 '10 at 18:20
  • @bit nothing actually i viewed the error.log file and these are the last 5 ones i saw [Sun Aug 15 18:30:17 2010] [notice] Digest: generating secret for digest authentication ... [Sun Aug 15 18:30:17 2010] [notice] Digest: done [Sun Aug 15 18:30:19 2010] [notice] Apache/2.2.11 (Win32) DAV/2 mod_ssl/2.2.11 OpenSSL/0.9.8i PHP/5.2.9 configured -- resuming normal operations [Sun Aug 15 18:30:19 2010] [notice] Server built: Dec 10 2008 00:10:06 [Sun Aug 15 18:30:19 2010] [notice] Parent: Created child process 2652 – kapitanluffy Oct 30 '10 at 05:27
  • The obvious question: Are you sure that Apache is running? – mmattax Oct 29 '10 at 16:45
  • i just uninstalled ipv6 from my computer. i will try what lain said..although i am sure i already did this.but he said that it works on him so ill try it again HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\tcpip6\Parameters\DisabledComponents DWORD value 0x20 thanks for everyones help :) – kapitanluffy Oct 30 '10 at 17:52

7 Answers7

1

::1 is the IPv6 version of localhost, so it is working.

Localhost always translates to the loopback IP address 127.0.0.1 in IPv4, or ::1 in IPv6.

  • If the downvoter would like to leave a reason as to _why_ this is not useful, I'll be happy to change it. –  Oct 29 '10 at 16:20
  • i think because most people around here knows that? xD well its still a bad idea to down vote someone xD – kapitanluffy Oct 29 '10 at 16:24
  • I think that does not answer the question, because the problem is not in the result of the ping, but probably that entering `http://localhost` in the browser does not get one the same page as `http://127.0.0.1`. However, this is pure speculation as the OP did not state the *actual* problem. – bitmask Oct 29 '10 at 18:17
  • my problem is..when i tried browsing the http://localhost on my browser it says connection was reset. i tried 127 and it works..also for my ip – kapitanluffy Oct 30 '10 at 05:29
1

The reason a ping responds with that address but browsing fails is because ping is using IPv6 automatically, and the system is resolving localhost with the IPv6 address, which your webserver apparently isn't serving on. If you add an entry to the Windows\System32\drivers\etc\hosts file with this:

127.0.0.1       localhost

then it should force the system to resolve localhost as the IPv4 address instead.

Another "fix" includes disabling IPv6, as Tie-fighter suggests, but really the "best" solution would be to make your webserver work when using IPv6 ("best" being a very subjective thing in this case).

Good luck,

--jed

Jed Daniels
  • 7,172
  • 2
  • 33
  • 41
  • so it means my apache doesnt support ipv6? so maybe ill go for disablibg the ipv6..how can i do that?like what i commented on tie fighter..i ticked TCP/IP version 6 in the properties of my Local Area Connection ..nothing happened..i guess im in the wrong way xD – kapitanluffy Oct 29 '10 at 17:08
  • I haven't done much apache configuration lately, so the following is mere speculation, but I'd guess that it probably does support IPv6, it likely just needs to be enabled. You could see if anything is currently listening on port 80 for IPv6 by doing a "netstat -an" from the command line and looking for an entry similar to this one: "TCP [::]:80 [::]:0 LISTENING". – Jed Daniels Oct 29 '10 at 17:43
  • i have three actually.. TCP [::]:135 [::]:0 LISTENING 0 TCP [::]:8080 [::]:0 LISTENING 0 TCP [::1]:30606 [::]:0 LISTENING 0 ..so how can i enable ipv6? – kapitanluffy Oct 30 '10 at 05:34
1

Is there a weird VirtualServer for localhost that's different from the default one configured? When you use "localhost", it can get matched by a ServerAlias or ServerName configuration. If that configuration is bad, (eg: wrong wwwroot), then it won't work with the localhost, but might with an IP.

So check your httpd.conf for localhost. Or add ServerAlias localhost to the VirtualServer that's working properly.


--Christopher Karel

Christopher Karel
  • 6,442
  • 1
  • 26
  • 34
0

::1 is the localhost address (127.0.0.1) in IPv6.
Try unchecking the TCP/IPv6 item in the adaptor's properties.

Tie-fighter
  • 741
  • 2
  • 9
  • 17
  • i ticked Microsoft TCP/IP Version 6 in the Network Connections>Local Area Connection>Properties..the ping still looks the same – kapitanluffy Oct 29 '10 at 16:43
0

By default windows is set to prefer ipv6 over ipv4 so localhost resolves to ::1 which you xampp isn't listening on.

To make windows prefer ipv4 create the following DWORD in the registry and set it's value to 0x20.

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\tcpip6\Parameters\DisabledComponents

After a reboot windows will resolve ipv4 addresses in preference to ipv6 addresses.

user9517
  • 114,104
  • 20
  • 206
  • 289
  • actually there's no ::1 localhost..what i stated above are everything i have on the hosts file – kapitanluffy Oct 29 '10 at 17:02
  • I updated my answer to reflect reality. I did this and my system now resolves localhost to 127.0.0.1 and not ::1 – user9517 Oct 29 '10 at 17:27
  • i edited it with the value 20..the value shown is..0x0000020 it doesn't do anything..i don't know the exact value of 0x20..ill try inputting 20000000 – kapitanluffy Oct 30 '10 at 05:23
  • DWORD is a hex value, so 20 was correct. 20000000 won't help at all. –  Oct 30 '10 at 06:27
  • @kapitanlufy: 0x20 is common notation for a `hexadecimal` value. After you have created the key double click on it and you'll get a pop up to edit the DWORD (32 bit) value. Ensure that the `Hexadecimal` radio button is checked and enter `20` in the value data: box. Click OK. – user9517 Oct 30 '10 at 07:48
0
netstat -an | grep LIST

or

lsof -i

will tell you if a particular service is actually listening on a port. after that, try using top to see if the process is somehow wedged. you wil lneed sudo privs on the box to effectively run these commands

Brad Clawsie
  • 411
  • 2
  • 7
-3

Open your router port, http port is 80 and 8080, search in google about how u can open ports with your router and check that your windows firewall dond block apache server.