You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Robert Walther <rw...@interchangedigital.com> on 2002/03/20 17:28:32 UTC

Multiple Tomcat 3.2.4 Instances

Thank you to those who have commented on the attached document.  Before I
revise it fully, I have two questions to pose to the group.

First, there was real distaste for my use of mod_rewrite in Apache to
redirect base URLs to their appropriate VirtualHosts ajp worker.

My goal was to redirect a client who simply put in 

http://www.site1.com/
to
http://www.site1.com/site1contextname/index.jsp

In Apache I used....
<VirtualHost 192.168.1.100:80>
	DocumentRoot “/contexts/site1/webapps/site1contextname
	ServerName site1.yourdomain.com
	ServerAdmin email of server admin
	JkMount /* ajp13_site1
	JkMount /servlet/* ajp13_site1
	JkMount /site1contextname/*.jsp ajp13_site1
	RewriteEngine On
	RewriteRule ^/$ /site1contextname/index.jsp [NC,R]
 </VirtualHost>

some people recommended I use mod_webapp while other recommended that I
use DirctoryIndex, but I am still unclear what is the best and fastest
method to do the redirect with mod_jk/Tomcat 3.2.4.  (ONE interesting note
was that Rewrite would only work if I put it after the JkMount Directives.
 When i put it before the JkMount's the incoming URL would be sent to the
index.html file in /$TOMCAT_HOME/webapps/ROOT. I belive this may have
something to do with web.xml but am not sure.)

My second question pertains to setting up a separate directory for each
Tomcat instance.  I copied the entire contents of $TOMCAT_HOME into a
separate directory that I set-up for each new site.

ex.
mkdir /context
mkdir /contexts/site1
mkdir /contexts/site2
cp -R /$TOMCAT_HOME /contexts/site1
cp -R /$TOMCAT_HOME /contexts/site2

I am aware that i can put all my site's contexts into the webapps
directory of /$TOMCAT_HOME, but I do have the space on my server to keep
the sites in their own directories and was worried that a single directory
structure would cause problems when I add lots of sites to this server. 
Any thoughts?

As i get more information I hope to modify the attached document and
resubmit it.  Thanks again for your time and comments.


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: Multiple Tomcat 4.0.2 instances

Posted by Jean-Luc BEAUDET <be...@toolchest.cyber.kodak.com>.
Chris Ruegger a щcrit :

> I should have been more specific earlier. I'm running Tomcat 4.0.2 and
> interested in setting
> up multiple instances on one machine. Any references greatly appreciated!
> -Chris
>
> --
> To unsubscribe:   <ma...@jakarta.apache.org>
> For additional commands: <ma...@jakarta.apache.org>
> Troubles with the list: <ma...@jakarta.apache.org>

Well, Chris.

I'm using TC 4.0.2/Warp 1.0.2 associated. I compiled both of them with
2.95.3 gcc on SOLARIS 8.

I send yu the explanations i gave other guy who asked for the same stuff.

Well yu can do some instances of Tomcat.
It works well.

All yu have to do it's to define different CATALINA_BASE directories and to
build them
as the master.

i.e:

assume the first one by /web/Tomcat1
copy $CATALINA_HOME/conf in /web/Tomcat1/conf
create /web/Tomcat1
./logs
./work
./webapps

configure the /web/Tomcat1/Conf/server.xml

<Server port="8015" shutdown="SHUTDOWN" debug="0">    # yu set a port <>
than other
../..



  <!-- Define an Apache-Connector Service -->
  <Service name="Tomcat-Apache">

    <Connector className="org.apache.catalina.connector.warp.WarpConnector"
               port="8018" minProcessors="5" maxProcessors="75"     # yu set
a
connection port <> than other
               enableLookups="true" appBase="webapps"
               acceptCount="10" debug="0"/>

    <!-- Replace "localhost" with what your Apache "ServerName" is set to
-->
    <Engine className="org.apache.catalina.connector.warp.WarpEngine"
../..

Yu have now a brand new instanciation of the main Tomcat - realize then yu
have no
obligation to run it..

Now yu can start it with something like that
$CATALINA_HOME/bin/Tomcat1_startup.sh

Tomcat1_startup.sh:

#!/bin/sh -x
#
-----------------------------------------------------------------------------

# Start script for the CATALINA Server
#
# $Id: shutdown.sh,v 1.1.4.1 2002/01/30 18:10:40 patrickl Exp $
#
# V1.0  021902  Adapted for Cecile DELPONT by JLB on 02/19/2002
#
-----------------------------------------------------------------------------

JAVA_HOME="My_Java_Dir"
CATALINA_HOME="My_Tomcat_Dir"
CATALINA_BASE="/web/Tomcat1"

export JAVA_HOME CATALINA_HOME CATALINA_BASE

BASEDIR=`dirname $0`

$CATALINA_HOME/bin/catalina.sh start "$@"

Same modification for the stop with Tomcat1_shutdown.sh

If yu got Apache with Warp Connector, just declare as many connectors than
Tomcat
instances.

Virtual host 1
WebAppConnection WarpConnector warp localhost:8008

Virtual Host 2
WebAppConnection Cecile_Warp    warp    localhost:8018

And that's it, boy.

Hope this will help.

Jean-Luc B :0)




--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Multiple Tomcat 4.0.2 instances

Posted by Chris Ruegger <cr...@speakeasy.net>.
I should have been more specific earlier. I'm running Tomcat 4.0.2 and
interested in setting
up multiple instances on one machine. Any references greatly appreciated!
-Chris




--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>