Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

share|improve this question

closed as off topic by MDMarra, Ward, Falcon Momot, mdpc, Jenny D Jun 20 '13 at 6:56

Questions on Server Fault are expected to relate to professional server, networking, or related infrastructure administration within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

    
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? –  Jim Fell Oct 29 '10 at 16:35
    
The obvious question: Are you sure that Apache is running? –  mmattax Oct 29 '10 at 16:45
    
@Jim mm..trying to browse localhost on a browser? –  kapitanluffy Oct 29 '10 at 17:13
    
No problem at all. –  EEAA Oct 29 '10 at 17:25

7 Answers 7

::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.

share|improve this answer
    
If the downvoter would like to leave a reason as to why this is not useful, I'll be happy to change it. –  paxdiablo 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 localhost on my browser it says connection was reset. i tried 127 and it works..also for my ip –  kapitanluffy Oct 30 '10 at 5:29

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

share|improve this answer
    
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 5:34

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

share|improve this answer
    
uhm where exactly should i add that? sorry for being so noobish here xD –  kapitanluffy Oct 30 '10 at 5:32

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

share|improve this answer
    
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

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.

share|improve this answer
    
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 –  Iain 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 5:23
    
DWORD is a hex value, so 20 was correct. 20000000 won't help at all. –  user3914 Oct 30 '10 at 6: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. –  Iain Oct 30 '10 at 7:48
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

share|improve this answer
    
the service listening on port 80 is apache it self..like i said..127 and my ip works..but not for localhost –  kapitanluffy Oct 30 '10 at 5:31

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.

share|improve this answer
    
It's probably not getting anywhere near the router, he's using the loopback interface. –  Iain Oct 29 '10 at 16:41
    
i have a world of warcraft server and i had that issue, enter on this webpage canyouseeme.org and try with the diferent ports –  tatan restrepo Oct 29 '10 at 16:45
    
I'm with Iain on this. 127 is loopback and it won't leave the machine. –  user3914 Oct 30 '10 at 6:25

Not the answer you're looking for? Browse other questions tagged or ask your own question.