You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Ridwan <ri...@chemwatch.net> on 2008/11/06 13:28:56 UTC

Tomcat multiple sub domain names configuration

Hi,

I Need some help. I have Java applications running in Apache Tomcat
6.0.16 from port 80 from a Windows 2003 server. It can be accessed say
by the URL http://site1.mycompany.net/MyApplication where MyApplication
is actually a Java application folder name under the
$CATALINA_HOME/webapps/ path. It hosts few other Java application
folders under the same.

But now I want the URL http://site2.mycompany.net to go directly to the
$CATALINA_HOME/webapps/MyApplication folder. How do I do it?

Both the sub domains of mycompany.net, that is, site1.mycompany.net and
site2.mycompany.net point to the same IP address of the server. Now
typing both of those will just bring the Tomcat's home page from the
$CATALINA_HOME/webapps/ROOT folder.

Thanks and Regards
Ridwan Ahmed
Web Systems Manager



________________________________________________________________________

This email has been scanned for all viruses by the MessageLabs SkyScan
service. For more information on a proactive anti-virus service working
around the clock, around the globe, visit http://www.messagelabs.com
________________________________________________________________________

---------------------------------------------------------------------
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: Tomcat multiple sub domain names configuration

Posted by Serge Fonville <se...@gmail.com>.
Either create a new host in server.xml with a different appBase or check for
the request url and perform a redirect
Regards,

Serge Fonville

On Thu, Nov 6, 2008 at 1:28 PM, Ridwan <ri...@chemwatch.net> wrote:

> Hi,
>
> I Need some help. I have Java applications running in Apache Tomcat
> 6.0.16 from port 80 from a Windows 2003 server. It can be accessed say
> by the URL http://site1.mycompany.net/MyApplication where MyApplication
> is actually a Java application folder name under the
> $CATALINA_HOME/webapps/ path. It hosts few other Java application
> folders under the same.
>
> But now I want the URL http://site2.mycompany.net to go directly to the
> $CATALINA_HOME/webapps/MyApplication folder. How do I do it?
>
> Both the sub domains of mycompany.net, that is, site1.mycompany.net and
> site2.mycompany.net point to the same IP address of the server. Now
> typing both of those will just bring the Tomcat's home page from the
> $CATALINA_HOME/webapps/ROOT folder.
>
> Thanks and Regards
> Ridwan Ahmed
> Web Systems Manager
>
>
>
> ________________________________________________________________________
>
> This email has been scanned for all viruses by the MessageLabs SkyScan
> service. For more information on a proactive anti-virus service working
> around the clock, around the globe, visit http://www.messagelabs.com
> ________________________________________________________________________
>
> ---------------------------------------------------------------------
> 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: Tomcat multiple sub domain names configuration

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Ridwan [mailto:ridwan@chemwatch.net]
> Subject: Tomcat multiple sub domain names configuration
>
> typing both of those will just bring the Tomcat's home page from the
> $CATALINA_HOME/webapps/ROOT folder.

The easiest way is to simply delete Tomcat's ROOT directory, and rename MyApplication to ROOT.

If you want to do it the hard way and keep the Tomcat default page for site1, you'll need to configure virtual hosting:
http://tomcat.apache.org/tomcat-6.0-doc/virtual-hosting-howto.html

You'll need to have separate appBase directories for the two <Host>s.  You can deploy your webapp as ROOT in the site2 host, or you could have a dummy ROOT webapp that just redirects to site1/MyApplication.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.

---------------------------------------------------------------------
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