You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Michael Sharkey <sh...@yahoo.com> on 2005/03/11 22:45:36 UTC
host tag in server.xml
Hi - I am running tomcat 5.5 as a standalone web
server. I want to know how to use wildcards in the
host tag (or alias tag) so that when someone types
xxx.mydomain.com, the xxx can be anything at all and
they go to the same place. In apache, I know you could
say something like:
*.mydomain.com
This doesn't seem to work in tomcat. Any help would be
great! Thanks.
-mjs
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
Re: host tag in server.xml
Posted by Drew Jorgenson <de...@omniplatform.com>.
Hey Michael,
The way I do it is first of all set the wildcard in the DNS config for
the domain and point it to a certain IP address, e.g. * IN A 1.2.3.4
then I set up the virtual host in server.xml to contain the IP address
as an alias
<Host name="www.mydomain.com" debug="0" appBase="mydomain.com"
unpackWARs="true" autoDeploy="true">
<Alias>mydomain.com</Alias>
<Alias>1.2.3.4</Alias>
<Logger className="org.apache.catalina.logger.FileLogger"
directory="logs"
prefix="localhost_log." suffix=".txt" timestamp="true"
/>
<!-- Tomcat Root Context -->
<Context path="" docBase="ROOT" reloadable="true" debug="0"/>
</Host>
Now, everytime that the IP 1.2.3.4 is invoked through the browser it
points to the mydomain.com container, so all subdomains that resolve
through the wildcard to this IP address will also point to that
container.
Of course the drawback to that is that you need a dedicated IP address
to your domain.
Drew.
On Fri, 2005-03-11 at 13:45, Michael Sharkey wrote:
> Hi - I am running tomcat 5.5 as a standalone web
> server. I want to know how to use wildcards in the
> host tag (or alias tag) so that when someone types
> xxx.mydomain.com, the xxx can be anything at all and
> they go to the same place. In apache, I know you could
> say something like:
>
> *.mydomain.com
>
> This doesn't seem to work in tomcat. Any help would be
> great! Thanks.
>
>
> -mjs
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org