- Verify that a Java SDK with JZOS is installed and that JAVA_HOME/bin is in the PATH.
- Download the .zip version of the binary distribution of Tomcat and upload it (in binary)
to your z/OS system.
Here's the Apache Tomcat main page: http://tomcat.apache.org.
Follow the links on the left margin for the download mirrors.
- From a z/OS Unix shell, change to the directory under which you want to unload the Tomcat
distribution and extract the zip file:
(Note: this will create a directory "apache-tomcat-6.0.18" under the current directory.
jar -xvf apache-tomcat-6.0.18.zip
- For convenience, create a symbolic link to the Tomcat distribution:
ln -s apache-tomcat-6.0.18 tomcat
this directory will be referred to as <TOMCAT_HOME>
- Customize your <TOMCAT_HOME>/conf/tomcat-users.xml file (If you plan to run tomcat under
a z/OS SAF-realm skip this step).
Here is example tomcat-users.xml that defines the roles and users necessary to use the
Tomcat remote management interface to deploy web applications:
<?xml version='1.0' encoding='utf-8'?>
<tomcat-users>
<role rolename="manager"/>
<user username="manager" password="mypass" roles="manager"/>
</tomcat-users>
Note: Care should be taken when editing this file on z/OS. All tomcat configuration files,
including tomcat-users.xml are in codepage ISO8859-1 (ASCII). See
editing ASCII files on the mainframe for more details.
As an alternative to editing this file on z/OS, you may prefer to create a copy on your workstation
and ftp to z/OS in binary, preserving the ASCII codepage:
ftp> myzos.com
ftp> binary
ftp> cd <TOMCAT_HOME>/conf
ftp> put tomcat-users.xml
ftp> quit
- Download the TOMCAT JCL to your workstation.
http://www.dovetail.com/downloads/jzos
- Upload the JCL to a PDS via FTP:
ftp> myzos.com
ftp> ascii
ftp> quote site recfm=fb
ftp> quote site lrecl=80
ftp> put TOMCAT 'HLQ.TOMCAT.JCL(TOMCAT)'
ftp> quit
Note: This file should be translated on upload, so do ascii
(text) mode is specified.
- Tailor the JCL as directed in the comments and submit
- Check the job log. If everything was set up properly, the SYSOUT DD should contain output
like this:
JZOSVM50(N): Copyright (C) IBM Corp. 2005. All rights reserved.
JZOSVM50(N): Version 1.2.3
JZOSVM50(N): Java Virtual Machine created. Version information follows:
java version "1.5.0"
Java(TM) 2 Runtime Environment, Standard Edition (build pmz31dev-20051104a)
IBM J9 VM (build 2.3, J2RE 1.5.0 IBM J9 2.3 z/OS s390-31 j9vmmz3123-20051102 (JIT enabled)
J9VM - 20051027_03723_bHdSMr
JIT - 20051027_1437_r8
GC - 20051020_AA)
JZOSVM50(N): Invoking org.apache.catalina.startup.Bootstrap.main()
And the STDOUT DD should contain something like this (but will vary depending on the JDK version):
Feb 22, 2006 4:56:24 PM org.apache.coyote.http11.Http11BaseProtocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
Feb 22, 2006 4:56:24 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 2291 ms
Feb 22, 2006 4:56:24 PM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Feb 22, 2006 4:56:24 PM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/5.5.15
Feb 22, 2006 4:56:24 PM org.apache.catalina.core.StandardHost start
INFO: XML validation disabled
Feb 22, 2006 4:56:29 PM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: contextInitialized()
Feb 22, 2006 4:56:29 PM org.apache.catalina.core.ApplicationContext log
INFO: SessionListener: contextInitialized()
Feb 22, 2006 4:56:29 PM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: contextInitialized()
Feb 22, 2006 4:56:29 PM org.apache.catalina.core.ApplicationContext log
INFO: SessionListener: contextInitialized()
Feb 22, 2006 4:56:30 PM org.apache.coyote.http11.Http11BaseProtocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
Feb 22, 2006 4:56:30 PM org.apache.catalina.storeconfig.StoreLoader load
INFO: Find registry server-registry.xml at classpath resource
Feb 22, 2006 4:56:30 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 6751 ms
- Test Tomcat
http://your.domain:8080
This should bring up the Tomcat administration page. Test that the sample servlets work. If this
doesn't happen, check both SYSOUT and STDOUT for more information.
If you need to run Tomcat on a port other than 8080, make a backup copy of
<TOMCAT_HOME>/conf/server.xml and edit it to change all occurrences of 8080 to the port that
you would like to use. Since this XML file is in ASCII (ISO8859-1), refer to
Editing ASCII files under z/OS
for information.
- Startup Problems and Suggested Tuning
- Tomcat 6.0.x: If your z/OS installation can't resolve the name 'localhost' (an
unfortunately common situation), Tomcat 6.0 may fail to start with an UnknownHostException
similar to the following:
Jan 2, 2009 2:00:03 PM org.apache.catalina.core.StandardServer await
SEVERE: StandardServer.await: create[8005]:
java.net.UnknownHostException: localhost: localhost
If this is the case, you can disable the Server control port (which may be a good idea for other
reasons). To do this, edit your copy of CATALINA_HOME/conf/server.xml and change the line:
<Server port="8005" shutdown="SHUTDOWN">
to
<Server port="-1" shutdown="SHUTDOWN">
and resubmit your job.
- If you have other problems starting Tomcat, check that you have MAXFILEPROC (in BPXPRMnnn) set to at
least 256.
Google "tcpip tuning websphere z/os" and review Websphere z/OS documentation for tuning z/OS TCPIP
parameters; Tomcat requirements are similar to Websphere, so these are good recommendations to
follow.
- Thats it! To stop Tomcat, shut it down through the manager interface or issue the
MVS STOP (P) command (SDSF "Y" prefix command).