You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Ishtiaq Ahmed <is...@ooober.com> on 2007/12/26 08:20:21 UTC

Subdomain Virtual Hosting.

Hi,

I am facing a little problem in Tomcat 6 Configurations. multiple 
applications deployed under $TOMCAT_HOME/webapps  under Linux OS.

$TOMCAT_HOME/webapps/APP1
$TOMCAT_HOME/webapps/APP2
$TOMCAT_HOME/webapps/APP3

Virtual hosts has been set up to access each with its specific DNS 
resolutions.


APP1.mydomain.com ----> $TOMCAT_HOME/webapps/APP1
APP2.mydomain.com ----> $TOMCAT_HOME/webapps/APP2
APP3.mydomain.com ----> $TOMCAT_HOME/webapps/APP3


Everything works fine using the following syntax

<Host name="APP1.mydomain.com"

      appBase="/usr/local/tomcat6/webapps/APP1"
      unpackWARs="true"
      autoDeploy="true"
      xmlValidation="false"
      xmlNamespaceAware="false">
       <Context path="" docBase="/usr/local/tomcat6/webapps/APP1"
      debug="0" reloadable="false"/>

</Host>


Now we want it But when we tried it for *.mydomain2.com (Notice that * )
if I go like under, it doesn't work. Kindly shed some light into it.

<Host name="*.mydomain2.com"

      appBase="/usr/local/tomcat6/webapps/APPx"
      unpackWARs="true"
      autoDeploy="true"
      xmlValidation="false"
      xmlNamespaceAware="false">
       <Context path="" docBase="/usr/local/tomcat6/webapps/APPx"
      debug="0" reloadable="false"/>

</Host>

I hope you understand my problem its about * (Subdomains) to be routed 
to different context path.

Regards,

Ishtiaq Ahmed

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


Re: Subdomain Virtual Hosting.

Posted by david delbecq <de...@oma.be>.
Use an apache http proxy that does *.mydomain2.com to 
http://internaltomcat/appX proxying and *.mydomain3.com to 
http://internaltomcat/appY then. Tomcat in itself has no such rules 
support i know of.

Note that you are not forced to use the ROOT for defualtHost :)

Ishtiaq Ahmed a écrit :
> Good Day David,
>
> Its nice to see your reply. I tried the ROOT folder for all 
> unconfigured domain names but developers are not satisfied with the 
> settings. I need to redirect *.mydomain2.com's traffic to that 
> specific context of $CATALINA_HOME/webapps/APPx. As the same server 
> would be serving for *.mydomain3.com's requests in future too.
>
> Looking Forward for resolution from you...
>
> Regards,
>
> Ishtiaq Ahmed
>
>
>
> david delbecq wrote:
>> Ishtiaq Ahmed a écrit :
>>> Hi,
>>> Now we want it But when we tried it for *.mydomain2.com (Notice that 
>>> * )
>>> if I go like under, it doesn't work. Kindly shed some light into it.
>>>
>>> <Host name="*.mydomain2.com"
>>>
>>>      appBase="/usr/local/tomcat6/webapps/APPx"
>>>      unpackWARs="true"
>>>      autoDeploy="true"
>>>      xmlValidation="false"
>>>      xmlNamespaceAware="false">
>>>       <Context path="" docBase="/usr/local/tomcat6/webapps/APPx"
>>>      debug="0" reloadable="false"/>
>>>
>>> </Host>
>>>
>>> I hope you understand my problem its about * (Subdomains) to be 
>>> routed to different context path.
>>>
>> Simply put, you can't. If you want to redirect users of unconfigured 
>> domains to a specific webapp, use the defaultHost attribute of the 
>> Engine context. The name attribute of the Host context is "Network 
>> name of this virtual host, as registered in your Domain Name Service 
>> server.", as mentionned in docs. If you want more complex rules, you 
>> might need to configure an appache httpd front-end that does the 
>> dispatching.
>>> Regards,
>>>
>>> Ishtiaq Ahmed
>>>
>>> ---------------------------------------------------------------------
>>> To start a new topic, e-mail: users@tomcat.apache.org
>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
>> ---------------------------------------------------------------------
>> To start a new topic, e-mail: users@tomcat.apache.org
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org


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


Re: Subdomain Virtual Hosting.

Posted by Ishtiaq Ahmed <is...@ooober.com>.
Good Day David,

Its nice to see your reply. I tried the ROOT folder for all unconfigured 
domain names but developers are not satisfied with the settings. I need 
to redirect *.mydomain2.com's traffic to that specific context of 
$CATALINA_HOME/webapps/APPx. As the same server would be serving for 
*.mydomain3.com's requests in future too.

Looking Forward for resolution from you...

Regards,

Ishtiaq Ahmed



david delbecq wrote:
> Ishtiaq Ahmed a écrit :
>> Hi,
>> Now we want it But when we tried it for *.mydomain2.com (Notice that * )
>> if I go like under, it doesn't work. Kindly shed some light into it.
>>
>> <Host name="*.mydomain2.com"
>>
>>      appBase="/usr/local/tomcat6/webapps/APPx"
>>      unpackWARs="true"
>>      autoDeploy="true"
>>      xmlValidation="false"
>>      xmlNamespaceAware="false">
>>       <Context path="" docBase="/usr/local/tomcat6/webapps/APPx"
>>      debug="0" reloadable="false"/>
>>
>> </Host>
>>
>> I hope you understand my problem its about * (Subdomains) to be 
>> routed to different context path.
>>
> Simply put, you can't. If you want to redirect users of unconfigured 
> domains to a specific webapp, use the defaultHost attribute of the 
> Engine context. The name attribute of the Host context is "Network 
> name of this virtual host, as registered in your Domain Name Service 
> server.", as mentionned in docs. If you want more complex rules, you 
> might need to configure an appache httpd front-end that does the 
> dispatching.
>> Regards,
>>
>> Ishtiaq Ahmed
>>
>> ---------------------------------------------------------------------
>> To start a new topic, e-mail: users@tomcat.apache.org
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>


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


Re: Subdomain Virtual Hosting.

Posted by david delbecq <de...@oma.be>.
Ishtiaq Ahmed a écrit :
> Hi,
> Now we want it But when we tried it for *.mydomain2.com (Notice that * )
> if I go like under, it doesn't work. Kindly shed some light into it.
>
> <Host name="*.mydomain2.com"
>
>      appBase="/usr/local/tomcat6/webapps/APPx"
>      unpackWARs="true"
>      autoDeploy="true"
>      xmlValidation="false"
>      xmlNamespaceAware="false">
>       <Context path="" docBase="/usr/local/tomcat6/webapps/APPx"
>      debug="0" reloadable="false"/>
>
> </Host>
>
> I hope you understand my problem its about * (Subdomains) to be routed 
> to different context path.
>
Simply put, you can't. If you want to redirect users of unconfigured 
domains to a specific webapp, use the defaultHost attribute of the 
Engine context. The name attribute of the Host context is "Network name 
of this virtual host, as registered in your Domain Name Service 
server.", as mentionned in docs. If you want more complex rules, you 
might need to configure an appache httpd front-end that does the 
dispatching.
> Regards,
>
> Ishtiaq Ahmed
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org


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