启用server模块,执行如下命令:

java -jar $JETTY_HOME/start.jar --add-modules=server

命令的输出,如下:

INFO  : server          initialized in ${jetty.base}/start.d/server.ini
INFO : Base directory was modified

查看server模块的配置文件,执行如下命令:

cat $JETTY_BASE/start.d/server.ini

命令的输出,如下:

# ---------------------------------------
# Module: server
# Enables and configures the Jetty server.
# This module does not enable any network protocol support.
# To enable a specific network protocol such as HTTP/1.1, you must enable the correspondent Jetty module.
# ---------------------------------------
--modules=server ### Common HTTP configuration
## Scheme to use to build URIs for secure redirects
# jetty.httpConfig.secureScheme=https ## Port to use to build URIs for secure redirects
# jetty.httpConfig.securePort=8443 ## Response content buffer size (in bytes)
# jetty.httpConfig.outputBufferSize=32768 ## Max response content write length that is buffered (in bytes)
# jetty.httpConfig.outputAggregationSize=8192 ## If HTTP/1.x persistent connections should be enabled
# jetty.httpConfig.persistentConnectionsEnabled=true ## Max request headers size (in bytes)
# jetty.httpConfig.requestHeaderSize=8192 ## Max response headers size (in bytes)
# jetty.httpConfig.responseHeaderSize=8192 ## Whether to send the Server: header
# jetty.httpConfig.sendServerVersion=true ## Whether to send the Date: header
# jetty.httpConfig.sendDateHeader=false ## Max per-connection header cache size (in nodes)
# jetty.httpConfig.headerCacheSize=1024 ## Whether, for requests with content, delay dispatch until some content has arrived
# jetty.httpConfig.delayDispatchUntilContent=true ## Maximum number of error dispatches to prevent looping
# jetty.httpConfig.maxErrorDispatches=10 ## Relative Redirect Locations allowed
# jetty.httpConfig.relativeRedirectAllowed=true ## Whether to use direct ByteBuffers for reading or writing
# jetty.httpConfig.useInputDirectByteBuffers=true
# jetty.httpConfig.useOutputDirectByteBuffers=true ## HTTP Compliance: RFC7230, RFC7230_LEGACY, RFC2616, RFC2616_LEGACY, LEGACY
# jetty.httpConfig.compliance=RFC7230 ## URI Compliance: DEFAULT, LEGACY, RFC3986, RFC3986_UNAMBIGUOUS, UNSAFE
# jetty.httpConfig.uriCompliance=DEFAULT ## Cookie compliance mode for parsing request Cookie headers: RFC6265_STRICT, RFC6265, RFC6265_LEGACY, RFC2965, RFC2965_LEGACY
# jetty.httpConfig.requestCookieCompliance=RFC6265 ## Cookie compliance mode for generating response Set-Cookie: RFC2965, RFC6265
# jetty.httpConfig.responseCookieCompliance=RFC6265 ### Server configuration
## Whether ctrl+c on the console gracefully stops the Jetty server
# jetty.server.stopAtShutdown=true ## Timeout in ms to apply when stopping the server gracefully
# jetty.server.stopTimeout=5000 ## Dump the state of the Jetty server, components, and webapps after startup
# jetty.server.dumpAfterStart=false ## The temporary directory used by the Jetty server and as a root for its contexts
# jetty.server.tempDirectory= ## Dump the state of the Jetty server, components, and webapps before shutdown
# jetty.server.dumpBeforeStop=false ### Server Scheduler Configuration
## The scheduler thread name, defaults to "Scheduler-{hashCode()}" if blank.
# jetty.scheduler.name= ## Whether the server scheduler threads are daemon.
# jetty.scheduler.daemon=false ## The number of server scheduler threads.
# jetty.scheduler.threads=1 ## Whether the handlers of the ContextHandlerCollection can be updated once the server is started
## If set to false, then eeN-deploy module jetty.deploy.scanInterval should also be set to 0.
# jetty.server.contexts.dynamic=true ## Should the DefaultHandler serve the jetty favicon.ico from the root.
# jetty.server.default.serveFavIcon=true ## Should the DefaultHandler show a list of known contexts in a root 404 response.
# jetty.server.default.showContexts=true

