This section discusses the basic steps required to configure and run Tomcat using T:Z. You will only need to customize the sample JCL and configuration members distributed in the "SAMPJCL" PDS that you unloaded in Chapter 2, Installation
![]() | Note |
|---|---|
For a really quick install, you might not need this documentation -
just follow the |
Edit the
SAMPJCL(TCENV)member, which contains a shell script used to configure environment variables in order to run Java under the JZOS batch launcher. For now, just edit the section as shown below to match your installation:# ---------------------------------------------------------------------- # $$$$$ Often you will only need to customize this section: # ---------------------------------------------------------------------- export JAVA_HOME=/usr/lpp/java/J5.0
CATALINA_HOME=/usr/local/tomcat
CATALINA_BASE=/usr/local/tomcat
DB2_JDBC_HOME=/usr/lpp/db2910_jdbc
DB2_SSID=DSN9
IJO="-Xms64m -Xmx128m"
Change to your Java SDK V5 or V6 home directory. See: Section 1.2, “System Requirements”
Set both this an CATALINA_BASE should be set to the directory where you installed the Tomcat filesystem ("TCHOME" in the INSTALL JCL).
If you have DB2, set this to the DB2 JDBC home directory which contains the JDBC driver jars. Otherwise this can be ignored.
If you have DB2 and will be using JDBC type-2 connections, set this to your DB2 subsystem id. Otherwise this can be ignored.
This is a reasonable starting point for min and max Java heap sizes, which you can update as necessary for your web applications.
Edit the
SAMPJCL(TCPROC)member, which contains a sample stored procedure for running Tomcat using the JZOS Batch Launcher//TCPROC PROC CNFGLIB=, < (RQD) PDS w/ config XML & env script // TCENV=TCENV, < Member of CNFLIB with STDENV script // JZOSLIB='SYS1.SIEALNKE',
< JZOS launcher PDSE LIB
// VERSION='50',
< JZOSVM version: 50,56,60,66
// LOGLVL='', < Debug LVL: +I(nfo) +D(ebug) +T(race)
// REGSIZE='0M', < Max region
//* DB2PRFX=DSN910,
< Prefix for DB2 STEPLIBs, if used
// LEPARM='',
// JAVACLS='org.apache.catalina.startup.Bootstrap',
// ARGS='start'
//JAVAJVM EXEC PGM=JVMLDM&VERSION,REGION=®SIZE,
// PARM='&LEPARM/&LOGLVL &JAVACLS &ARGS'
//STEPLIB DD DISP=SHR,DSN=&JZOSLIB
//*
DD DISP=SHR,DSN=&DB2PRFX..SDSNEXIT < Uncomment for DB2
//* DD DISP=SHR,DSN=&DB2PRFX..SDSNLOAD < type-2
//* DD DISP=SHR,DSN=&DB2PRFX..SDSNLOD2 < JDBC
//STDENV DD DISP=SHR,DSN=&CNFGLIB(&TCENV) < STDENV shell script
//TCCONFIG DD DISP=SHR,DSN=&CNFGLIB < Tomcat XML cnfig
//SYSPRINT DD SYSOUT=* < System stdout
//SYSOUT DD SYSOUT=* < System stderr
//STDOUT DD SYSOUT=* < Java System.out
//STDERR DD SYSOUT=* < Java System.err
//CEEDUMP DD SYSOUT=*
//ABNLIGNR DD DUMMY
// PEND Edit the
SAMPJCL(SERVVARS)member, which contains XML entity definitions (variables) that are used to parameterize the Tomcat configuration XML, which is contained in memberSERVXML.The
httpPortvariable should be set be an available port that Tomcat will listen on for normal HTTP connections.The
sslPortvariable may be set to the port that you wish to use for HTTPS (SSL/TLS) connections. By default, HTTPS support is not enabled (in theSERVXMLmember).Several variables are available to configure the DB2 parameters for type-2 and type-4 JDBC connections. They may be ignored if you won't be using DB2 in you web applications.
Edit the
SAMPJCL(TCUSERS)member, which contains XML entity definitions that are used to define the userids, passwords, and security roles for Tomcat only if the Tomcat MemoryUserDatabase is configured inSERVXML, which is the default.Tomcat will only prompt browsers to logon if required by a given web application in its web.xml security specifications. The Tomcat
Managerweb application, which is shipped with Tomcat, requires that users logon and have themanagerrole.If you will be using the default MemoryUserDatabase, update this file with the userids that you require and assign the
managerrole to at least one user so that you can manage your running Tomcat instance.See Chapter 4, Using SAF Security in Tomcat for information on configuring Tomcat to use SAF (RACF) for userid/password authentication and role authorization. If you use SAF, then the
TCUSERSmember is not used. If you do useTCUSERS, then only allow read access to it by Tomcat and authorized personnel.Customize the
SAMPJCL(TCJOB)member, which contains sample JCL for running Tomcat as a batch job. You will only need to customize the jobcard for your installation and set theTCPROCLIBvariable to refer to theSAMPJCLPDS.//TOMCAT JOB (),'TOMCAT',MSGCLASS=H,NOTIFY=&SYSUID //********************************************************************* //* Batch job to run Apache Tomcat using the JZOS Batch JVM launcher //* See: SAMPJCL($README) for customization info //********************************************************************* //* // SET TCPROCLB=TOMCAT.SAMPJCL Proclib with TOMCAT PROC (this) // SET TCCNFGLB=&TCPROCLB Tomcat Config PDS (this) //* //PROCLIB JCLLIB ORDER=&TCPROCLB //* //TOMCAT EXEC PROC=TCPROC, // CNFGLIB=&TCCNFGLB, < (RQD) PDS w/ config XML & env script // LOGLVL='' < Debug LVL: +I(nfo) +D(ebug) +T(race) //
Submit the job!
After a bit, output in the
STDOUTDD SYSOUT file should contain something like:Apr 19, 2009 12:05:54 PM org.apache.coyote.http11.Http11Protocol init INFO: Initializing Coyote HTTP/1.1 on http-8080 Apr 19, 2009 12:05:54 PM org.apache.catalina.startup.Catalina load INFO: Initialization processed in 1347 ms Apr 19, 2009 12:05:55 PM org.apache.catalina.core.StandardService start INFO: Starting service Catalina Apr 19, 2009 12:05:55 PM org.apache.catalina.core.StandardEngine start INFO: Starting Servlet Engine: Apache Tomcat/6.0.18 Apr 19, 2009 12:06:00 PM org.apache.coyote.http11.Http11Protocol start INFO: Starting Coyote HTTP/1.1 on http-8080 Apr 19, 2009 12:06:00 PM org.apache.catalina.startup.Catalina start INFO: Server startup in 6202 ms
You should now be able to connect your browser to Tomcat at:
http://host:port, substituting your host or ip address and the http port that you configured earlier.To gracefully shutdown Tomcat, you may use the MVS
STOP (P)console command. Under the SDSF DA panel, this command can be issued using the "Y" prefix command.
![[Note]](images/note.gif)