You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Tom Chiverton <tc...@extravision.com> on 2020/08/24 12:14:05 UTC

Tomcat 9 : Unable to specify wildcard care name in Host

The docs at https://tomcat.apache.org/tomcat-9.0-doc/config/host.html 
say I should be able to use a name attribute starting "*." to use 
wildcard hosts in Tomcat's server.xml

I have downloaded the 9.0.37 distribution and replaced the default

<Host name="localhost"  appBase="webapps"
             unpackWARs="true" autoDeploy="true">

...

</Host>

with

<Host name="*.dev.foo.co.uk" unpackWARs="true" autoDeploy="true"
   >
   <Context path="" docBase="/tmp" /></Host>

<Host name="localhost" unpackWARs="true" autoDeploy="true" >
   <Context path="" docBase="/tmp" /></Host>

however Tomcat fails to deploy, logging "SEVERE [main] 
org.apache.tomcat.util.modeler.Registry.registerComponent Error 
registering MBean" ultimately "Caused by: 
java.lang.IllegalArgumentException: Repository: cannot add mbean for 
pattern name Catalina:type=Host,host=*.dev.foo.co.uk

Am I mis-reading the docs ?

Tom Chiverton --
*Tom Chiverton*
Lead Developer
e: 	tc@extravision.com <ma...@extravision.com>
p: 	0161‌ 817‌ 2929
t: 	@extravision
w: 	extravision‌.com‌

Extravision <https://www.extravision.com>

Registered in the UK at: Tomorrow‌, MediaCityUK‌, Salford‌ M50‌ 2AB.
Company Reg No: 05017214‌ VAT: GB 824‌ 5386‌ 19

This e-mail is intended solely for the person to whom it is addressed 
and may contain confidential or privileged information. Any views or 
opinions presented in this e-mail are solely of the author and do not 
necessarily represent those of Extravision Ltd.



______________________________________________________________________
This email has been scanned by the Symantec Email Security.cloud service.
For more information please visit http://www.symanteccloud.com
______________________________________________________________________

Re: Tomcat 9 : Unable to specify wildcard care name in Host

Posted by Mark Thomas <ma...@apache.org>.
On 24/08/2020 13:14, Tom Chiverton wrote:

<snip/>

> Am I mis-reading the docs ?

Yes.

The relevant part is:

"Aliases may also use the wildcard form"

Alias is a sub-element of Host. The name element of Host needs to use a
valid host name.

Mark


> 
> Tom Chiverton --
> *Tom Chiverton*
> Lead Developer
> e:     tc@extravision.com <ma...@extravision.com>
> p:     0161‌ 817‌ 2929
> t:     @extravision
> w:     extravision‌.com‌
> 
> Extravision <https://www.extravision.com>
> 
> Registered in the UK at: Tomorrow‌, MediaCityUK‌, Salford‌ M50‌ 2AB.
> Company Reg No: 05017214‌ VAT: GB 824‌ 5386‌ 19
> 
> This e-mail is intended solely for the person to whom it is addressed
> and may contain confidential or privileged information. Any views or
> opinions presented in this e-mail are solely of the author and do not
> necessarily represent those of Extravision Ltd.
> 
> 
> 
> ______________________________________________________________________
> This email has been scanned by the Symantec Email Security.cloud service.
> For more information please visit http://www.symanteccloud.com
> ______________________________________________________________________

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


Re: Tomcat 9 : Unable to specify wildcard care name in Host

Posted by Martin Grigorov <mg...@apache.org>.
On Tue, Aug 25, 2020 at 3:01 PM Tom Chiverton <tc...@extravision.com> wrote:

> I'd like to propose some changes to the docs, but can not locate their
> source to submit a request.
>

https://github.com/apache/tomcat/blob/master/webapps/docs/config/host.xml
This is for Tomcat 10.x (master branch).


>
> For instance, in https://tomcat.apache.org/tomcat-9.0-doc/config/host.html
>
> "If the name takes the form of |*.domainname| (e.g. |*.apache.org|) then
> it will be treated as a match for any host in that domain unless a host
> that has an exactly matching name is found."
>
> would be clearer as
>
> "The name can not contain a wildcard (e.g. |*.apache.org|), this is only
> valid in an Alias."
>
> And then in
> https://tomcat.apache.org/tomcat-9.0-doc/config/host.html#Host_Name_Aliases
>
> "Aliases may also use the wildcard form (|*.domainname|) permitted for
> the *name* attribute of a *Host*."
>
> to
>
> "Aliases may also use the wildcard form (|*.domainname|), unlike for the
> name attribute of a Host**."
>
> On 24/08/2020 13:14, Tom Chiverton wrote:
> > Am I mis-reading the docs ?
>
>
> ______________________________________________________________________
> This email has been scanned by the Symantec Email Security.cloud service.
> For more information please visit http://www.symanteccloud.com
> ______________________________________________________________________

Re: Tomcat 9 : Unable to specify wildcard care name in Host

Posted by Tom Chiverton <tc...@extravision.com>.
I'd like to propose some changes to the docs, but can not locate their 
source to submit a request.

For instance, in https://tomcat.apache.org/tomcat-9.0-doc/config/host.html

"If the name takes the form of |*.domainname| (e.g. |*.apache.org|) then 
it will be treated as a match for any host in that domain unless a host 
that has an exactly matching name is found."

would be clearer as

"The name can not contain a wildcard (e.g. |*.apache.org|), this is only 
valid in an Alias."

And then in 
https://tomcat.apache.org/tomcat-9.0-doc/config/host.html#Host_Name_Aliases

"Aliases may also use the wildcard form (|*.domainname|) permitted for 
the *name* attribute of a *Host*."

to

"Aliases may also use the wildcard form (|*.domainname|), unlike for the 
name attribute of a Host**."

On 24/08/2020 13:14, Tom Chiverton wrote:
> Am I mis-reading the docs ? 


______________________________________________________________________
This email has been scanned by the Symantec Email Security.cloud service.
For more information please visit http://www.symanteccloud.com
______________________________________________________________________