You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Josh Pollara <jp...@millennialmedia.com> on 2009/01/28 13:28:23 UTC

virtual hosts

Does Tomcat support wildcard virtual hosts?

I'm looking to do something like this:

      <Host name="example.com"  appBase="webapps"
        <Alias>*.example.com</Alias>
      </Host>

This does not work though. Any suggestions?

-josh


Re: virtual hosts

Posted by Serge Fonville <se...@gmail.com>.
Alternatively you may be able to create a wildcard CNAME in dns
Hope this helps.

Regards,

Serge Fonville

On Wed, Jan 28, 2009 at 2:25 PM, Serge Fonville <se...@gmail.com>wrote:

> On Wed, Jan 28, 2009 at 2:16 PM, Serge Fonville <se...@gmail.com>
>  wrote:
>
>> I tried it at my dev machine and added an alias to the host section for
>> *.domain.tldevery attempt to access a tomcat host on a resolvable address
>> works.
>>
>
> Sorry, my bad.
> I had only configured a default host.
>
> Probably then the only way to do this would put httpd in front of tomcat.
>
> Regards,
>
> Serge Fonville
>

Re: virtual hosts

Posted by Serge Fonville <se...@gmail.com>.
On Wed, Jan 28, 2009 at 2:16 PM, Serge Fonville <se...@gmail.com>
 wrote:

> I tried it at my dev machine and added an alias to the host section for
> *.domain.tldevery attempt to access a tomcat host on a resolvable address
> works.
>

Sorry, my bad.
I had only configured a default host.

Probably then the only way to do this would put httpd in front of tomcat.

Regards,

Serge Fonville

RE: virtual hosts

Posted by Josh Pollara <jp...@millennialmedia.com>.
Please paste your config because I just tried this and it does not work for me. What tomcat version are you using?


-----Original Message-----
From: Serge Fonville [mailto:serge.fonville@gmail.com]
Sent: Wed 1/28/2009 5:16 AM
To: Tomcat Users List
Subject: Re: virtual hosts
 
I tried it at my dev machine and added an alias to the host section for
*.domain.tldevery attempt to access a tomcat host on a resolvable address
works.

Hope this helps.

Regards,

Serge Fonville

On Wed, Jan 28, 2009 at 1:53 PM, Josh Pollara
<jp...@millennialmedia.com>wrote:

> I am making a transition from apache http -> tomcat. DNS is all configured
> correctly etc. example.com and *.example.com point to the same place.
>
> I'm quite certain that tomcat does not support wildcard virtual hosts, I
> just wanted to confirm with someone who was positive.
>
> -----Original Message-----
> From: Serge Fonville [mailto:serge.fonville@gmail.com]
> Sent: Wed 1/28/2009 4:50 AM
> To: Tomcat Users List
> Subject: Re: virtual hosts
>
> Hi,
>
> Is your dns properly configured?
> And what does your environment look like?
>
> Regards,
>
> Serge Fonville
>
> On Wed, Jan 28, 2009 at 1:28 PM, Josh Pollara
> <jp...@millennialmedia.com>wrote:
>
> > Does Tomcat support wildcard virtual hosts?
> >
> > I'm looking to do something like this:
> >
> >      <Host name="example.com"  appBase="webapps"
> >        <Alias>*.example.com</Alias>
> >      </Host>
> >
> > This does not work though. Any suggestions?
> >
> > -josh
> >
> >
>
>


Re: virtual hosts

Posted by Serge Fonville <se...@gmail.com>.
I tried it at my dev machine and added an alias to the host section for
*.domain.tldevery attempt to access a tomcat host on a resolvable address
works.

Hope this helps.

Regards,

Serge Fonville

On Wed, Jan 28, 2009 at 1:53 PM, Josh Pollara
<jp...@millennialmedia.com>wrote:

