当前位置: 首页 > news >正文

苏州建设教育协会网站做h的小说网站有哪些

苏州建设教育协会网站,做h的小说网站有哪些,旅游网页有哪些,郑州知名网站推广前言 Tomcat主配置文件(server.xml)是Tomcat服务器的主要配置文件,文件位置在conf目录下,它包含了Tomcat的全局配置信息,包括监听端口、虚拟主机、安全配置、连接器等。 目录 1 server.xml组件类别 2 组件介绍 3 se…

前言

Tomcat主配置文件(server.xml)是Tomcat服务器的主要配置文件,文件位置在conf目录下,它包含了Tomcat的全局配置信息,包括监听端口、虚拟主机、安全配置、连接器等。

目录

1 server.xml组件类别

2 组件介绍

3 server.xml配置文件详解

4 主要参数详解

 4.1 Connector主要参数详解

 4.2 host参数详解

 4.3 Context参数说明


1 server.xml组件类别

顶级组件:位于整个配置的顶层。如:server。

容器类组件:可以包含其他组件的组件。如:service、engine、host、context。

连接器组件:连接用户请求至Tomcat。如:connector。

被嵌套类组件:位于一个容器中,不能包含其他组件。如value、logger。

2 组件介绍

组件名称

功能介绍

engine

核心容器组件,定义Tomcat服务器内部的容器,与Service元素一起定义了Tomcat服务器的整体架构。catalina引擎,负责通过connector接收用户请求,并处理请求,将请求转至对应的虚拟主机host。

host

类似于httpd中的虚拟主机,一般而言支持基于FQDN的虚拟主机,允许在同一台服务器上运行多个网站或应用程序。

context

定义一个应用程序的上下文,包括Web应用程序的路径、名称、文档根目录等,是一个最内层的容器类组件(不能再嵌套)。配置context的主要目的指定对应的webapp的根目录,类似于httpd的alias,其还能为webapp指定额外的属性,如部署方式等。

connector

定义Tomcat服务器与外部应用程序或客户端之间的连接,接收用户请求,通常用于HTTP或HTTPS通讯,类似于httpd的listen配置监听端口。

Service

定义Tomcat服务器提供的服务,通常包含一个或多个Connector(连接器),但只能有一个引擎engine。

Server

定义Tomcat服务器的全局属性,其中的port属性定义了Tomcat服务器本身监听的端口号。

Valve

通过提供不同类型的阀门,拦截请求并在将其转至对应的webapp前进行某种处理操作,可以用于任何容器中,比如记录日志(access log valve)、基于IP做访问控制(remote address filter valve),实现对Tomcat服务器的访问控制、流量控制、日志记录等功能。

loggor

日志记录器,用于记录组件内部的状态信息,可以用于除context外的任何容器中。

Realm

定义Tomcat服务器的安全认证和授权机制。可以用于任意容器类的组件中,关联一个用户认证库,实现认证和授权。可以关联的认证库有: UserDatabaseRealm(使用JNDI自定义的用户认证库)、MemoryRealm(认证信息定义在tomcat-users.xml中)和JDBCRealm(认证信息定义在数据库中,并通过JDBC连接至数据库中查找认证用户)。

3 server.xml配置文件详解

server.xml 文件原版:

