tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mike Curwen" <gb_...@gb-im.com>
Subject RE: JKMount, virtual hosts, and avoiding the webapp name
Date Wed, 03 Sep 2003 21:15:55 GMT
inlined replies...

> -----Original Message-----
> From: John Turner [mailto:tomcat-user@johnturner.com] 
> Sent: Wednesday, September 03, 2003 3:28 PM
> To: Tomcat Users List
> Subject: Re: JKMount, virtual hosts, and avoiding the webapp name
> 
> 

<snip />

> > But....  how do I match up the requests from apache's virtual host
> > www.foo.com to the /ATM context in Tomcat?  Am I looking at 
> creating a
> > new <Host> in Tomcat for each <VirtualHost> in apache?
> 
> Yes.
> 
> > And then the default webapp for each of my TC Hosts would 
> be the /ATM
> > application?
> 
> You mean sharing Contexts across Hosts?  I don't think so.
> 

Oops, I mispoke. We have a single application that we deploy multiple
contexts of, so that each virtual host has its own copy of the
application. So in my 'new' scheme, I'd specify that the default webapp
is this 'common' application, but not 'shared' in the sense you thought,
(because of my typing).

> Your Context path is just "" with the same docBase.  Then 
> your JkMounts are:
> 
> JkMount /*.jsp worker-name
> JkMount /something-typically-servlet/* ajp13
> 
> John
> 




So it's gonna be something like:

The Apache Vhost:
<VirtualHost xxx.xxx.xxx.xxx>
   JKMount /*.jsp tomcat1
   JKMount /fooservlet tomcat1
   DocumentRoot /home/webhome/atm/htdocs/
   ServerName www.foo.com
   ServerAlias foo.com
   ErrorLog /var/log/atm/error_log
   CustomLog /var/log/atm/access_log combined
</VirtualHost>

relates to the TC Host:
<Host name="www.foo.com" debug="0" appBase="webapps" unpackWARs="true">
 <Alias>foo.com</Alias>
 <Context path="" docBase="home/webhome/atm" debug="0"
reloadable="true"/>
</Host>


AND
<VirtualHost xxx.xxx.xxx.xxx>
   JKMount /*.jsp tomcat1
   JKMount /fooservlet tomcat1
   DocumentRoot /home/webhome/bdg/htdocs/
   ServerName www.foo2.com
   ServerAlias foo2.com
   ErrorLog /var/log/bdg/error_log
   CustomLog /var/log/bdg/access_log combined
</VirtualHost>

relates to the TC Host:
<Host name="www.foo2.com" debug="0" appBase="webapps" unpackWARs="true">
 <Alias>foo2.com</Alias>
 <Context path="" docBase="home/webhome/bdg" debug="0"
reloadable="true"/>
</Host>


 
Is that correct?  In this case, I'm replacing /ATM and /BDG apps with to
Hosts under TC, with the default Context set to be a separate instance
of that 'common' app.
 
I'm wondering about this from workers.properties:

  worker.list=tomcat1
  worker.tomcat1.host=localhost
 
Will I need to define a new work for each new host in TC,or can I supply
a comma separated list to the worker.tomcat1.host entry?
 
 
As for the 'illegal' and 'scary' mappings we have.. I'm sure we just
picked them up from googling and well, you know how valid some of the
info out there is.  We've also got some attributes on Contexts that I
can't find docos for. They don't seem to hurt though.  After I've ironed
out these issues, I'm doing a 'clean sweep' of all the files (after
backup of course) and 'HOWTO' for myself and colleagues at work. 
 
Thanks very much John. :)


Mime
View raw message