> I am making a transition from apache http -> tomcat. DNS is all configured
> correctly etc. example.com and *.example.com point to the same place.
>
> I'm quite certain that tomcat does not support wildcard virtual hosts, I
> just wanted to confirm with someone who was positive.
>
> -----Original Message-----
> From: Serge Fonville [mailto:serge.fonville@gmail.com]
> Sent: Wed 1/28/2009 4:50 AM
> To: Tomcat Users List
> Subject: Re: virtual hosts
>
> Hi,
>
> Is your dns properly configured?
> And what does your environment look like?
>
> Regards,
>
> Serge Fonville
>
> On Wed, Jan 28, 2009 at 1:28 PM, Josh Pollara
> <jp...@millennialmedia.com>wrote:
>
> > Does Tomcat support wildcard virtual hosts?
> >
> > I'm looking to do something like this:
> >
> >      <Host name="example.com"  appBase="webapps"
> >        <Alias>*.example.com</Alias>
> >      </Host>
> >
> > This does not work though. Any suggestions?
> >
> > -josh
> >
> >
>
>

Re: virtual hosts

Posted by Pid <p...@pidster.com>.
Josh Pollara wrote:
> I am making a transition from apache http -> tomcat. DNS is all configured correctly etc. example.com and *.example.com point to the same place.
> 
> I'm quite certain that tomcat does not support wildcard virtual hosts, I just wanted to confirm with someone who was positive.

It won't support multiple virtual Hosts, but you can set one webapp to
be the default Host - it will then catch all requests that fail to match
another Host.

Check the Engine config element.

p


> -----Original Message-----
> From: Serge Fonville [mailto:serge.fonville@gmail.com]
> Sent: Wed 1/28/2009 4:50 AM
> To: Tomcat Users List
> Subject: Re: virtual hosts
>  
> Hi,
> 
> Is your dns properly configured?
> And what does your environment look like?
> 
> Regards,
> 
> Serge Fonville
> 
> On Wed, Jan 28, 2009 at 1:28 PM, Josh Pollara
> <jp...@millennialmedia.com>wrote:
> 
>> Does Tomcat support wildcard virtual hosts?
>>
>> I'm looking to do something like this:
>>
>>      <Host name="example.com"  appBase="webapps"
>>        <Alias>*.example.com</Alias>
>>      </Host>
>>
>> This does not work though. Any suggestions?
>>
>> -josh
>>
>>
> 
> 


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


RE: virtual hosts

Posted by Josh Pollara <jp...@millennialmedia.com>.
I am making a transition from apache http -> tomcat. DNS is all configured correctly etc. example.com and *.example.com point to the same place.

I'm quite certain that tomcat does not support wildcard virtual hosts, I just wanted to confirm with someone who was positive.

-----Original Message-----
From: Serge Fonville [mailto:serge.fonville@gmail.com]
Sent: Wed 1/28/2009 4:50 AM
To: Tomcat Users List
Subject: Re: virtual hosts
 
Hi,

Is your dns properly configured?
And what does your environment look like?

Regards,

Serge Fonville

On Wed, Jan 28, 2009 at 1:28 PM, Josh Pollara
<jp...@millennialmedia.com>wrote:

> Does Tomcat support wildcard virtual hosts?
>
> I'm looking to do something like this:
>
>      <Host name="example.com"  appBase="webapps"
>        <Alias>*.example.com</Alias>
>      </Host>
>
> This does not work though. Any suggestions?
>
> -josh
>
>


Re: virtual hosts

Posted by Serge Fonville <se...@gmail.com>.
Hi,

Is your dns properly configured?
And what does your environment look like?

Regards,

Serge Fonville

On Wed, Jan 28, 2009 at 1:28 PM, Josh Pollara
<jp...@millennialmedia.com>wrote:

> Does Tomcat support wildcard virtual hosts?
>
> I'm looking to do something like this:
>
>      <Host name="example.com"  appBase="webapps"
>        <Alias>*.example.com</Alias>
>      </Host>
>
> This does not work though. Any suggestions?
>
> -josh
>
>