各参数的说明,如下:

  • HTTP协议的常见参数

    • jetty.httpConfig.secureScheme

      重定向时,安全通道使用的协议。默认值为https

    • jetty.httpConfig.securePort

      重定向时,安全通道的监听端口。默认值为8443

    • jetty.httpConfig.outputBufferSize

      响应消息的缓冲区容量,单位:字节。默认值为32768

    • jetty.httpConfig.outputAggregationSize

      返回响应数据时,单次写操作的最大数据量,单位:字节。默认值为8192

    • jetty.httpConfig.persistentConnectionsEnabled

      是否启用HTTP/1.x中定义的HTTP链接保持特性。

    • jetty.httpConfig.requestHeaderSize

      HTTP请求消息中头部的最大长度,单位:字节。默认值为8192

    • jetty.httpConfig.responseHeaderSize

      HTTP响应消息中头部的最大长度,单位:字节。默认值为8192

    • jetty.httpConfig.sendServerVersion

      是否在HTTP响应消息中增加头部Server。默认值为true

      如下为样例:

      HTTP/1.1 200 OK
      Content-Length: 0
      Server: Jetty(12.0.6)

      基于业务安全的考虑,通过不建议开启,即修改为false

    • jetty.httpConfig.sendDateHeader

      响应消息中,是否发送HTTP头部Date字段。默认值为false

    • jetty.httpConfig.headerCacheSize

      处理HTTP头部时的缓冲数据的大小,单位:字节,默认值为1024

    • jetty.httpConfig.delayDispatchUntilContent

      收到消息体之后再分发请求对象,默认值为true

    • jetty.httpConfig.maxErrorDispatches

      错误场景下分发次数的最大值,避免循环处理,默认值为10

    • jetty.httpConfig.relativeRedirectAllowed

      是否允许重定向操作,默认值为true

    • jetty.httpConfig.useInputDirectByteBuffers

      默认值为true

    • jetty.httpConfig.useOutputDirectByteBuffers

      默认值为true

  • jetty.httpConfig.compliance

    HTTP协议规范兼容性的选项,可选值如下:

    • RFC7230
    • RFC7230_LEGACY
    • RFC2616
    • RFC2616_LEGACY
    • LEGACY
  • jetty.httpConfig.uriCompliance

    URI规范的兼容性的选项,可选值如下:

    • DEFAULT
    • LEGACY
    • RFC3986
    • RFC3986_UNAMBIGUOUS
    • UNSAFE
  • jetty.httpConfig.requestCookieCompliance

    Cookie规范的兼容性的选项,可选值如下:

    • RFC6265_STRICT
    • RFC6265
    • RFC6265_LEGACY
    • RFC2965
    • RFC2965_LEGACY
  • jetty.httpConfig.responseCookieCompliance

    Cookie规范的兼容性的选项,可选值如下:

    • RFC2965
    • RFC6265
  • jetty.server.stopAtShutdown

    Jetty进程收到控制台发送的Ctrl+C时,优雅退出。默认值为true

  • jetty.server.stopTimeout

    优雅退出时的超时值,单位:毫秒。默认值为5000,即5秒。

  • jetty.server.dumpAfterStart

    启动结束后,输出Jetty进程的状态,组件等信息。

  • jetty.server.tempDirectory

    Jetty进程运行期使用的临时目录。

  • jetty.server.dumpBeforeStop

    Jetty进程退出前,输出Jetty进程的状态,组件等信息。

  • jetty.scheduler.name

  • jetty.scheduler.daemon

  • jetty.scheduler.threads

  • jetty.server.contexts.dynamic

  • jetty.server.default.serveFavIcon

  • jetty.server.default.showContexts

