localhost==127.0.0.1?

View: New views
11 Messages — Rating Filter:   Alert me  

localhost==127.0.0.1?

by Kartik Nayak-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,
I thought "localhost" is equivalent to "127.0.0.1". However, when i try to
use this http://localhost:3000/say/hello , it says

"Unable to connect
Firefox can't establish a connection to the server at localhost:3000."

When i try to use http://127.0.0.1:3000/say/hello , it works fine.

Any idea why?

Regards,
Kartik Nayak


[Non-text portions of this message have been removed]


Re: localhost==127.0.0.1?

by Navneet Thillaisthanam :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

It is but the /etc/hosts file might not have a mapping of 'localhost' to
'127.0.0.1'.

Check if the /etc/hosts file has a line something like- *127.0.0.1
localhost
*
Navneet

Re: localhost==127.0.0.1?

by Varun Jain-5 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello Karthik,

You can check the hosts file inside etc directory.There may be two entries
for the localhost
127.0.0.1 and 127.0.0.1::1.You an try commenting the latter one.It is
possible that IPv6 is turned on and it is resolving localhost to the ::1
address .Since the port 3000 is currently active hence the connection can't
be established message might be appearing.

Cheers,
Varun :)


[Non-text portions of this message have been removed]


Re: localhost==127.0.0.1?

by Kartik Nayak-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Varun,

My hosts file contains this:


127.0.1.1       localhost
127.0.1.1    tiger

# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts
66.163.181.184 scs.msg.yahoo.com



I tried commenting "::1     ip6-localhost ip6-loopback", but it did not
work. Also, i run Drupal using a different server, and it works properly
when i say http://localhost/Drupal

Regards,
Kartik Nayak

On Fri, Jul 3, 2009 at 2:11 PM, Varun Jain <varunjain003@...> wrote:

> Hello Karthik,
>
> You can check the hosts file inside etc directory.There may be two entries
> for the localhost
> 127.0.0.1 and 127.0.0.1::1.You an try commenting the latter one.It is
> possible that IPv6 is turned on and it is resolving localhost to the ::1
> address .Since the port 3000 is currently active hence the connection can't
> be established message might be appearing.
>
> Cheers,
> Varun :)
>
>
> [Non-text portions of this message have been removed]
>
>
>
> ------------------------------------
>
> http://twincling.org/
> http://twitter.com/twincling
> ----------------------------------------
> Yahoo! Groups Links
>
>
>
>


[Non-text portions of this message have been removed]


Re: localhost==127.0.0.1?

by manish kumar-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

your host should have
127.0.0.1 localhost
entry.

On Fri, Jul 3, 2009 at 2:25 PM, Kartik Nayak <kartik1507@...> wrote:

>
>
> Hi Varun,
>
> My hosts file contains this:
>
> 127.0.1.1 localhost
> 127.0.1.1 tiger
>
> # The following lines are desirable for IPv6 capable hosts
> ::1 ip6-localhost ip6-loopback
> fe00::0 ip6-localnet
> ff00::0 ip6-mcastprefix
> ff02::1 ip6-allnodes
> ff02::2 ip6-allrouters
> ff02::3 ip6-allhosts
> 66.163.181.184 scs.msg.yahoo.com
>
> I tried commenting "::1 ip6-localhost ip6-loopback", but it did not
> work. Also, i run Drupal using a different server, and it works properly
> when i say http://localhost/Drupal
>
> Regards,
> Kartik Nayak
>
>
> On Fri, Jul 3, 2009 at 2:11 PM, Varun Jain <varunjain003@...<varunjain003%40gmail.com>>
> wrote:
>
> > Hello Karthik,
> >
> > You can check the hosts file inside etc directory.There may be two
> entries
> > for the localhost
> > 127.0.0.1 and 127.0.0.1::1.You an try commenting the latter one.It is
> > possible that IPv6 is turned on and it is resolving localhost to the ::1
> > address .Since the port 3000 is currently active hence the connection
> can't
> > be established message might be appearing.
> >
> > Cheers,
> > Varun :)
> >
> >
> > [Non-text portions of this message have been removed]
> >
> >
> >
> > ------------------------------------
> >
> > http://twincling.org/
> > http://twitter.com/twincling
> > ----------------------------------------
> > Yahoo! Groups Links
> >
> >
> >
> >
>
> [Non-text portions of this message have been removed]
>
>  
>


[Non-text portions of this message have been removed]


Re: localhost==127.0.0.1?

by Navneet Thillaisthanam :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

The first line is the culprit. Change the 127.0.1.1 localhost to 127.0.0.1
localhost. It will work.

Navneet


[Non-text portions of this message have been removed]


Re: localhost==127.0.0.1?

by Varun Jain-5 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello Karthik,

