`
klcwt
  • 浏览: 194614 次
  • 性别: Icon_minigender_1
  • 来自: 武汉
社区版块
存档分类
最新评论

Tomcat

阅读更多

Tomcat 各种连接器比较

 

Below is a small chart that shows how the connectors differentiate.

                  Java Blocking Connector       Java Nio Blocking Connector       APR Connector
    Classname         Http11Protocol                  Http11NioProtocol         Http11AprProtocol
    Tomcat Version   3.x 4.x 5.x 6.x                       6.x                     5.5.x 6.x
    Support Polling         NO                             YES                        YES
    Polling Size           N/A                   Unlimited - Restricted by mem        Unlimited - Configurable
    Read HTTP Request     Blocking                     Non Blocking                   Blocking
    Read HTTP Body        Blocking                     Sim Blocking                   Blocking
    Write HTTP Response   Blocking                     Sim Blocking                   Blocking
    SSL Support           Java SSL                     Java SSL                       OpenSSL
    SSL Handshake         Blocking                     Non blocking                   Blocking
    Max Connections       maxThreads                   See polling size               See polling size
    
    
    

 

Context 的监听器

Lifecycle Listeners

If you have implemented a Java object that needs to know when this Context is started or stopped, you can declare it by nesting a Listener element inside this element. The class name you specify must implement the org.apache.catalina.LifecycleListener interface, and the class must be packaged in a jar and placed in the $CATALINA_HOME/lib directory. It will be notified about the occurrence of the corresponding lifecycle events. Configuration of such a listener looks like this:

<Context path="/examples" ...>
  ...
  <Listener className="com.mycompany.mypackage.MyListener" ... >
  ...
</Context>

Note that a Listener can have any number of additional properties that may be configured from this element. Attribute names are matched to corresponding JavaBean property names using the standard property method naming patterns.

 

 

 

 

 

 

 

Request Filters

You can ask Catalina to check the IP address, or host name, on every incoming request directed to the surrounding Engine, Host, or Context element. The remote address or name will be checked against a configured list of "accept" and/or "deny" filters, which are defined using the Regular Expression syntax supported by the Jakarta Regexp regular expression library. Requests that come from locations that are not accepted will be rejected with an HTTP "Forbidden" error. Example filter declarations:

<Context path="/examples" ...>
  ...
  <Valve className="org.apache.catalina.valves.RemoteHostValve"
         allow="*.mycompany.com,www.yourcompany.com"/>
  <Valve className="org.apache.catalina.valves.RemoteAddrValve"
         deny="192.168.1.*"/>
  ...
</Context>

See Remote Address Filter and Remote Host Filter for more information about the configuration options that are supported.

 

 

 

 

Host Name Aliases

In many server environments, Network Administrators have configured more than one network name (in the Domain Name Service (DNS) server), that resolve to the IP address of the same server. Normally, each such network name would be configured as a separate Host element in conf/server.xml, each with its own set of web applications.

However, in some circumstances, it is desireable that two or more network names should resolve to the same virtual host, running the same set of applications. A common use case for this scenario is a corporate web site, where it is desireable that users be able to utilize either www.mycompany.com or company.com to access exactly the same content and applications.

This is accomplished by utilizing one or more Alias elements nested inside your Host element. For example:

<Host name="www.mycompany.com" ...>
  ...
  <Alias>mycompany.com</Alias>
  ...
</Host>

In order for this strategy to be effective, all of the network names involved must be registered in your DNS server to resolve to the same computer that is running this instance of Catalina

 

 

Single Sign On

In many environments, but particularly in portal environments, it is desireable to have a user challenged to authenticate themselves only once over a set of web applications deployed on a particular virtual host. This can be accomplished by nesting an element like this inside the Host element for this virtual host:

<Host name="localhost" ...>
  ...
  <Valve className="org.apache.catalina.authenticator.SingleSignOn"
         debug="0"/>
  ...
</Host>

The Single Sign On facility operates according to the following rules:

  • All web applications configured for this virtual host must share the same Realm. In practice, that means you can nest the Realm element inside this Host element (or the surrounding Engine element), but not inside a Context element for one of the involved web applications.
  • As long as the user accesses only unprotected resources in any of the web applications on this virtual host, they will not be challenged to authenticate themselves.
  • As soon as the user accesses a protected resource in any web application associated with this virtual host, the user will be challenged to authenticate himself or herself, using the login method defined for the web application currently being accessed.
  • Once authenticated, the roles associated with this user will be utilized for access control decisions across all of the associated web applications, without challenging the user to authenticate themselves to each application individually.
  • As soon as the user logs out of one web application (for example, by invalidating the corresponding session if form based login is used), the user's sessions in all web applications will be invalidated. Any subsequent attempt to access a protected resource in any application will require the user to authenticate himself or herself again.
  • The Single Sign On feature utilizes HTTP cookies to transmit a token that associates each request with the saved user identity, so it can only be utilized in client environments that support cookies

 

 

 

 

分享到:
评论

相关推荐

    tomcat7tomcat8tomcat9

    Tomcat是Apache软件基金会下的一个开源项目,是一个广泛使用的Java Servlet容器,特别因为其轻量级、高效能和稳定性而闻名。它实现了Java Servlet和JavaServer Pages(JSP)规范,使得开发者能够用Java语言来编写...

    tomcat7,tomcat8,tomcat9

    Tomcat7、Tomcat8和Tomcat9是不同版本的Tomcat,每个版本都有其特性和改进。 **Tomcat7**: Tomcat7是2011年发布的,它主要支持Java Servlet 3.0和JSP 2.2规范。这个版本引入了一些重要改进,包括增强的安全性、更...

    Tomcat7.0 tomcat最新版本

    Apache Tomcat 7.0是Java Servlet和JavaServer Pages(JSP)的开源Web应用程序服务器,由Apache软件基金会开发和维护。它是最流行的轻量级应用服务器,特别适合部署Java Web应用程序。Tomcat 7.0是7.x系列的一个版本...

    tomcat 7 和 tomcat 8

    Tomcat 7 和 Tomcat 8 是两个非常重要的版本,它们是Apache软件基金会开发的开源Java Servlet容器,主要用于运行Java Web应用程序。这两个版本都遵循Java EE(Enterprise Edition)规范,但各自具有不同的特点和改进...

    tomcat-7.0.0安装版和tomcat-7.0.11免安装版

    Apache Tomcat是一款广泛应用的开源Java Servlet容器,它实现了Java EE的Web部分,特别是Servlet和JSP规范。在本文中,我们将深入探讨Tomcat 7.0.0的安装版和7.0.11的免安装版之间的差异,以及如何进行安装和配置。 ...

    Tomcat 10 软件及其源码

    版本:apache-tomcat-10.1.23 Tomcat 10 是 Apache Tomcat 的一个版本,它引入了一些新的功能和改进。以下是一些关键的新增功能: 1. JDK 11 支持:Tomcat 10 支持 JDK 11,这意味着它可以用于 JDK 11 的项目中。 2....

    Tomcat 自测最好用的版本 兼容性最好的 tomcat9

    tomcat

    Linux(CentOS7)安装Tomcat与设置Tomcat为开机启动项(tomcat8为例)

    在Linux(CentOS7)操作系统中安装Apache Tomcat并将其设置为开机启动是一项常见的任务,特别是在部署Java web应用时。本篇文章将详细讲解如何在CentOS7上安装Tomcat8并将其配置为自启动服务。 首先,我们来了解...

    tomcat6,用于idea适配低版本的tomcat

    标题中的“tomcat6”指的是Apache Tomcat 6,这是一个开源的应用服务器,主要用来部署和运行Java Servlet和JavaServer Pages(JSP)应用程序。在Java Web开发领域,Tomcat是应用最广泛的轻量级服务器之一,尤其对于...

    tomcat打补丁方法

    ### Tomcat打补丁方法详解 #### 一、前言 Apache Tomcat是一款开源的Servlet容器,它能够作为Web服务器独立运行,也可以与Apache等其他Web服务器配合使用。Tomcat因其简单性和灵活性,在中小型项目中得到了广泛...

    Tomcat深入剖析pdf+源码(Tomcat运行原理)

    《Tomcat深入剖析》这本书是理解Apache Tomcat服务器工作原理的宝贵资料,它由美国作者撰写并被翻译成中文,适合各个层次的开发者阅读。通过深入学习,读者能够对Tomcat的内部机制有全面而深入的理解,从而更好地...

    tomcat-redis-session-manager-1.2-tomcat-7-java-7

    tomcat-redis-session-manager-1.2-tomcat-7-java-7tomcat-redis-session-manager-1.2-tomcat-7-java-7tomcat-redis-session-manager-1.2-tomcat-7-java-7tomcat-redis-session-manager-1.2-tomcat-7-java-7tomcat-...

    tomcat-redis-session-manager的jar包-包含Tomcat7和Tomcat8

    《深入理解Tomcat-Redis-Session-Manager:在Tomcat7和Tomcat8中的应用》 在现代Web应用程序开发中,session管理是一个至关重要的环节,它涉及到用户会话的持久化和跨请求的数据共享。传统的session管理方式在高...

    tomcat-juli.jar,tomcat-juli-adapters.jar,log4j-1.2.12.jar tomcat 6日志输出

    在Java Web应用服务器Tomcat 6中,日志管理是一个至关重要的部分,它帮助开发者跟踪应用程序的运行状态,排查问题,以及记录系统活动。这里提到的`tomcat-juli.jar`、`tomcat-juli-adapters.jar`和`log4j-1.2.12.jar...

    apache-tomcat-7.0.52 解压免安装版tomcat7

    Apache Tomcat 7.0.52 是一个广泛使用的开源软件,它是一个实现了Java Servlet、JavaServer Pages(JSP)和Java EE的Web应用程序容器。这个版本是免安装的,这意味着用户无需经过复杂的安装过程,只需解压到指定目录...

    tomcat7.0下的64位的tomcat7.exe 和tomcat7w.exe

    标题中的“tomcat7.0下的64位的tomcat7.exe 和tomcat7w.exe”指的是Apache Tomcat服务器在7.0版本中为64位操作系统提供的可执行文件。Tomcat是Apache软件基金会的一个开源项目,它是一个流行的Java Servlet容器,...

    idea tomcat runner插件

    **Idea Tomcat Runner插件详解** 在Java开发领域,IntelliJ IDEA是一款备受推崇的集成开发环境(IDE),尤其以其高效、智能的代码编辑功能和丰富的插件生态而著称。对于使用Java Web应用的开发者来说,Tomcat服务器...

    tomcat-jdbc数据源所需jar包tomcat-jdbc.jar+tomcat-juli.jar

    在Java Web应用中,Tomcat是一个广泛使用的开源应用服务器,它提供了Servlet容器和JSP引擎等核心功能。在处理数据库连接方面,Tomcat提供了一种高效且可管理的数据源实现,名为“tomcat-jdbc数据源”。这个数据源是...

    tomcat 7 最新版本 apache-tomcat-7.0.109

    Apache Tomcat 7是Apache软件基金会的一个开源项目,专门用于实现Java Servlet和JavaServer Pages(JSP)技术的标准,以及Java EE的Web应用程序部署。这个最新版本,即7.0.109,包含了对先前版本的改进和修复,旨在...

    tomcat-7.0.108.zip

    标题中的"tomcat-7.0.108.zip"是一个Tomcat服务器的特定版本,这里指的是Apache Tomcat 7.0.108。Tomcat是一款开源的Java Servlet容器,主要用于运行Java web应用程序,包括JSP和Servlet。这个版本号(7.0.108)表明...

Global site tag (gtag.js) - Google Analytics