Jetty的server模块的更多相关文章

  1. python3用http.server模块搭建简易版服务器

    基本流程: 1.需要的支持 1)python3用http模块下的子模块,即:http.server模块 2)将希望共享的文件放在c盘下,如:C:\游戏行业面试专用 2.打开cmd,cd c:\\pyt ...

  2. 「从零单排canal 05」 server模块源码解析

    基于1.1.5-alpha版本,具体源码笔记可以参考我的github:https://github.com/saigu/JavaKnowledgeGraph/tree/master/code_read ...

  3. Swoole源代码学习记录(十三)——Server模块具体解释(上)

    Swoole版本号:1.7.5-stable Github地址:https://github.com/LinkedDestiny/swoole-src-analysis 最终能够正式进入Server. ...

  4. Install Jetty web server on CentOS 7 / RHEL 7

    http://www.eclipse.org/jetty/download.html http://www.eclipse.org/jetty/documentation/current/startu ...

  5. python3 使用http.server模块 搭建一个简易的http服务器

    from http.server import HTTPServer, BaseHTTPRequestHandler import json data = {'result': 'this is a ...

  6. Swoole 源码分析——Server模块之Worker事件循环

    swManager_loop 函数 manager 进程管理 manager 进程开启的时候,首先要调用 onManagerStart 回调 添加信号处理函数 swSignal_add,SIGTERM ...

  7. Swoole 源码分析——Server模块之TaskWorker事件循环

    swManager_start 创建进程流程 task_worker 进程的创建可以分为三个步骤:swServer_create_task_worker 申请所需的内存.swTaskWorker_in ...

  8. Jetty web server 远程共享缓冲区泄漏漏洞学习

    https://www.secpulse.com/archives/4911.html https://www.tiejiang.org/11628.html http://blog.gdssecur ...

  9. 使用Jetty搭建Java Websocket Server,实现图像传输

    https://my.oschina.net/yushulx/blog/298140 How to Implement a Java WebSocket Server for Image Transm ...

  10. 详解web容器 - Jetty与Tomcat孰强孰弱

    Jetty 基本架构 Jetty目前的是一个比较被看好的 Servlet 引擎,它的架构比较简单,也是一个可扩展性和非常灵活的应用服务器.它有一个基本数据模型,这个数据模型就是 Handler(处理器 ...

随机推荐

  1. 详解SSL证书系列(3)如何选择SSL证书

    我们知道了在网站部署 SSL 证书后,不管是对网站本身还是对网站的用户都能够带来许多好处.那么随着 HTTPS的普及,市面上也出现了各种不同的 SSL 证书.并且由于 SSL 证书的多样性,很多人对于 ...

  2. 浅谈errgroup的使用以及源码分析

    本文讲解的是golang.org/x/sync这个包中的errgroup 1.errgroup 的基础介绍 学习过 Go 的朋友都知道 Go 实现并发编程是比较容易的事情,只需要使用go关键字就可以开 ...

  3. JAVA 考试管理系统 大作业(一):需求分析

    好家伙,有需要的拿去借鉴吧(虽然我也百度了很多) 题目如下: 题目四:考试管理系统 (选做要求:使用图形用户界面) 分3种用户角色:教务员(具有管理权限).教师.学生 l  教务员:可以进行用户管理( ...

  4. 亲测可用,ChatGPT 对话技巧

      "Linux终端" "我希望你充当一个 linux 终端.我会输入命令,你会回复终端应该显示的内容.我希望你只回复一个唯一代码块内的终端输出,没有别的.不要写解释.除 ...

  5. multiple definition of `MainWindow::MainWindow(QWidget*)

    qt刚建好工程运行的时候没问题,后面写了一点东西之后,再运行就发现出现MainWindow重复,我不理解. 解决方法:删除重复的引用. 再重新构建一下就好了.

  6. Zabbix MQQT协议监控 loT设备

    一. 项目背景 监控异地局域网主机(主机内有物联5G卡 可以单方面向特定的云服务器传输信息)这里采用 zabbix 5xx系列 agent2 -6.2 版本 主动模式,即客户端向服务端注册.   二. ...

  7. 记本地新建一个gradle方式springboot项目过程

    打算使用gradle在idea新建个springboot项目,然后坑很多,记录一下 原来我的idea应该是社区版,新建项目时候没有可以选择spring相关配置,然后卸载了重装,之前问题是启动是启动起来 ...

  8. Ubuntu(Linux) PyQt5 QtUIFile 转换为 PythonModule (pyuic.py/pyuic脚本)

    PS:要转载请注明出处,本人版权所有. PS: 这个只是基于<我自己>的理解, 如果和你的原则及想法相冲突,请谅解,勿喷. 前置说明   本文作为本人csdn blog的主站的备份.(Bl ...

  9. Excel多列求平均值

    数据源如下所示 需求描述:现在需要根据水果名称和月份求出对应水果的平均单价 一.添加一列辅助列(=A2&B2) 二.Ctrl+A选择所有数据插入数据透视表,选择辅助列到行,客单价到值(值字段设 ...

  10. verilog之monitor

    verilog之monitor 1.函数作用 monitor用于追踪变量的变化情况,这在实际使用中还是非常实用的.电路中的某个信号的变化可以通过monitor检测,不需要使用波形图去仔细查找.也便于准 ...