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. C++ sort 函数用法

    MSDN中的定义: template<class RanIt>void sort(RanIt first, RanIt last); //--> 1)template<clas ...

  2. 字符编码:ASCII,Unicode和UTF-8

    字符编码是计算机技术的基石,想要熟练使用计算机,就必须懂得一点字符编码的知识. 1. ASCII码 我们知道,在计算机内部,所有的信息最终都表示为一个二进制的字符串.每一个二进制位(bit)有0和1两 ...

  3. hessian协议原理

    Hessian 原理分析 一.      远程通讯协议的基本原理 网络通信需要做的就是将流从一台计算机传输到另外一台计算机,基于传输协议和网络 IO 来实现,其中传输协议比较出名的有 http . t ...

  4. pycharm中import动态链接库pyd有错误

    有红色波浪线提示unsolved reference云云 去setting里面设置interpreters,  在path里面添加对应的路径, 是包含对应头文件的路径, 不要忘记右边的小按钮去Relo ...

  5. VS 2013 简体中文 专业版 下载地址。

    官方原始链接:http://download.microsoft.com/download/7/A/C/7AC27F37-FDFE-4991-B18A-962E26E31BD1/VS2013_RTM_ ...

  6. [LeetCode系列]最大容器问题

    给定n个数: a1, a2, ... , an. 代表着(i, ai)个点, 连接这些点与对应的(i, 0), 我们可以得到n条线. 请在这n条线中找出2条, 使得这两条线和x轴构成的容器能够容纳最多 ...

  7. [LeetCode系列]N皇后问题递归解法 -- 位操作方式

    N皇后问题: 给定8*8棋盘, 放置n个皇后, 使其互相不能攻击(即2个皇后不能放在同一行/列/正反对角线上), 求解共有多少种放置方式? 这个问题的解答网上有不少, 但是位操作解法的我看到的不多. ...

  8. caffemodel的读取与修改

    直接撸代码~ import caffe import numpy as np caffe.set_mode_cpu() net = caffe.Net('myprototxt.prototxt', ' ...

  9. NGINX conf 配置文件中的变量大全 可用变量列表及说明

    $args #这个变量等于请求行中的参数.$content_length #请求头中的Content-length字段.$content_type #请求头中的Content-Type字段.$docu ...

  10. 以太坊(二)安装Solidity编译器

    官方地址:https://solidity.readthedocs.io/en/develop/installing-solidity.html 推荐使用  remix   快速学习solidity  ...