<?xml version="1.0" encoding="UTF-8"?>
<!--Licensed to the Apache Software Foundation (ASF) under one or morecontributor license agreements.  See the NOTICE file distributed withthis work for additional information regarding copyright ownership.The ASF licenses this file to You under the Apache License, Version 2.0(the "License"); you may not use this file except in compliance withthe License.  You may obtain a copy of the License athttp://www.apache.org/licenses/LICENSE-2.0Unless required by applicable law or agreed to in writing, softwaredistributed under the License is distributed on an "AS IS" BASIS,WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.See the License for the specific language governing permissions andlimitations under the License.
-->
<!-- Note:  A "Server" is not itself a "Container", so you may notdefine subcomponents such as "Valves" at this level.Documentation at /docs/config/server.html-->
<Server port="8005" shutdown="SHUTDOWN"><Listener className="org.apache.catalina.startup.VersionLoggerListener" /><!-- Security listener. Documentation at /docs/config/listeners.html<Listener className="org.apache.catalina.security.SecurityListener" />--><!-- APR library loader. Documentation at /docs/apr.html --><Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" /><!-- Prevent memory leaks due to use of particular java/javax APIs--><Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" /><Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" /><Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" /><!-- Global JNDI resourcesDocumentation at /docs/jndi-resources-howto.html--><GlobalNamingResources><!-- Editable user database that can also be used byUserDatabaseRealm to authenticate users--><Resource name="UserDatabase" auth="Container"type="org.apache.catalina.UserDatabase"description="User database that can be updated and saved"factory="org.apache.catalina.users.MemoryUserDatabaseFactory"pathname="conf/tomcat-users.xml" /></GlobalNamingResources><!-- A "Service" is a collection of one or more "Connectors" that sharea single "Container" Note:  A "Service" is not itself a "Container",so you may not define subcomponents such as "Valves" at this level.Documentation at /docs/config/service.html--><Service name="Catalina"><!--The connectors can use a shared executor, you can define one or more named thread pools--><!--<Executor name="tomcatThreadPool" namePrefix="catalina-exec-"maxThreads="150" minSpareThreads="4"/>--><!-- A "Connector" represents an endpoint by which requests are receivedand responses are returned. Documentation at :Java HTTP Connector: /docs/config/http.htmlJava AJP  Connector: /docs/config/ajp.htmlAPR (HTTP/AJP) Connector: /docs/apr.htmlDefine a non-SSL/TLS HTTP/1.1 Connector on port 8080--><Connector port="8080" protocol="HTTP/1.1"connectionTimeout="20000"redirectPort="8443"maxParameterCount="1000"/><!-- A "Connector" using the shared thread pool--><!--<Connector executor="tomcatThreadPool"port="8080" protocol="HTTP/1.1"connectionTimeout="20000"redirectPort="8443"maxParameterCount="1000"/>--><!-- Define an SSL/TLS HTTP/1.1 Connector on port 8443This connector uses the NIO implementation. The defaultSSLImplementation will depend on the presence of the APR/nativelibrary and the useOpenSSL attribute of the AprLifecycleListener.Either JSSE or OpenSSL style configuration may be used regardless ofthe SSLImplementation selected. JSSE style configuration is used below.--><!--<Connector port="8443" protocol="org.apache.coyote.http11.Http11NioProtocol"maxThreads="150" SSLEnabled="true"maxParameterCount="1000"><SSLHostConfig><Certificate certificateKeystoreFile="conf/localhost-rsa.jks"type="RSA" /></SSLHostConfig></Connector>--><!-- Define an SSL/TLS HTTP/1.1 Connector on port 8443 with HTTP/2This connector uses the APR/native implementation which always usesOpenSSL for TLS.Either JSSE or OpenSSL style configuration may be used. OpenSSL styleconfiguration is used below.--><!--<Connector port="8443" protocol="org.apache.coyote.http11.Http11AprProtocol"maxThreads="150" SSLEnabled="true"maxParameterCount="1000"><UpgradeProtocol className="org.apache.coyote.http2.Http2Protocol" /><SSLHostConfig><Certificate certificateKeyFile="conf/localhost-rsa-key.pem"certificateFile="conf/localhost-rsa-cert.pem"certificateChainFile="conf/localhost-rsa-chain.pem"type="RSA" /></SSLHostConfig></Connector>--><!-- Define an AJP 1.3 Connector on port 8009 --><!--<Connector protocol="AJP/1.3"address="::1"port="8009"redirectPort="8443"maxParameterCount="1000"/>--><!-- An Engine represents the entry point (within Catalina) that processesevery request.  The Engine implementation for Tomcat stand aloneanalyzes the HTTP headers included with the request, and passes themon to the appropriate Host (virtual host).Documentation at /docs/config/engine.html --><!-- You should set jvmRoute to support load-balancing via AJP ie :<Engine name="Catalina" defaultHost="localhost" jvmRoute="jvm1">--><Engine name="Catalina" defaultHost="localhost"><!--For clustering, please take a look at documentation at:/docs/cluster-howto.html  (simple how to)/docs/config/cluster.html (reference documentation) --><!--<Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/>--><!-- Use the LockOutRealm to prevent attempts to guess user passwordsvia a brute-force attack --><Realm className="org.apache.catalina.realm.LockOutRealm"><!-- This Realm uses the UserDatabase configured in the global JNDIresources under the key "UserDatabase".  Any editsthat are performed against this UserDatabase are immediatelyavailable for use by the Realm.  --><Realm className="org.apache.catalina.realm.UserDatabaseRealm"resourceName="UserDatabase"/></Realm><Host name="localhost"  appBase="webapps"unpackWARs="true" autoDeploy="true"><!-- SingleSignOn valve, share authentication between web applicationsDocumentation at: /docs/config/valve.html --><!--<Valve className="org.apache.catalina.authenticator.SingleSignOn" />--><!-- Access log processes all example.Documentation at: /docs/config/valve.htmlNote: The pattern used is equivalent to using pattern="common" --><Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"prefix="localhost_access_log" suffix=".txt"pattern="%h %l %u %t &quot;%r&quot; %s %b" /></Host></Engine></Service>
</Server>

