1,105,534 Community Members

Localhost wont connect but 127.1.1.1 will

Member Avatar
bvowens
Newbie Poster
2 posts since Mar 2009
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

Hi
I've been working on a joomla site on my local windoes vista computer using WAMPSERVER vrs2 and with apache.

Something went wrong with apache and windows warned me and turned it off. Since then I can't use http://localhost (or the shortcut on the wampserver menu 'localhost' to connect.

However I CAN connect using http://127.1.1.1 and this is the workaround I've been using for a week now. Anyone know how i can get my 'localhost' working back to normal?

Thanks for your time.

Member Avatar
samarudge
Posting Whiz
354 posts since May 2008
Reputation Points: 16 [?]
Q&As Helped to Solve: 31 [?]
Skill Endorsements: 0 [?]
 
0
 

Open Notepad/Wordpad and navigate to
<Your Windows Drive (C:/)>/windows/system32/drivers/etc/hosts
(You might need to change Text Document (*.txt) to all files to see it)
It should look something like this:

# Copyright (c) 1993-1999 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
#      102.54.94.97     rhino.acme.com          # source server
#       38.25.63.10     x.acme.com              # x client host

127.0.0.1       localhost

Add this line to the bottom of the file:

127.1.1.1 localhost
so your hosts should look like this:

# Copyright (c) 1993-1999 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
#      102.54.94.97     rhino.acme.com          # source server
#       38.25.63.10     x.acme.com              # x client host

127.0.0.1       localhost
127.1.1.1	localhost

Hope that helps,
Sam R

Member Avatar
djpazza
Newbie Poster
2 posts since Mar 2009
Reputation Points: 0 [?]
Q&As Helped to Solve: 1 [?]
Skill Endorsements: 0 [?]
 
0
 

check you hosts file in notepad.

start - run
%windir%/system32/drivers/etc

If your in a work group then this file controls you manual dns mappings.

Your should have a default entry:

127.0.0.1 localhost

Member Avatar
djpazza
Newbie Poster
2 posts since Mar 2009
Reputation Points: 0 [?]
Q&As Helped to Solve: 1 [?]
Skill Endorsements: 0 [?]
 
0
 

sorry shoud have refreshed the page !

Just a note I would not have two entries using the same host name.

Member Avatar
samarudge
Posting Whiz
354 posts since May 2008
Reputation Points: 16 [?]
Q&As Helped to Solve: 31 [?]
Skill Endorsements: 0 [?]
 
0
 

sorry shoud have refreshed the page !

Just a note I would not have two entries using the same host name.

Yer soz, i wrote that during a Geography lesson and I wasn't thinking propperli :D

Member Avatar
bvowens
Newbie Poster
2 posts since Mar 2009
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

Thanks for that. By the time I had seen your reply I had already figured this out (actually remembered that there was a 'variable - name' pairing in hosts file. And yes localhost had somehow been removed. I replaced it and all is working fine. Thank you for your help.
Must check my profile though - don't remember getting any emails telling me a reply was made to this post - thanks again.

Question Answered as of 4 Years Ago by samarudge and djpazza
You
This question has already been solved: Start a new discussion instead
Post:
Start New Discussion
Tags Related to this Article