tomcat-1-概述

2019-10-02  本文已影响0人  宠辱不惊的咸鱼

问题

参考

组成

Server

Service

<Service name="Catalina">

Connector

// Coyote Http/1.1 Connector在端口8080处侦听来自浏览器的Http请求
<Conector port="8080" protocol="HTTP/1.1" connectionTimeout="200000" redirectPort="8443" />

// Coyote JK2 Connector在端口8009处侦听来自其它WebServer的Servlet/Jsp代理请求
<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />

Engine

<Engine name="Catalina" defaultHost="localhost">

Host

<Host name="localhost" appBase="webapps" unparkWARs="true" autoDeploy="true">
// 一个Host下配置多个Host
<Context path="/hello" docBase="D:\workspace\hello" debug="0" privileged="true" />
<Context path="/myapp" docBase="D:\workspace\myapp" workDir="D:\myapp\work" reloadable="true" />

// 创建一个Context文件,conf/Catalina/localhost/hello.xml
<Context path="/hello" docBase="D:\workspace\hello" debug="0" privileged="true" />

Context

映射例子

http://localhost:8080/wsota/wsota_index.jsp
tomcat-001.jpg
http://www.myserver.com/mywebapp/helloServlet/hello
tomcat-002.jpg

虚拟主机

基于域名,多个Host节点

http://www.jalja1.org:8080/
http://www.jalja2.org:8080/

基于端口号,多个Service节点

http://www.jalja1.org:8888/
http://www.jalja1.org:8080/

基于IP,Tomcat不支持

request & response

tomcat-003.jpg tomcat-004.jpg

HttpServlet

tomcat-005.jpg tomcat-006.jpg

反向代理

上一篇下一篇

猜你喜欢

热点阅读