将原文件中英文注释行删掉并添加了中文详解注释。

<?xml version="1.0" encoding="UTF-8"?>


<Server> 元素代表整个容器,是Tomcat实例的顶层元素,由org.apache.catalina.Server接口来定义,它包含一个<Service>元素,并且它不能做为任何元素的子元素。
port 指定Tomcat监听shutdown命令端口,终止服务器运行时,必须在Tomcat服务器所在的机器上发出shutdowm命令,该属性是必须的,其端口号可以修改。
shutdown 指定终止Tomcat服务器运行时,发给Tomcat服务器的shutdown监听端口的字符串,该属性必须设置。
<Server port="8005" shutdown="SHUTDOWN">
  <Listener className="org.apache.catalina.startup.VersionLoggerListener" />
  <Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />
  <Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
  <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
  <Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" />
  <GlobalNamingResources>
    <Resource name="UserDatabase" auth="Container"
              type="org.apache.catalina.UserDatabase"
              description="User database that can be updated and saved"
              factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
              pathname="conf/tomcat-users.xml" />
  </GlobalNamingResources>


Service服务组件
  <Service name="Catalina">


Connector主要参数
    <Connector port="8080" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443"
               maxParameterCount="1000"
               />


Engine 核心容器组件,catalina引擎,负责通过connector接收用户请求,并处理请求,将请求转至对应的虚拟主机host。
defaultHost 指定缺省的处理请求的主机名,它至少与其中的一个host元素的name属性值一样。
    <Engine name="Catalina" defaultHost="localhost">


Realm 表示存放的用户名、密码及role的数据库。 
      <Realm className="org.apache.catalina.realm.LockOutRealm">
        <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
               resourceName="UserDatabase"/>
      </Realm>


host参数
      <Host name="localhost"  appBase="webapps"
            unpackWARs="true" autoDeploy="true">
        <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
               prefix="localhost_access_log" suffix=".txt"
               pattern="%h %l %u %t &quot;%r&quot; %s %b" />

      </Host>
    </Engine>
  </Service>
</Server>

4 主要参数详解

 4.1 Connector主要参数详解

Connector是Tomcat服务器与外部应用程序或客户端之间的连接,常见的Connector类型包括HTTP、HTTPS、AJP等。

 

参数

参数说明

Connector

定义Tomcat服务器与外部应用程序或客户端之间的连接,接收用户请求,通常用于HTTP或HTTPS通讯,类似于httpd的listen配置监听端口。

port

指定Connector监听的端口号,用于监听来自客户端的请求。

protocol