Well as evident from the data of your hosts file the localhost is mapped to
127.0.1.1 on your system.So if you want to resolve your problem you just
have to change 127.0.1.1 localhost to 127.0.0.1 localhost.
Check with ping i.e ping localhost .Ping command shall show you to which
address your localhost is mapped.In your case it shall display 127.0.1.1
.After changing localhost definition in hosts file to 127.0.0.1 ,ping shall
display 127.0.0.1.Now you can try establishing connection to the server.

Cheers,
Varun  :)


[Non-text portions of this message have been removed]


Re: localhost==127.0.0.1?

by Kartik Nayak-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

HI Varun, Navneet, Manish,
    I changed the first line to "127.0.0.1 localhost" and restarted the
servers and it worked. But why was Drupal working earlier with local host?
Infact, its working with both 127.0.0.1 and 127.0.1.1. What's 127.0.1.1?
    Anyway, thnx for the help :)

Regards,
Kartik Nayak.

On Fri, Jul 3, 2009 at 2:47 PM, manish kumar <abhiman.bit@...> wrote:

> your host should have
> 127.0.0.1 localhost
> entry.
>
> On Fri, Jul 3, 2009 at 2:25 PM, Kartik Nayak <kartik1507@...> wrote:
>
> >
> >
> > Hi Varun,
> >
> > My hosts file contains this:
> >
> > 127.0.1.1 localhost
> > 127.0.1.1 tiger
> >
> > # The following lines are desirable for IPv6 capable hosts
> > ::1 ip6-localhost ip6-loopback
> > fe00::0 ip6-localnet
> > ff00::0 ip6-mcastprefix
> > ff02::1 ip6-allnodes
> > ff02::2 ip6-allrouters
> > ff02::3 ip6-allhosts
> > 66.163.181.184 scs.msg.yahoo.com
> >
> > I tried commenting "::1 ip6-localhost ip6-loopback", but it did not
> > work. Also, i run Drupal using a different server, and it works properly
> > when i say http://localhost/Drupal
> >
> > Regards,
> > Kartik Nayak
> >
> >
> > On Fri, Jul 3, 2009 at 2:11 PM, Varun Jain <varunjain003@...
> <varunjain003%40gmail.com>>
> > wrote:
> >
> > > Hello Karthik,
> > >
> > > You can check the hosts file inside etc directory.There may be two
> > entries
> > > for the localhost
> > > 127.0.0.1 and 127.0.0.1::1.You an try commenting the latter one.It is
> > > possible that IPv6 is turned on and it is resolving localhost to the
> ::1
> > > address .Since the port 3000 is currently active hence the connection
> > can't
> > > be established message might be appearing.
> > >
> > > Cheers,
> > > Varun :)
> > >
> > >
> > > [Non-text portions of this message have been removed]
> > >
> > >
> > >
> > > ------------------------------------
> > >
> > > http://twincling.org/
> > > http://twitter.com/twincling
> > > ----------------------------------------
> > > Yahoo! Groups Links
> > >
> > >
> > >
> > >
> >
> > [Non-text portions of this message have been removed]
> >
> >
> >
>
>
> [Non-text portions of this message have been removed]
>
>
>
> ------------------------------------
>
> http://twincling.org/
> http://twitter.com/twincling
> ----------------------------------------
> Yahoo! Groups Links
>
>
>
>


[Non-text portions of this message have been removed]


Re: localhost==127.0.0.1?

by Kartik Nayak-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

also, what do rest of the lines in hosts indicate?

On Fri, Jul 3, 2009 at 4:07 PM, Kartik Nayak <kartik1507@...> wrote:

