tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Blunck <blu...@gst.com>
Subject specify path to server.xml, specify listen port
Date Mon, 12 Jan 2004 20:50:17 GMT
Hi all-

Knowing how to perform one of the following two tasks would greatly simplify
my management scripts.  I'm not sure if they are even possible.  If so, I'd
be grateful for anyone sharing the information.

#1: Set the path to server.xml in catalina.sh
I want to use a server.xml that's located some place other than in the conf
directory in the file server.xml.  Is this possible?

#2: Set the connector port via a command line option in catalina.sh
I want to define which port I want Catalina to listen on when it starts up.
It'd be nice to be able to specify this as a command line argument to the
VM:  something like -DlistenPort=8080.  Is this possible?


Here's what I'm trying to do, and maybe somebody will offer a better solution.


We have an EJB application, wrapped by SOAP.  We deploy SOAP inside of Tomcat,
and configure the SOAP servlet to connect to our EJB server.  We have many
different EJB servers, each serving different purposes (internal test,
external test, etc).  Each one will need a SOAP server wrapping it.  The only
difference between the SOAP wrappers is their configuration, which we 
constrol at runtime.  Basically, we say "SOAP server X, connect to EJB server
Y."

We potentially need dozens of SOAP servers operating on the same machine, each
pimping requests to different EJB servers.  I don't want to have to maintain
a dozen copies of Tomcat when the only difference between them is the runtime
configuration of the SOAP servlet.  I do, however, need them to listen on
different ports.

My thought was:
 1.) Change catalina.sh to output to logs/<listen port>/catalina.out
 2.) Change server.xml's Logger references to go to logs/<listen port>
 3.) Change server.xml's unpackWARs to false.
 4.) Make the Connector port for Catalina a variable (@@LISTEN_PORT@@)
 5.) Make the Management port a variable (@@MANAGEMENT_PORT@@)

Write a tomcat.sh script that is used like:
  ./tomcat.sh start 8080

The script calculates a MANAGEMENT_PORT from the port provided (which is the
listen port).  Use sed to replace the variables in server.xml and output the
replaced file to tomcat/conf/server.xml.  Then call catalina.sh start.


It'd be much cleaner tho if I could pass the listen port and mgmt port on
the command line to the Tomcat JVM.  Alternatively, if I could pass the path
to the server.xml, that'd work too.


Thoughts?

-c

-- 
 15:35:00  up 42 days,  5:19, 13 users,  load average: 0.15, 0.22, 0.26

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message