<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>archive</title><link>https://archive-w.netlify.app/doc/framework/tomcat/</link><description>Recent content on archive</description><generator>Hugo</generator><language>zh-CN</language><atom:link href="https://archive-w.netlify.app/doc/framework/tomcat/index.xml" rel="self" type="application/rss+xml"/><item><title/><link>https://archive-w.netlify.app/doc/framework/tomcat/tomcat-core/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://archive-w.netlify.app/doc/framework/tomcat/tomcat-core/</guid><description>&lt;ul>
&lt;li>
&lt;h2 id="introtomcat-core">
 Intro(TOMCAT-CORE)
 &lt;a class="anchor" href="#introtomcat-core">#&lt;/a>
&lt;/h2>
&lt;p class="tip">tomcat.version = 8.5.35
&lt;br> 


 &lt;a href="https://github.com/apache/tomcat/tree/8.5.35" rel="noopener" target="_blank">offical git repo | tag = 3.5.35&lt;/a> &lt;span style='padding-left:5em' /> 


 &lt;a href="https://github.com/12302-bak/tomcat-analysis" rel="noopener" target="_blank">learning git repo&lt;/a>
&lt;br> 


 &lt;a href="https://tomcat.apache.org/tomcat-8.5-doc/introduction.html" rel="noopener" target="_blank">tomcat-8.5-doc&lt;/a>
&lt;br> 


 &lt;a href="https://archive.apache.org/dist/tomcat/tomcat-8/v8.5.35/" rel="noopener" target="_blank">download 8.5.35&lt;/a>&lt;/p>
&lt;p>&lt;img src="https://archive-w.netlify.app/.images/doc/framework/tomcat/core/tomcat-process-01.png" alt="" width="100%">&lt;/p>
&lt;p>&lt;img src="https://archive-w.netlify.app/.images/doc/framework/tomcat/core/tomcat-process-02.png" alt="" width="100%">&lt;/p>
&lt;ul>
&lt;li>
&lt;h3 id="概念解释">
 概念解释
 &lt;a class="anchor" href="#%e6%a6%82%e5%bf%b5%e8%a7%a3%e9%87%8a">#&lt;/a>
&lt;/h3>
&lt;/li>
&lt;li>
&lt;h3 id="整体架构">
 整体架构
 &lt;a class="anchor" href="#%e6%95%b4%e4%bd%93%e6%9e%b6%e6%9e%84">#&lt;/a>
&lt;/h3>
&lt;p class="warn"> Connector（【coyote】处理socket连接，负责网络字节流）
&lt;br> Container（【Catalina】加载servlet处理具体请求）&lt;/p>
&lt;p>


 &lt;a href="https://stackoverflow.com/questions/32985051/what-are-the-tomcat-component-what-is-catalina-and-coyote" rel="noopener" target="_blank">https://stackoverflow.com/questions/32985051/what-are-the-tomcat-component-what-is-catalina-and-coyote&lt;/a>&lt;/p>
&lt;/li>
&lt;li>
&lt;h3 id="启动流程">
 启动流程
 &lt;a class="anchor" href="#%e5%90%af%e5%8a%a8%e6%b5%81%e7%a8%8b">#&lt;/a>
&lt;/h3>
&lt;p class="warn"> 先是初始化
&lt;br>BootStrap-&amp;gt;Calaline-&amp;gt;Server-&amp;gt;Service
&lt;br>BootStrap-&amp;gt;Calaline-&amp;gt;Server-&amp;gt;Service-&amp;gt;[Engine-&amp;gt;Host-&amp;gt;Context]
&lt;br>BootStrap-&amp;gt;Calaline-&amp;gt;Server-&amp;gt;Service-&amp;gt;[Executor]
&lt;br>BootStrap-&amp;gt;Calaline-&amp;gt;Server-&amp;gt;Service-&amp;gt;[ProtocalHandler]
&lt;br>然后调用start启动整个tomcat&lt;/p>
&lt;/li>
&lt;li>
&lt;h3 id="io模型和协议">
 I/O模型和协议
 &lt;a class="anchor" href="#io%e6%a8%a1%e5%9e%8b%e5%92%8c%e5%8d%8f%e8%ae%ae">#&lt;/a>
&lt;/h3>
&lt;p class="warn"> BIO，NIO，AIO（NIO2），APR
&lt;br>HTTP/1.1，HTTP/2，AJP（用于和apache服务器集成用来处理静态资源）&lt;/p>
&lt;/li>
&lt;li>
&lt;h3 id="jasper引擎">
 Jasper引擎
 &lt;a class="anchor" href="#jasper%e5%bc%95%e6%93%8e">#&lt;/a>
&lt;/h3>
&lt;p class="warn">index.jsp -&amp;gt; jspServlet(找到文件) -&amp;gt; 渲染成servlet.class-&amp;gt; 加载调用&lt;/p>
&lt;/li>
&lt;li>
&lt;h3 id="context">
 Context
 &lt;a class="anchor" href="#context">#&lt;/a>
&lt;/h3>
&lt;p class="warn">官方不建议直接在server.xml中配置，因为，server.xml文件只会在tomcat重新的时候重新加载。&lt;/p>
&lt;ol>
&lt;li>In an individual file at /META-INF/context.xml inside the application files&lt;/li>
&lt;li>In individual files (with a &amp;ldquo;.xml&amp;rdquo; extension) in the $CATALINA_BASE/conf/[enginename]/[hostname]/ directory&lt;/li>
&lt;li>Inside a Host element in the main conf/server.xml.&lt;/li>
&lt;/ol>
&lt;/li>
&lt;li>
&lt;h3 id="安全">
 安全
 &lt;a class="anchor" href="#%e5%ae%89%e5%85%a8">#&lt;/a>
&lt;/h3>
&lt;p class="warn">&lt;code>1).&lt;/code> 删除webapp下面的管理页面和其他项目
&lt;br>&lt;code>2).&lt;/code> 禁用server-user.xml里面的权限或者直接删除
&lt;br>&lt;code>3).&lt;/code> 修改tomcat默认关机指令，或者禁用
&lt;br>&lt;code>4).&lt;/code> 配置错误页面。&lt;/p></description></item></channel></rss>