Tomcat Components
Connector
Container
Jasper
Naming
Session
Logging
JMS
Connector
recieve client request (listen on different ports per connector)
process request
Container Components
Engine (manage several sites)
Host (virtual host, manage one sits)
Context (manager one application)
Wrapper (servlet)
Process of Tomcat handling a client request
client send a request via connector listening port
connector sends request to specific container engine
engine finds a host
host finds a context
context finds a servlet
servlet process and return a response to context
context return response to host
host return response to engine
engine return response to connector
Tomcat Configuration files
catalina.policy
catalina.properties
context.xml (web.xml)
logging.properties
server.xml (startup application)
tomcat-users.xml
web.xml
Tomcat Common Configuration
place war under webapp
add <context ... debug="0" docBase="..." path="" reloadable="true"/> in server.xml
place xml contains <context ... debug="0" docBase="..." reloadable="true"/> under conf/Catelina/localhost
debug (error logger info level)
docBase (project path)
path (url matching path)
reloadable (true)
port: server.xml
memory: catalina.sh
hot reload
Tomcat JDBC connection pool
>=Tomcat 7.0: 3-rd party jdbc module (tomcat-jdbc)
add <Resource name="jdbc/user" auth="..." typr="..." factory=".." .../> in context.xml (define db connection pool properties)
add <resource-ref><res-ref-name>jdbc/user</res-ref-name>...</resource-ref> in web.xml
add db connector jar under lib folder
SSO
CAS
virtual host (domain-based&port-based)
Security
共同学习,写下你的评论
评论加载中...
作者其他优质文章