톰캣 #04-환경설정
DESCRIPTION
설치 이후에는 사용하고자하는 환경에 맞게 몇가지 설정을 변경할 필요가 있습니다. setenv.sh 라고 아시나요?? - 리스너 - Java Options - ClassLoader - setenv? - web.xml - LogTRANSCRIPT
.StoneGG
{톰캣: T o m c a t }
리스너
자바옵션
클래스로더
setenv?
web.xml
로그
C H A P T E R # 4
T O M C AT 환경설정
L I S T E N E R
Listener
Listener
Listener
0101110Listener 8080
Listener
http://tomcat.gm.com:80https://tomcat.gm.com:443
Listener
…생략… 7월 15, 2014 5:46:18 오후 org.apache.coyote.AbstractProtocol start 정보: Starting ProtocolHandler ["http-bio-8080"] 7월 15, 2014 5:46:18 오후 org.apache.coyote.AbstractProtocol start 정보: Starting ProtocolHandler ["ajp-bio-8009"] 7월 15, 2014 5:46:18 오후 org.apache.catalina.startup.Catalina start 정보: Server startup in 1002 ms
Listener
J AVA O P T I O N S
Java Options
JVM
L INUX
JVM JVM
WINDOWS UN IX
APPLICATIONSAPPLICATIONS
APPLICATIONS APPLICATIONS
APPLICATIONS APPLICATIONS
APPLICATIONSJava Options
-Xms-Xmx-Xint
-XX:PermSize
-XX:+HeapdumpOnOutOfMemory-XX:+Agressive
-XX:+DisableExplicyGC
-verbosegc
-server
-XX:MaxNewSize
Java Options
C L A S S L O A D E R
ClassLoader
$ java HelloWorld
ClassLoader
ClassLoader
Class:Class:Class:Class:Class
ClassLoader
Class
Class:Class:Class:Class:Class
Path
ClassLoader
BOOTCLASSPATH : EXTENSIONSCLASSPATH : CLASSPATH
-Xbootclasspath/p:HelloWorld
-Xbootclasspath/a:HelloWorld
CLASSPATH=HelloWorldCLASSPATH=${CLASSPATH}:HelloWorld
CLASSPATH=HelloWorld:${CLASSPATH}
s e t e n v ?
setenv?
Script
PATHScript
Chapter #03. 설치
setenv?
WINDOWS SERVICE
setenv?
Catalina.sh? ?
# ----------------------------------------------------------------------------- # Control Script for the CATALINA Server # # Environment Variable Prerequisites # # Do not set the variables in this script. Instead put them into a script # setenv.sh in CATALINA_BASE/bin to keep your customizations separate. # # CATALINA_HOME May point at your Catalina "build" directory. # # CATALINA_BASE (Optional) Base directory for resolving dynamic portions # of a Catalina installation. If not present, resolves to # the same directory that CATALINA_HOME points to. # # CATALINA_OUT (Optional) Full path to a file where stdout and stderr # will be redirected. # Default is $CATALINA_BASE/logs/catalina.out # # CATALINA_OPTS (Optional) Java runtime options used when the "start", # "run" or "debug" command is executed. # Include here and not in JAVA_OPTS all options, that should # only be used by Tomcat itself, not by the stop process, # the version command etc.
setenv?
# Ensure that any user defined CLASSPATH variables are not used on startup, # but allow them to be specified in setenv.sh, in rare case when it is needed. CLASSPATH= !
if [ -r "$CATALINA_BASE/bin/setenv.sh" ]; then . "$CATALINA_BASE/bin/setenv.sh" elif [ -r "$CATALINA_HOME/bin/setenv.sh" ]; then . "$CATALINA_HOME/bin/setenv.sh" fi
setenv?
ex)setenv.sh JAVA_OPTS="-DMy_Tomcat -Xms512m -Xmx512m -verbosegc"
setenv?
setenv?
JAVA_OPTS
setenv?
CLASSPATH
setenv?
CATALINA_HOME
setenv?
CATALINA_BASE
setenv?
CATALINA_OUT
setenv?
CATALINA_OPTS
setenv?
setenv.sh
w e b . x m l
web.xml
conf/web.xmlWEB-INF/web.xml
web.xml
<servlet> <servlet-name>invoker</servlet-name> <servlet-class> org.apache.catalina.servlets.InvokerServlet </servlet-class> <init-param> <param-name>debug</param-name> <param-value>0</param-value> </init-param> <load-on-startup>2</load-on-startup> </servlet> !
<servlet-mapping> <servlet-name>invoker</servlet-name> <url-pattern>/servlet/*</url-pattern> !</servlet-mapping>
5.5 이하
web.xml
L O G
Log
Log
catalina.out
access.log
*.log
> CATALINA_OUT > catalina.sh > setenv.sh
> server.xml
> logging.properties > catalina.log, host.log, manager.log, etc.
리스너
자바옵션
클래스로더
setenv?
web.xml
로그
끝{G.Stone : 환경 설정}
NEXT
배치
CategoryGMMG