> HI Varun, Navneet, Manish,
>     I changed the first line to "127.0.0.1 localhost" and restarted the
> servers and it worked. But why was Drupal working earlier with local host?
> Infact, its working with both 127.0.0.1 and 127.0.1.1. What's 127.0.1.1?
>     Anyway, thnx for the help :)
>
> Regards,
> Kartik Nayak.
>
>
> On Fri, Jul 3, 2009 at 2:47 PM, manish kumar <abhiman.bit@...>wrote:
>
>> your host should have
>> 127.0.0.1 localhost
>> entry.
>>
>> On Fri, Jul 3, 2009 at 2:25 PM, Kartik Nayak <kartik1507@...>
>> wrote:
>>
>> >
>> >
>> > Hi Varun,
>> >
>> > My hosts file contains this:
>> >
>> > 127.0.1.1 localhost
>> > 127.0.1.1 tiger
>> >
>> > # The following lines are desirable for IPv6 capable hosts
>> > ::1 ip6-localhost ip6-loopback
>> > fe00::0 ip6-localnet
>> > ff00::0 ip6-mcastprefix
>> > ff02::1 ip6-allnodes
>> > ff02::2 ip6-allrouters
>> > ff02::3 ip6-allhosts
>> > 66.163.181.184 scs.msg.yahoo.com
>> >
>> > I tried commenting "::1 ip6-localhost ip6-loopback", but it did not
>> > work. Also, i run Drupal using a different server, and it works properly
>> > when i say http://localhost/Drupal
>> >
>> > Regards,
>> > Kartik Nayak
>> >
>> >
>> > On Fri, Jul 3, 2009 at 2:11 PM, Varun Jain <varunjain003@...
>> <varunjain003%40gmail.com>>
>> > wrote:
>> >
>> > > Hello Karthik,
>> > >
>> > > You can check the hosts file inside etc directory.There may be two
>> > entries
>> > > for the localhost
>> > > 127.0.0.1 and 127.0.0.1::1.You an try commenting the latter one.It is
>> > > possible that IPv6 is turned on and it is resolving localhost to the
>> ::1
>> > > address .Since the port 3000 is currently active hence the connection
>> > can't
>> > > be established message might be appearing.
>> > >
>> > > Cheers,
>> > > Varun :)
>> > >
>> > >
>> > > [Non-text portions of this message have been removed]
>> > >
>> > >
>> > >
>> > > ------------------------------------
>> > >
>> > > http://twincling.org/
>> > > http://twitter.com/twincling
>> > > ----------------------------------------
>> > > Yahoo! Groups Links
>> > >
>> > >
>> > >
>> > >
>> >
>> > [Non-text portions of this message have been removed]
>> >
>> >
>> >
>>
>>
>> [Non-text portions of this message have been removed]
>>
>>
>>
>> ------------------------------------
>>
>> http://twincling.org/
>> http://twitter.com/twincling
>> ----------------------------------------
>> Yahoo! Groups Links
>>
>>
>>
>>
>


[Non-text portions of this message have been removed]


Re: localhost==127.0.0.1?

by Varun Jain-5 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello Kartik,

Well to put that straight I am not much acquainted with drupal except that
it is an open source web management system.Checking its installation from
http://www.slideshare.net/a_rupeshkumar/drupal-xampp-xp-2-presentation the
database port is mostly set to default.In case of drupal this port is 3306
[voila :) ] and also the site name is set to localhost.
Now as per wiki *
"For IPv4 communications, the virtual loopback interface of a computer
system is normally assigned the address 127.0.0.1 with subnet
mask<http://en.wikipedia.org/wiki/Subnet_mask>
255.0.0.0. Depending on the specific operating system in use (notably in
Linux <http://en.wikipedia.org/wiki/Linux>) and the routing mechanisms
installed, this populates the routing
table<http://en.wikipedia.org/wiki/Routing_table>of the local system
with an entry so that packets destined to any address
from the 127.0.0.0/8 block would be routed internally to the network
loopback device."

*So this essentially means you can choose any address amongst the
127.0.0.0/8 and run drupal without any problem*.
*Now as far as other definitions in hosts file are concerned they deal with
configurations related to ipv6 address.For further details you can google
it.

Cheers ,
Varun :)
*
*


[Non-text portions of this message have been removed]


Re: localhost==127.0.0.1?

by Kartik Nayak-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

thnx :)

On Fri, Jul 3, 2009 at 5:42 PM, Varun Jain <varunjain003@...> wrote:

> Hello Kartik,
>
> Well to put that straight I am not much acquainted with drupal except that
> it is an open source web management system.Checking its installation from
> http://www.slideshare.net/a_rupeshkumar/drupal-xampp-xp-2-presentation the
> database port is mostly set to default.In case of drupal this port is 3306
> [voila :) ] and also the site name is set to localhost.
> Now as per wiki *
> "For IPv4 communications, the virtual loopback interface of a computer
> system is normally assigned the address 127.0.0.1 with subnet
> mask<http://en.wikipedia.org/wiki/Subnet_mask>
> 255.0.0.0. Depending on the specific operating system in use (notably in
> Linux <http://en.wikipedia.org/wiki/Linux>) and the routing mechanisms
> installed, this populates the routing
> table<http://en.wikipedia.org/wiki/Routing_table>of the local system
> with an entry so that packets destined to any address
> from the 127.0.0.0/8 block would be routed internally to the network
> loopback device."
>
> *So this essentially means you can choose any address amongst the
> 127.0.0.0/8 and run drupal without any problem*.
> *Now as far as other definitions in hosts file are concerned they deal with
> configurations related to ipv6 address.For further details you can google
> it.
>
> Cheers ,
> Varun :)
> *
> *
>
>
> [Non-text portions of this message have been removed]
>
>
>
> ------------------------------------
>
> http://twincling.org/
> http://twitter.com/twincling
> ----------------------------------------
> Yahoo! Groups Links
>
>
>
>


[Non-text portions of this message have been removed]