Forum Moderators: phranque

Message Too Old, No Replies

Secondary Domain on Tomcat

Howto configure a secondary domain for tomcat

         

zuko105

5:14 am on Feb 6, 2004 (gmt 0)

10+ Year Member



Just curious if anyone can help out a novice on tomcat configuration.

I am trying to setup a simple secondary domain that will use request headers from the browser client to identify which directory it will use to server files from.

I remember in apache it was only a few lines of definitions. "virtual host" I think it was.

Anyways, any help would be well appreciated.

Oh yeah...I'm using standalone version of Tomcat 5.x.

Thanks in advance.

Zuko

zuko105

5:24 am on Feb 6, 2004 (gmt 0)

10+ Year Member



Nevermind.
I sorted it out.

Here is an example of what I found:

in CATALINA_HOME/conf/server.xml

<Host name="mydomain0.com" debug="0" appBase="webapps" unpackWARs="true">
<Alias>www.mydomain0.com</Alias>
<Logger className="org.apache.catalina.logger.FileLogger"
directory="logs" prefix="mydomain0." suffix=".log" timestamp="true"/>
<Context path="" docBase="mydomain0" debug="0" reloadable="true"/>
<Context path="/test" docBase="mydomain0" debug="0" reloadable="true"/>
</Host>
<Host name="mydomain1.com" debug="0" appBase="webapps" unpackWARs="true">
<Alias>www.mydomain1.com</Alias>
<Logger className="org.apache.catalina.logger.FileLogger"
directory="logs" prefix="mydomain1." suffix=".log" timestamp="true"/>
<Context path="" docBase="mydomain1" debug="0" reloadable="true"/>
<Context path="/test" docBase="mydomain1" debug="0" reloadable="true"/>
</Host>
<Host name="mydomain2.com" debug="0" appBase="webapps" unpackWARs="true">
<Alias>www.mydomain2.com</Alias>
<Logger className="org.apache.catalina.logger.FileLogger"
directory="logs" prefix="mydomain2." suffix=".log" timestamp="true"/>
<Context path="" docBase="mydomain2" debug="0" reloadable="true"/>
<Context path="/test" docBase="mydomain2" debug="0" reloadable="true"/>
</Host>