Dovetailed Technologies

3. Basic Configuration and Operation

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]Note

For a really quick install, you might not need this documentation - just follow the SAMPJCL($README) instructions for customizing and starting TOMCAT

  1. 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/J6.0  1
    CATALINA_HOME=/usr/local/tomcat      2
    CATALINA_BASE=/usr/local/tomcat
    DB2_JDBC_HOME=/usr/lpp/db2910_jdbc   3
    DB2_SSID=DSN9                        4
    IJO="-Xms64m -Xmx128m"               5        
    
    1

    Change to your Java SDK V5 or V6 home directory. See: Section 1.2, “System Requirements”

    2

    Set both this an CATALINA_BASE should be set to the directory where you installed the Tomcat filesystem ("TCHOME" in the INSTALL JCL).

    3

    If you have DB2, set this to the DB2 JDBC home directory which contains the JDBC driver jars. Otherwise this can be ignored.

    4

    If you have DB2 and will be using JDBC type-2 connections, set this to your DB2 subsystem id. Otherwise this can be ignored.

    5

    This is a reasonable starting point for min and max Java heap sizes, which you can update as necessary for your web applications.

  2. 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', 1 < JZOS launcher PDSE LIB
    //   VERSION='60', 2            < JZOSVM version: 50,56,60,66
    //   LOGLVL='',                 < Debug LVL: +I(nfo) +D(ebug) +T(race)
    //   REGSIZE='0M',              < Max region
    //*  DB2PRFX=DSN910,3           < Prefix for DB2 STEPLIBs, if used
    //   LEPARM='',
    //   JAVACLS='org.apache.catalina.startup.Bootstrap',
    //   ARGS='start'
    //JAVAJVM  EXEC PGM=JVMLDM&VERSION,REGION=&REGSIZE,
    //   PARM='&LEPARM/&LOGLVL &JAVACLS &ARGS'
    //STEPLIB  DD DISP=SHR,DSN=&JZOSLIB
    //*4       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 
    1

    Set this to the PDSE library containing JVMLDM50/56/60/66, the JZOS batch launcher

    2

    Set this to match the JAVA SDK that you are using (JAVA_HOME in TCENV)

    3 4

    Uncomment these and set to your DB2 library prefix if you are using JDBC type-2 connections.

  3. Edit the SAMPJCL(SERVVARS) member, which contains XML entity definitions (variables) that are used to parameterize the Tomcat configuration XML, which is contained in member SERVXML.

    • The httpPort variable should be set be an available port that Tomcat will listen on for normal HTTP connections.

    • The sslPort variable may be set to the port that you wish to use for HTTPS (SSL/TLS) connections. By default, HTTPS support is not enabled (in the SERVXML member).

    • 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.

  4. 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 in SERVXML, 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 Manager web application, which is shipped with Tomcat, requires that users logon and have the manager role.

    If you will be using the default MemoryUserDatabase, update this file with the userids that you require and assign the manager role 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 TCUSERS member is not used. If you do use TCUSERS, then only allow read access to it by Tomcat and authorized personnel.

  5. 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 the TCPROCLIB variable to refer to the SAMPJCL PDS.

    //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)
    //  
  6. Submit the job!

    After a bit, output in the STDOUT DD 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.

Copyright© 2009-2017 Dovetailed Technologies, LLC. All rights reserved.
Co:Z® is a registered trademark of Dovetailed Technologies, LLC.