You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Mark Thomas <ma...@apache.org> on 2010/07/15 14:51:04 UTC

[PROPOSAL] Change the name of the default host in server.xml

I'm teaching a Tomcat course today and tomorrow and one of the students 
raised the question why is the default host called localhost? The 
implied relationship to 127.0.0.1 was causing confusion. That got me 
thinking:

1. Is there a better name for the default host

2. If there is, should we change it in Tomcat 7?

Users are familiar with localhost and I am worried that changing it will 
cause more problems than it solves. What do folks think? Should we 
change the name of the default host to "default", "defaulthost" or 
something similar for Tomcat 7 or should we just leave it.

I have an slight preference for changing it to "defaulthost" but only 
just. Thoughts? Would this question be better on the users list?

Mark



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: [PROPOSAL] Change the name of the default host in server.xml

Posted by Pid <pi...@pidster.com>.
On 15 Jul 2010, at 16:32, Tim Funk <fu...@apache.org> wrote:

> IIRC, there is no requirement. But from a mapping point of view, the name used should match what the browser is sending in the "Host:" field.

Except when the request is deliberately being directed to the defaultHost - which is frequently the case.


> Tomcat (iirc) doens't do any lookups based on the name field for Host so from that point of view - life in DNS is OK.
> 
> But to access the tomcat server - the user needs to type some address (name/ip) into the browser.
> 
> Where I am going with this is the chance of odd side effect. Let's say we choose "default" as the host name. So for some reason (where I can't think of a use case) - the admin then types in http://default/ to their browser. Their browser does the DNS lookup and goes to whatever DNS says. Which is probably not the tomcat instance.

Agreed.

Possible solution: set the name property to something not in DNS, but meaningful (tomcatDefault, or whatever), add an alias for localhost - which would also be educational for new users.


p

> So long story short ... my worry is a stretch, bordering fantasy-land. (which is why i am -0 but swayable) But in apache, there used to be warnings in various configs about using host names in various places instead of IP addresses due to relying on DNS.
> 
> 
> 
> -Tim
> 
> On 7/15/2010 11:11 AM, Mark Thomas wrote:
>> On 15/07/2010 15:16, Tim Funk wrote:
>>> -0
>>> 
>>> Since the host name should be a valid dns name(ok it doesn't need to be
>>> a valid dns name if <Alias> is used), choosing a default which doesn't
>>> have a valid dns name may cause woes.
>> 
>> If it does need to be a valid dns name then localhost absolutely makes
>> sense. Where is that requirement coming from? I can think of anywhere
>> off the top of my head.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: dev-help@tomcat.apache.org
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: [PROPOSAL] Change the name of the default host in server.xml

Posted by Tim Funk <fu...@apache.org>.
IIRC, there is no requirement. But from a mapping point of view, the 
name used should match what the browser is sending in the "Host:" field.

Tomcat (iirc) doens't do any lookups based on the name field for Host so 
from that point of view - life in DNS is OK.

But to access the tomcat server - the user needs to type some address 
(name/ip) into the browser.

Where I am going with this is the chance of odd side effect. Let's say 
we choose "default" as the host name. So for some reason (where I can't 
think of a use case) - the admin then types in http://default/ to their 
browser. Their browser does the DNS lookup and goes to whatever DNS 
says. Which is probably not the tomcat instance.

So long story short ... my worry is a stretch, bordering fantasy-land. 
(which is why i am -0 but swayable) But in apache, there used to be 
warnings in various configs about using host names in various places 
instead of IP addresses due to relying on DNS.



-Tim

On 7/15/2010 11:11 AM, Mark Thomas wrote:
> On 15/07/2010 15:16, Tim Funk wrote:
>> -0
>>
>> Since the host name should be a valid dns name(ok it doesn't need to be
>> a valid dns name if <Alias> is used), choosing a default which doesn't
>> have a valid dns name may cause woes.
>
> If it does need to be a valid dns name then localhost absolutely makes
> sense. Where is that requirement coming from? I can think of anywhere
> off the top of my head.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: [PROPOSAL] Change the name of the default host in server.xml

Posted by Costin Manolache <co...@gmail.com>.
On Thu, Jul 15, 2010 at 8:11 AM, Mark Thomas <ma...@apache.org> wrote:

