Add two Tomcat environment variables to the/etc/profile file:
# Java validate
Java_home =/usr/Java/jdk1.5.0 _ 16
# Jre_home =/usr/Java/jdk1.5.0 _ 16/JRE
# Path = $ java_home/bin: $ jre_home/bin: $ path
# Classpath =.: $ java_home/lib/dt. jar: $ java_home/lib/tools. jar: $ jre_home/lib
Classpath =.: $ java_home/lib
Path = $ java_home/bin: $ path
# Export $ java_home, $ jre_home, $ path, $ classpath
Export java_home classpath path
# Tomcat
Catalina_base =/usr/tomcat 5.5/Apache-Tomcat-5.5.26
Catalina_home =/usr/tomcat 5.5/Apache-Tomcat-5.5.26
Tomcat_home =/usr/tomcat5.5/Apache-Tomcat-5.5.26
Path = $ path: $ tomcat_home/bin: $ catalina_home/bin
Export catalina_base catalina_home tomcat_home path
#
# Test Tomcat
Catalina_2_base =/usr/tomcat5test
Catalina_2_home =/usr/tomcat5test
Tomcat_2_home =/usr/tomcat5test
Path = $ path: $ tomcat_2_home/bin: $ catalina_2_home/bin
Export catalina_2_base catalina_2_home tomcat_2_home path
# End of/etc/profile
Modify startup. SH and shutdown. Sh In the tomcat/bin directory and add the following content to the file header:
#! /Bin/sh
#-----------------------------------------------------------------------------
# Start script for the Catalina Server
#
# $ ID: startup. Sh 385888 21: 04: 40z Keith $
#-----------------------------------------------------------------------------
# Better OS/400 Detection: see Bugzilla 31132
Os400 = false
Darwin = false
Case "'uname'" in
Cygwin *) cygwin = true ;;
Os400 *) os400 = true ;;
Darwin *) Darwin = true ;;
Esac
Export java_home =/usr/Java/jdk1.5.0 _ 16
Export Path = $ path: $ java_home/bin
Export classpath = $ java_home/lib
Export catalina_home = $ catalina_2_home
Export catalina_base = $ catalina_2_base
# Resolve links-$0 may be a softlink
PRG = "$0"
While [-h "$ PRG"]; do
Ls = 'LS-LD "$ PRG "'
Link = 'expr "$ ls": '. *->/(. */) $''
If expr "$ link": '/. *'>/dev/NULL; then
PRG = "$ link"
Else
PRG = 'dirname "$ PRG" '/"$ link"
Fi
Done
Prgdir = 'dirname "$ PRG "'
Executable = Catalina. Sh
# Check that target executable exists
If $ os400; then
#-X will only work on the os400 if the files are:
#1. Owned by the user
#2. Owned by the Primary Group of the user
# This will not work if the user belongs in secondary groups
Eval
Else
If [! -X "$ prgdir"/"$ executable"]; then
Echo "cannot find $ prgdir/$ executable"
Echo "this file is needed to run this program"
Exit 1
Fi
Fi
Exec "$ prgdir"/"$ executable" start "$ @"
Modify the server. xml file in the tomcat/conf directory and modify the following three ports:
1. <server port = "8005" shutdown = "shutdown">
2. <connector Port = "8080" maxhttpheadersize = "8192"
Maxthreads = "150" minsparethreads = "25" maxsparethreads = "75"
Enablelookups = "false" redirectport = "8443" acceptcount = "100"
Connectiontimeout = "20000" disableuploadtimeout = "true"/>
3. <connector Port = "8009"
Enablelookups = "false" redirectport = "8443" protocol = "AJP/1.3"/>