设为首页 收藏本站
查看: 556|回复: 0

[经验分享] Tomcat Server.xml文件内容

[复制链接]

尚未签到

发表于 2017-1-19 10:26:21 | 显示全部楼层 |阅读模式
1       Server
1.1          In the Tomcat world, a Server represents the whole container. Tomcat provides a default implementation of the Server interface., and this is rarely customized by users.
1.2          tomcat的世界里,一个server代表整个容器.Tomcat提供了一个默认的org.apache.catalina接口的实现.用户很少修改这个默认的实现
 

2       Service
2.1          A Service is an intermediate component which lives inside a Server and ties one or more Connectors to exactly one Engine. The Service element is rarely customized by users, as the default implementation is simple and sufficient: Service interface.
2.2          一个Service是一个中间件,存在在一个Server的内部,将一个或者多个Connectors绑定到一个特定的Engine.默认的实现已经足够用了.org.apache.catalina.Service接口的一个实现.
A "Service" is a collection of one or more "Connectors" that share a single "Container"
一个Service是一个或者多个Connectors的集合,这些个Connectors共享一个容器。

3       Engine
3.1          An Engine represents request processing pipeline for a specific Service. As a Service may have multiple Connectors, the Engine received and processes all requests from these connectors, handing the response back to the appropriate connector for transmission to the client. The Engine interface may be implemented to supply custom Engines, though this is uncommon.
3.2          一个Engine代表一个特定的Service的请求处理的管道.因为一个Service可以有多个Connectors,Engine接收并且处理从这些Connectors过来的所有的请求.并且将结果送回合适的connector并发送给客户端.
3.3          可以实现org.apache.catalina.Interface Engine接口来提供定制的Engines,虽然一般不需要这样做.
3.4          Note that the Engine may be used for Tomcat server clustering via the jvmRoute parameter. Read the Clustering documentation for more information.
4       Host
4.1          A Host is an association of a network name, e.g. www.yourcompany.com, to the Tomcat server. An Engine may contain multiple hosts, and the Host element also supports network aliases such as yourcompany.com and abc.yourcompany.com. Users rarely create custom Hosts because the StandardHost implementation provides significant additional functionality.
4.2          一个Host将一个域名和tomcat联系起来.一个Engine可以包含多个hosts,并且一个Host还支持网络别名(例如yourcompany.com 或者 abc.yourcompany.com).用户很少去实现一个org.apache.catalina.Interface Host接口,因为org.apache.catalina.core.StandardHost这个默认的实现已经提供了丰富的扩展功能了
 

5       Connector
5.1          A Connector handles communications with the client. There are multiple connectors available with Tomcat, all of which implement the Connector interface. These include the Coyote connector which is used for most HTTP traffic, especially when running Tomcat as a standalone server, and the JK2 connector which implements the AJP procotol used when connecting Tomcat to an Apache HTTPD server. Creating a customized connector is a significant effort.
5.2          一个Connector处理和客户端的通信.tomcat有多个connectors.这些个connectors都实现了Connector接口.
5.3          创建一个定制的connector是非常复杂的.
5.4          AJP是为TomcatHTTP服务器之间通信而定制的协议,能提供较高的通信速度和效率。在配置TomcatHTTP服务器集成中,读者可以不必关心AJP协议的细节。关于AJP的知识也可以参考网址:
5.5          Tomcat最主要的功能是提供Servlet/JSP容器,尽管它也可以作为独立的Java Web服务器,它在对静态资源(如HTML文件或图像文件)的处理速度,以及提供的Web服务器管理功能方面都不如其他专业的HTTP服务器,如IISApache服务器。
5.6          因此在实际应用中,常常把Tomcat与其他HTTP服务器集成。对于不支持Servlet/JSPHTTP服务器,可以通过Tomcat服务器来运行Servlet/JSP组件。
5.7          Tomcat与其他HTTP服务器集成时,Tomcat服务器的工作模式通常为进程外的Servlet容器,Tomcat服务器与其他HTTP服务器之间通过专门的插件来通信。
5.8          TomcatHTTP服务器集成的原理:Tomcat服务器通过Connector连接器组件与客户程序建立连接,Connector组件负责接收客户的请求,以及把Tomcat服务器的响应结果发送给客户。默认情况下,Tomcatserver.xml中配置了两种连接器:
l         <Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" />
l         <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />
5.9          第一个连接器监听8080端口,负责建立HTTP连接。在通过浏览器访问Tomcat服务器的Web应用时,使用的就是这个连接器。
5.10       第二个连接器监听8009端口,负责和其他的HTTP服务器建立连接。在把Tomcat与其他HTTP服务器集成时,就需要用到这个连接器。
5.11       Tomcat提供了专门的JK插件来负责TomcatHTTP服务器的通信。应该把JK插件安置在对方的HTTP服务器上。
5.12       对于不同的HTTP服务器,Tomcat提供了不同的JK插件的实现模块
l         Windows下的Apache HTTP服务器集成:mod_jk_2.0.46.dll
l         LinuxRedHet)下的Apache HTTP服务器集成:mod_jk.so-ap2.0.46-rh72..46-rh72
l         IIS服务器集成:isapi_redirect.dll
5.13       AJP是为TomcatHTTP服务器之间通信而定制的协议,能提供较高的通信速度和效率。
5.14       关于AJP的知识也可以参考网址:
http://jakarta.apache.org/builds/jakarta-tomcat-connectors/jk2/doc/common/AJPv13.html
5.15       如果两个Tomcat服务器都在同一台机器上运行,则至少应该对其中一个Tomcat服务器的以上3个端口号都进行修改。
6       Context
6.1          A Context represents a web application. A Host may contain multiple contexts, each with a unique path. The Context interface may be implemented to create custom Contexts, but this is rarely the case because the StandardContext provides significant additional functionality.
6.2          一个Context代表一个web应用程序。一个Host可以包含多个contexts。每一个有不同的访问地址。
6.3          可以实现Context接口来创建自己的Contexts。但很少这样用,因为StandardContext已经提供了丰富的额外的功能
 

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-330628-1-1.html 上篇帖子: Tomcat下配置连接池 下篇帖子: windonws下tomcat开机启动
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表