> On 15/07/2010 15:16, Tim Funk wrote:
>
>> -0
>>
>> Since the host name should be a valid dns name(ok it doesn't need to be
>> a valid dns name if <Alias> is used), choosing a default which doesn't
>> have a valid dns name may cause woes.
>>
>
> If it does need to be a valid dns name then localhost absolutely makes
> sense. Where is that requirement coming from? I can think of anywhere off
> the top of my head.
>

The browser needs a valid dns name, which goes to the Host: header.

What are other servlet engines using ? If most use a certain word - it may
be ok to use it too, for
consistency. Otherwise - it's not worth confusing all existing users with a
cosmetic change.

Costin


>
> Mark
>
>
>
>
>> But if someone came up with a fantastic alternate default name, then I
>> could be swayed.
>>
>>
>> -Tim
>>
>> On 7/15/2010 8:51 AM, Mark Thomas wrote:
>>
>>> I'm teaching a Tomcat course today and tomorrow and one of the students
>>> raised the question why is the default host called localhost? The
>>> implied relationship to 127.0.0.1 was causing confusion. That got me
>>> thinking:
>>>
>>> 1. Is there a better name for the default host
>>>
>>> 2. If there is, should we change it in Tomcat 7?
>>>
>>> Users are familiar with localhost and I am worried that changing it will
>>> cause more problems than it solves. What do folks think? Should we
>>> change the name of the default host to "default", "defaulthost" or
>>> something similar for Tomcat 7 or should we just leave it.
>>>
>>> I have an slight preference for changing it to "defaulthost" but only
>>> just. Thoughts? Would this question be better on the users list?
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: dev-help@tomcat.apache.org
>>
>>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: dev-help@tomcat.apache.org
>
>

Re: [PROPOSAL] Change the name of the default host in server.xml

Posted by Mark Thomas <ma...@apache.org>.
On 15/07/2010 15:16, Tim Funk wrote:
> -0
>
> Since the host name should be a valid dns name(ok it doesn't need to be
> a valid dns name if <Alias> is used), choosing a default which doesn't
> have a valid dns name may cause woes.

If it does need to be a valid dns name then localhost absolutely makes 
sense. Where is that requirement coming from? I can think of anywhere 
off the top of my head.

Mark


>
> But if someone came up with a fantastic alternate default name, then I
> could be swayed.
>
>
> -Tim
>
> On 7/15/2010 8:51 AM, Mark Thomas wrote:
>> I'm teaching a Tomcat course today and tomorrow and one of the students
>> raised the question why is the default host called localhost? The
>> implied relationship to 127.0.0.1 was causing confusion. That got me
>> thinking:
>>
>> 1. Is there a better name for the default host
>>
>> 2. If there is, should we change it in Tomcat 7?
>>
>> Users are familiar with localhost and I am worried that changing it will
>> cause more problems than it solves. What do folks think? Should we
>> change the name of the default host to "default", "defaulthost" or
>> something similar for Tomcat 7 or should we just leave it.
>>
>> I have an slight preference for changing it to "defaulthost" but only
>> just. Thoughts? Would this question be better on the users list?
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: dev-help@tomcat.apache.org
>




---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: [PROPOSAL] Change the name of the default host in server.xml

Posted by Tim Funk <fu...@apache.org>.
-0

Since the host name should be a valid dns name(ok it doesn't need to be 
a valid dns name if <Alias> is used), choosing a default which doesn't 
have a valid dns name may cause woes.

But if someone came up with a fantastic alternate default name, then I 
could be swayed.


-Tim

On 7/15/2010 8:51 AM, Mark Thomas wrote:
> I'm teaching a Tomcat course today and tomorrow and one of the students
> raised the question why is the default host called localhost? The
> implied relationship to 127.0.0.1 was causing confusion. That got me
> thinking:
>
> 1. Is there a better name for the default host
>
> 2. If there is, should we change it in Tomcat 7?
>
> Users are familiar with localhost and I am worried that changing it will
> cause more problems than it solves. What do folks think? Should we
> change the name of the default host to "default", "defaulthost" or
> something similar for Tomcat 7 or should we just leave it.
>
> I have an slight preference for changing it to "defaulthost" but only
> just. Thoughts? Would this question be better on the users list?

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: [PROPOSAL] Change the name of the default host in server.xml

