You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by chad kellerman <ck...@alabanza.com> on 2002/02/27 14:27:02 UTC

mulitple ports in server.xml

Good morning,

 It is my understanding that if I set multiple virtual hosts up in Apache 1.3.22/webapp module, for tomcat 4.0.1, the WebAppConnection directive for the virtual host section needs to contain a different port for the app to deploy.  This port corresponding to the port set in server.xml.

     Question,

      If I want multiple virtual hosts, how do I set up the server.xml to listen to multiple ports?

     Can I have multiple connectors under one serverice name?  For example:

<Server port="8005" shutdown"SHUTDOWN" debug="0">
	<Service name="Tomcat-Apache">
		<!-- for virtual host 1 -->
		<Connector="org.apache.catalina.connector.warp.WarpConnector"
		 port="8008" minProcessors="5" maxProcessors="50"
		 enableLookups="false" acceptCount="10" debug="0"/>

		<!-- for Virtual host 2 -->
                <Connector="org.apache.catalina.connector.warp.WarpConnector"
		 port="8009" minProcessors="5" maxProcessors="50"
		 enableLookups="false" acceptCount="10" debug="0"/>

       then the rest of the config...bla bla bla....


I have not been able to get this to work??  I have seen Named Based Virtual hosts work, but I want just Virtual Hosts.  Each domain will have their own ip address.

    I am stuck, can anyone offer any ideas that I might have over looked???


Thanks again,

-chad

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


Re: mulitple ports in server.xml

Posted by Jean-Luc BEAUDET <be...@toolchest.cyber.kodak.com>.
chad kellerman a écrit :

> Good morning,
>
>  It is my understanding that if I set multiple virtual hosts up in Apache 1.3.22/webapp module, for tomcat 4.0.1, the WebAppConnection directive for the virtual host section needs to contain a different port for the app to deploy.  This port corresponding to the port set in server.xml.
>
>      Question,
>
>       If I want multiple virtual hosts, how do I set up the server.xml to listen to multiple ports?
>
>      Can I have multiple connectors under one serverice name?  For example:
>
> <Server port="8005" shutdown"SHUTDOWN" debug="0">
>         <Service name="Tomcat-Apache">
>                 <!-- for virtual host 1 -->
>                 <Connector="org.apache.catalina.connector.warp.WarpConnector"
>                  port="8008" minProcessors="5" maxProcessors="50"
>                  enableLookups="false" acceptCount="10" debug="0"/>
>
>                 <!-- for Virtual host 2 -->
>                 <Connector="org.apache.catalina.connector.warp.WarpConnector"
>                  port="8009" minProcessors="5" maxProcessors="50"
>                  enableLookups="false" acceptCount="10" debug="0"/>
>
>        then the rest of the config...bla bla bla....
>
> I have not been able to get this to work??  I have seen Named Based Virtual hosts work, but I want just Virtual Hosts.  Each domain will have their own ip address.
>
>     I am stuck, can anyone offer any ideas that I might have over looked???
>
> Thanks again,
>
> -chad
>
> --
> To unsubscribe:   <ma...@jakarta.apache.org>
> For additional commands: <ma...@jakarta.apache.org>
> Troubles with the list: <ma...@jakarta.apache.org>

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)