连接器使用的协议,指定Connector要使用的协议类型,常见的有HTTP/1.1、HTTP/2、AJP/1.3等。

connectionTimeout

指定超时的时间数(以毫秒为单位),即在指定时间内未收到客户端请求,则连接被关闭。

redirectPort

指定重定向端口,即在使用HTTPS时,自动将HTTP请求重定向到HTTPS。

maxParameterCount

最大可以创建的处理请求的线程数。

 4.2 host参数详解

在Tomcat中,一个物理服务器可以部署多个虚拟主机,每个虚拟主机拥有自己的域名和独立的配置,这些虚拟主机通过Host元素来实现。

 

参数

参数说明

host

Server元素的子元素,代表一个虚拟主机

name

虚拟主机的名称

appBase

指定该虚拟主机的Web应用程序的基础目录,Web应用程序在该目录下部署。

unpackWARs

是否在部署Web应用程序时解压WAR文件,可以提高Web应用程序的访问速度。

autoDeploy

是否自动部署新的Web应用程序,如果设置为true,则Tomcat会自动检测appBase目录下的新的Web应用程序,并进行自动部署。

 4.3 Context参数说明

在Tomcat中,Context参数是指一个Web应用程序的上下文信息,它包含了Web应用程序的配置信息、资源、Servlet等。当一个Web应用程序被部署到Tomcat服务器上时,Tomcat会为该Web应用程序创建一个Context对象,用于管理Web应用程序的运行时状态。

参数

参数说明

Context

表示一个web应用程序,通过为war文件。

docBase

表示Web应用程序的根目录,即Web应用程序的发布目录。应用程序的路径或者是WAR文件存放的路径,也可以使用相对路径,起始路径为此Context所属Host中appBase定义的路径。

path

表示Web应用程序的上下文路径,即访问该Web应用程序的URL路径。

reloadable

这个属性非常重要,如果为true,则tomcat会白动检测应用程序的/WEB-INF/lib和/WEB-INF/classes目录的变化,自动装载新的应用程序,可以在不重启tomcat的情况下改变应用程序。

crossContext

用于指定不同的Web应用程序之间是否可以共享ServletContext对象。如果crossContext被设置为true,则表示允许跨上下文共享ServletContext对象,否则不允许。

http://www.yayakq.cn/news/859418/

相关文章:

  • 做网站的费用的会计分录wordpress评论显示分页
  • 汕尾手机网站开发株洲渌口区
  • 我国有哪些企业网站wordpress自定义文章模板插件
  • 建设网站的工作做网站怎么收费多少
  • 廊坊做网站教程优秀网站专题
  • 佛山网站建设公司哪家最好阿里巴巴怎样做网站
  • 陕西铜川煤矿建设有限公司网站做网站找哪个部门
  • 合肥网站推广公司关键词的优化和推广
  • vue 做门户网站wordpress简便安装
  • 医院网站源码php天津自动seo
  • 找人做软件网站怎么制作一个微信小程序
  • 手机回收网站开发如何搜索网页关键词
  • 连云港东海县做网站自己网站建设问题
  • 建设网站用什么服务器合肥网页设计培训班
  • 做攻略的网站海南网络公司网站建设
  • 科技信息网站建设的背景外贸seo是啥
  • 策划文案的网站南平抖音搜索排名seo软件
  • 兴义市住房和城乡建设网站月销售wordpress 变慢
  • html网站模版it行业含金量高的证书
  • 住房和城乡建设岗位评定网站2023营业执照年检入口官网
  • 常用的设计网站有哪些wordpress门户型多栏设计
  • 宜昌网站建设兼职wordpress文档库主题
  • 设计网站数据用html做家谱网站代码
  • 博客网站 做淘宝客wordpress的列表
  • 网站建设公司河南郑州青岛网页制作网站
  • 制作网站视频优化系统功能
  • seo网站排名网页备用页
  • 网站建设的技术有哪些方面sql可以做网站吗
  • 网站制作网站推广百度广告投放代理商
  • 咖啡网站建设的优势济南网络公司排名