tomcat的配置文件server.conf中的元素的理解


tomcat作为一个servlet服务器本身的配置文件是tomcat_home/conf/server.conf,这个配置文件中有很多元素,这些元素各是什么意思,需要搞清楚,这里记录一下目前清楚的几个元素的含义。

tomcat本身是由一系列可配置的组件组成的,配置文件中的每一个元素都代表一个tomcat的组件。

1、Server元素

=============

Server元素代表servlet容器本身。

A Server element represents the entire Catalina servlet container.Therefore, 
it must be the single outermost element in the conf/server.xml configuration file.
Its attributes represent the characteristics of the servlet container as a whole.

2、Service

==========

Service元素代表了connector和engine的组合。

A Service element represents the combination of one or more Connector components
that share a single Engine component for processing incoming requests.
One or more Service elements may be nested inside a Server element.

  

3、Engine元素

===============

Engine元素代表了一个Service组件的整个请求处理机构。

The Engine element represents the entire request processing machinery associated with a particular Catalina Service. 
It receives and processes all requests from one or more Connectors,
and returns the completed response to the Connector for ultimate transmission back to the client. Exactly one Engine element MUST be nested inside a Service element,
following all of the corresponding Connector elements associated with this Service.

  

4、service中的两种connector

========================

在service元素中有两个connector元素,这两个connector元素的protocol属性的值是不一样的,一个是HTTP/1.1,另一个是AJP/1.3。

<Connector connectionTimeout="20000" port="8080" protocol="HTTP/1.1" redirectPort="8443"/>
<Connector port="8009" protocol="AJP/1.3" redirectPort="8443"/>

它们两者的区别如下:

Tomcat中HTTP与AJP的区别:
Tomcat服务器通过Connector连接器组件与客户程序建立连接,Connector组件负责接收客户的请求,以及把Tomcat服务器的响应结果发送给客户。默认情况下,Tomcat在server.xml中配置了两种连接器:

第一个连接器监听8080端口,负责建立HTTP连接。在通过浏览器访问Tomcat服务器的Web应用时,使用的就是这个连接器。

第二个连接器监听8009端口,负责和其他的HTTP服务器建立连接。在把Tomcat与其他HTTP服务器集成时,就需要用到这个连接器。

5、未完待续

===============

。。。

参考资料:

1、tomcat 9 docs的configuration页面,https://tomcat.apache.org/tomcat-9.0-doc/config/service.html

2、Tomcat: Connector中HTTP与AJP差别与整合,https://www.cnblogs.com/itcomputer/p/4873823.html

tomcat的配置文件server.conf中的元素的理解的更多相关文章

  1. tomcat 的配置文件 server.xml 详解

    server.xml位于$TOMCAT_HOME/conf目录下,作为整个 tomcat 服务器最核心的配置文件,server.xml的每一个元素都对应了 tomcat中的一个组件,通过对xml中元素 ...

  2. List中remove元素的理解

    今天写了个简单的list中remove元素的方法,结果报错... List<String> ll = Arrays.asList("1","2",& ...

  3. tomcat server.xml 中 host 元素

    测试偶然发现: <Host name="127.0.0.1" appBase="webapps" unpackWARs="true" ...

  4. tomcat启动了server.xml中没有配置的项目

    在tomcat的conf目录下的server.xml文件中没有配置hczm_struts项目,但在eclipse启动tomcat调试时,一直启动hczm_struts项目. 经检查,发现conf\Ca ...

  5. Tomcat的配置文件Server.xml解析

    配置元素说明: 元素名 属性 解释 server port 指定一个端口,这个端口负责监听关闭tomcat 的请求 shutdown 指定向端口发送的命令字符串 service name 指定serv ...

  6. [转载]tomcat的配置文件server.xml不支持中文注释的解决办法

    原文链接:http://tjmljw.iteye.com/blog/1500370 启动tomcat失败,控制台一闪而过,打开catalina的log发现错误指向了conf/server.xml,报错 ...

  7. tomcat 的配置文件server.xml 几个端口的作用

    tomcat中server.xml配置文件中几个port的作用和区别 在tomcat的server.xml中有这么几个port,很多人虽然一直在使用tomcat,但是却不知道这几个port各有什么作用 ...

  8. Tomcat的配置文件server.xml叙述

    元素名属性解释 server port 指定一个端口,这个端口负责监听关闭tomcat的请求shutdown  指定向端口发送的命令字符串 servicename          指定service ...

  9. tomcat如何在server.xml中配置contexts

    https://tomcat.apache.org/tomcat-8.5-doc/deployer-howto.html#A_word_on_Contexts 例如你的程序 名字是hello端口是80 ...

随机推荐

  1. autoconf 添加三方库(libcurl)简单试用

    1. 参考项目 https://github.com/rongfengliang/autoconf-project 2. 项目说明 a. 项目结构 ├── Jenkinsfile # jenkins ...

  2. phoenix 使用activerecord模式框架ecto 访问数据库

    备注:    需要先安装mysql 以及phoenix 框架,测试使用的是docker 进行安装,具可以参考代码    1. 创建项目 mix phx.new first --database mys ...

  3. caddy server 默认https && http2的验证

    1. 下载     https://caddyserver.com/   注意选择应该包含的模块,此次包含了git 插件   2. 配置    使用 Caddyfile    内容如下:     ro ...

  4. linux查找目录下的所有文件中是否含有某个字符串 (转)

    查找目录下的所有文件中是否含有某个字符串 find .|xargs grep -ri "IBM" 查找目录下的所有文件中是否含有某个字符串,并且只打印出文件名 find .|xar ...

  5. php查询mysql数据库 查询条件替中文字符串变量时无法查询

    $temp2 ='十年';mysql_query("SET NAMES GBK"); $res = mysql_query("select songer_name fro ...

  6. django 网站 Hello world

    环境搭建 1.python2.7,python3.x均可以使用, 2.直接pip install django或者去下载whl文件安装 3.用eclipse和pycharm均可 开始 1.进入一个目录 ...

  7. dubbo相关的知识点总结

    dubbo最近提交到了apache,成为了apache的孵化项目,又开始活跃起来了.就官方在git上面的说明文档和其他资料,学习总结以下dubbo的一些知识点. .The dubbo protocol ...

  8. Hibernate学习11——Hibernate 高级配置(连接池、log4j)

    第一节:配置数据库连接池 这里配置c3p0连接池,需要的jar包: jar包位于hibernate压缩包的:hibernate-release-4.3.5.Final\lib\optional\c3p ...

  9. struts2学习(13)struts2文件上传和下载(1)

    一.Struts2文件上传: 二.配置文件的大小以及允许上传的文件类型: 三.大文件上传: 如果不配置上传文件的大小,struts2默认允许上传文件最大为2M: 2097152Byte:   例子实现 ...

  10. python 源代码保护 之 xx.py -> xx.so

    前情提要 之前由于项目的需要,需要我们将一部分“关键代码”隐藏起来. 虽然Python 先天支持 将源代码 编译后 生成 xxx.pyc 文件,但是破解起来相当容易 -_-!! 于是搜罗到了另外一种方 ...