Posted by Ian Darwin <ia...@darwinsys.com>.
On Thu, Jul 15, 2010 at 01:51:04PM +0100, Mark Thomas wrote:
> I'm teaching a Tomcat course today and tomorrow and one of the students 
> raised the question why is the default host called localhost? The 
> implied relationship to 127.0.0.1 was causing confusion. That got me 
> thinking:

I am about -0.25 to changing it; on most machines it *is* 127.0.0.1 in addition
to any external interfaces, and as you point out everybody knows it, but
defaulthost probably is a better name in the long run, as it breaks the
implied necessary connection to the loopback host. OTOH, in training courses
and in development you often use a URL of http://localhost:8080/ and the
association there is good.

If you've only had one student have a problem with it, maybe it's not
worth fussing over? :-)

Ian

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: [PROPOSAL] Change the name of the default host in server.xml

Posted by "William A. Rowe Jr." <wr...@rowe-clan.net>.
On 7/15/2010 9:44 PM, Yoav Shapira wrote:
> On Thu, Jul 15, 2010 at 8:51 AM, Mark Thomas <ma...@apache.org> wrote:
>> I'm teaching a Tomcat course today and tomorrow and one of the students
>> raised the question why is the default host called localhost? The implied
>> relationship to 127.0.0.1 was causing confusion. That got me thinking:
>>
>> 1. Is there a better name for the default host
>>
>> 2. If there is, should we change it in Tomcat 7?
> 
> -0 like the other folks.  The risks of changing it outweigh the benefits.

Believe it or not, 'localhost' is not absolutely portable, and broken without
all that much effort.  '127.0.0.1' is actually safer for the current design.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: [PROPOSAL] Change the name of the default host in server.xml

Posted by Yoav Shapira <yo...@apache.org>.
On Thu, Jul 15, 2010 at 8:51 AM, Mark Thomas <ma...@apache.org> wrote:
> I'm teaching a Tomcat course today and tomorrow and one of the students
> raised the question why is the default host called localhost? The implied
> relationship to 127.0.0.1 was causing confusion. That got me thinking:
>
> 1. Is there a better name for the default host
>
> 2. If there is, should we change it in Tomcat 7?

-0 like the other folks.  The risks of changing it outweigh the benefits.

Yoav

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: [PROPOSAL] Change the name of the default host in server.xml

Posted by Rainer Jung <ra...@kippdata.de>.
On 15.07.2010 15:34, Konstantin Kolinko wrote:
> 2010/7/15 Mark Thomas<ma...@apache.org>:
>> I'm teaching a Tomcat course today and tomorrow and one of the students
>> raised the question why is the default host called localhost? The implied
>> relationship to 127.0.0.1 was causing confusion. That got me thinking:
>>
>> 1. Is there a better name for the default host
>>
>
> I like "localhost" as it is now, because.
>
> 1) This name is well known as special.
>
> 2) If you setup virtual hosts, it does not conflict with the other
> virtual hosts.
>
> 3) When you are setting up virtual hosts there has to be some default.
> One easy way to test it is to access the server locally.
>
> 4) There is a chance that whatever new name you offer, it will be
> registered as domain name by somebody. E.g. "defaulthost" is already
> used by some hosting provider.
>
> Best regards,
> Konstantin Kolinko

I'm slightly on the side of Konstantin, leave as is.

Regards,

Rainer


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: [PROPOSAL] Change the name of the default host in server.xml

Posted by Konstantin Kolinko <kn...@gmail.com>.
2010/7/15 Mark Thomas <ma...@apache.org>:
> I'm teaching a Tomcat course today and tomorrow and one of the students
> raised the question why is the default host called localhost? The implied
> relationship to 127.0.0.1 was causing confusion. That got me thinking:
>
> 1. Is there a better name for the default host
>

I like "localhost" as it is now, because.

1) This name is well known as special.

2) If you setup virtual hosts, it does not conflict with the other
virtual hosts.

3) When you are setting up virtual hosts there has to be some default.
One easy way to test it is to access the server locally.

4) There is a chance that whatever new name you offer, it will be
registered as domain name by somebody. E.g. "defaulthost" is already
used by some hosting provider.

Best regards,
Konstantin Kolinko

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org