tomcat目录结构

tomcat下有9个目录,分别是bin,common,conf,logs,server,shared,temp,webapps,work<wbr style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)">目录,现在对每一目录做介绍.</span><br style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)"></span><wbr style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)"></span><wbr style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)"></span><wbr style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)"></span><wbr style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)">tomcat根目录在tomcat中叫&lt;CATALINA_HOME&gt;,文章中把tomcat解压后在c:/下.</span><br style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)"></span><wbr style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)"></span><wbr style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)"></span><wbr style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)"></span><wbr style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)">1.&lt;CATALINA_HOME&gt;/bin:</span><wbr style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)">存放各种平台下启动和关闭Tomcat的脚本文件.其中有个档是catalina.bat,打开这个windos配置文件,在非注释行加入JDK路径,例如</span><wbr style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)">:</span><wbr style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)">SET</span><wbr style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)"></span><wbr style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)">JAVA_HOME=C:\j2sdk1.4.2_06</span><wbr style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)">保存后,就配置好tomcat环境了.</span><wbr style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)">startup.bat是windows下启动tomcat的文件,shutdown.bat是关闭tomcat的文件.</span><br style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)"></span><wbr style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)"></span><wbr style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)"></span><wbr style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)"></span><wbr style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)">2.&lt;CATALINA_HOME&gt;/common:</span><wbr style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)">在common目录下的lib目录,存放Tomcat服务器和所有web应用都能访问的JAR?.</span><br style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)"></span><wbr style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)"></span><wbr style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)"></span><wbr style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)"></span><wbr style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)">3.&lt;CATALINA_HOME&gt;/shared:</span><wbr style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)">在shared目录下的lib目录,存放所有web应用能访问的,但Tomcat不能访问的JAR?.</span><br style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)"></span><wbr style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)"></span><wbr style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)"></span><wbr style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)"></span><wbr style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)">4.&lt;CATALINA_HOME&gt;/server:</span><wbr style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)">在server/webapps目录中,存放Tomcat自带的两个APP-admin和manager应用,使用来管理Tomcat-web服务用的.在server/lib目录中,存放tomcat服务器所需要的各,web应用不能访问种jar?.</span><br style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)"></span><wbr style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)"></span><wbr style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)"></span><wbr style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)"></span><wbr style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)">5.&lt;CATALINA_HOME&gt;/work</span><wbr style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)">:</span><wbr style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)">Tomcat把各种由jsp生成的servlet文件放在这个目录下.</span><br style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)"></span><wbr style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)"></span><wbr style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)"></span><wbr style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)"></span><wbr style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)">6.&lt;CATALINA_HOME&gt;/temp</span><wbr style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)">:</span><wbr style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)">临时活页夹,Tomcat运行时候存放临时文件用的.</span><br style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)"></span><wbr style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)"></span><wbr style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)"></span><wbr style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)"></span><wbr style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)">7.&lt;CATALINA_HOME&gt;/logs</span><wbr style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)">:</span><wbr style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)">存放Tomcat的日志文件</span><br style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)"></span><wbr style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)"></span><wbr style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)"></span><wbr style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)"></span><wbr style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)">8.&lt;CATALINA_HOME&gt;/conf</span><wbr style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)">:</span><wbr style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)">Tomcat的各种配置文件,最重要的是</span><wbr style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)">server.xml;配置tomcat组件的XML文件server.XML其中包括</span><br style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)">I.顶层类元素[Top</span><wbr style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)">Level</span><wbr style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)">Elements]:</span><wbr style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)">位于整个配置文件的顶层,</span><wbr style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)">包括&lt;Server&gt;和&lt;Service&gt;;</span><br style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)">II.连接器类元素[Connectors</span><wbr style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)">]:</span><wbr style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)">客户和服务(容器类元素)间的通讯接口.接受客户请求,返回响应结果;&lt;Connector&gt;</span><wbr style="line-height:21px; color:rgb(70,70,70)"><br style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)">II.容器类元素[Containers]:</span><wbr style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)">处理客户请求并且生成响应结果,包含3个:&lt;Engine&gt;</span><wbr style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)">&lt;Host&gt;</span><wbr style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)">&lt;Context&gt;</span><br style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)">IV.嵌套类元素[Nested</span><wbr style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)">Components]:</span><wbr style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)">可以加入到容器中的元素,包括:&lt;logger&gt;</span><wbr style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)">&lt;Valve&gt;&lt;Realm&gt;等</span><br style="line-height:21px; color:rgb(70,70,70)"><br style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)">一个&lt;Server&gt;包含一个或多个&lt;Service&gt;,一个&lt;Service&gt;包含唯一一个&lt;Engine&gt;和一个或多个&lt;Connector&gt;,多个</span><wbr style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)">&lt;Connector&gt;共享一个&lt;Engine&gt;;一个&lt;Engine&gt;包含多个&lt;Host&gt;,每个&lt;Host&gt;定义一个虚拟主机,包含一个或多个web应用&lt;Context&gt;;</span><wbr style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)">&lt;Context&gt;元素是代表一个在虚拟主机上运行的Web应用.&lt;Context&gt;标签的描述</span><br style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)">Please</span><wbr style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)">note</span><wbr style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)">that</span><wbr style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)">for</span><wbr style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)">tomcat</span><wbr style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)">5.x,</span><wbr style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)">unlike</span><wbr style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)">tomcat</span><wbr style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)">4.x,</span><wbr style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)">it</span><wbr style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)">is</span><wbr style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)">NOT</span><wbr style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)">recommended</span><wbr style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)">to</span><wbr style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)">place</span><wbr style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)">&lt;Context&gt;</span><wbr style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)">elements</span><wbr style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)">directly</span><wbr style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)">in</span><span style="line-height:21px; color:rgb(70,70,70)"></span><wbr style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)">the</span><wbr style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)">server.xml</span><wbr style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)">file.</span><wbr style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)">Instead,</span><wbr style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)">put</span><wbr style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)">them</span><wbr style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)">in</span><wbr style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)">the</span><wbr style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)">META-INF/context.xml</span><wbr style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)">directory</span><wbr style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)">of</span><wbr style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)">your</span><wbr style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)">WAR</span><wbr style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)">file</span><wbr style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)">or</span><wbr style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)">the</span><wbr style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)">conf</span><wbr style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)">directory</span><wbr style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)">as</span><wbr style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)">described</span><wbr style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)">above.</span><wbr style="line-height:21px; color:rgb(70,70,70)"><br style="line-height:21px; color:rgb(70,70,70)"></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr>

<wbr style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)"></span><wbr style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)"></span><wbr style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)"></span><wbr style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)">9.&lt;CATALINA_HOME&gt;/webapps:</span><wbr style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)">web应用的发布目录,把</span><wbr style="line-height:21px; color:rgb(70,70,70)"><span style="line-height:21px; color:rgb(70,70,70)">java开发的web站点或war文件放入这个目录下就可以通过tomcat服务器访问了.</span></wbr></wbr></wbr></wbr></wbr></wbr>

转至:点击打开链接

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值