Setting up Tomcat
Installing Tomcat consists of
Untar’ing the Tomcat distribution. It is best to set the environment variable
TOMCAT_HOMEto the location where the Tomcat distribution is expanded. Many of the following steps require aTOMCAT_HOMEto be set.Editing the
conf/server.xmlfile to change the ports to better suit your installation.By default, the connector port for the HTTP connector is set to 8080. Change this to the port used by the
mgmtwebapp for this appliance, in this example, 17665.<Connector connectionTimeout="20000" port="17665" protocol="HTTP/1.1" redirectPort="8443"/>
Remove/comment out the sections for the AJP connector.
At the end, there should be two ports active in the
conf/server.xmlfile, one for the HTTP connector and the other for theSHUTDOWNcommand.
Setting the appropriate log4j configuration level by creating/editing the
lib/log4j2.xml. Here’s a sample that logs exceptions and errors with one exception - log messages logged to theconfignamespace are logged at INFO level.<Configuration> <Appenders> <Console name="STDOUT" target="SYSTEM_OUT"> <PatternLayout pattern="%d %-5p [%t] %C{2} (%F:%L) - %m%n"/> </Console> </Appenders> <Loggers> <Logger name="org.apache.log4j.xml" level="info"/> <Root level="info"> <AppenderRef ref="STDOUT"/> </Root> </Loggers> </Configuration>
To use Apache Commons Daemon, unzip the
${TOMCAT_HOME}/bin/commons-daemon-native.tar.gzand follow the instructions. Once you have built this, copy thejsvcbinary to the Tomcatbinfolder for convenience. Note, it’s not required that you useApache Commons Daemonespecially, if you are already using system monitoring and management tools like Nagios or Hyperic.$ tar zxf commons-daemon-native.tar.gz $ cd commons-daemon-1.1.0-native-src $ cd unix/ $ ./configure ... $ make ... $ cp jsvc ../../../bin/