`
klcwt
  • 浏览: 190113 次
  • 性别: 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

 

 

 

 

分享到:
评论

相关推荐

    tomcat5.5tomcat最新客户端

    tomcat最新客户端tomcat最新客户端tomcat最新客户端tomcat最新客户端tomcat最新客户端tomcat最新客户端tomcat最新客户端tomcat最新客户端tomcat最新客户端tomcat最新客户端tomcat最新客户端tomcat最新客户端tomcat...

    apache-tomcat-9.0.45-windows-x64

    apache-tomcat-9.0.45-windows-x64apache-tomcat-9.0.45-windows-x64apache-tomcat-9.0.45-windows-x64apache-tomcat-9.0.45-windows-x64apache-tomcat-9.0.45-windows-x64apache-tomcat-9.0.45-windows-x64apache-...

    apache-tomcat-10.0.8.zip

    Apache Tomcat 软件是Jakarta Servlet、 Jakarta Server Pages、 Jakarta Expression Language、 Jakarta WebSocket、 Jakarta Annotations和 Jakarta Authentication 规范的开源实现 。 压缩包内容: apache-...

    tomcat7tomcat8tomcat9

    内含tomcat7 tomcat8 tomcat9免安装版本;供需要的人下载。

    tomcat-redis-session-manager for tomcat8.5

    文件名写错了,此压缩文件支持tomcat8.5。是否支持8.0请自行测试,本人只测试了8.5,可以使用。压缩文件包括tomcat-redis-session-manager-master-2.0.0.jar、jedis-2.7.3.jar、commons-pool2-2.3.jar三个jar包使用...

    开发工具 apache-tomcat-8.0.41-windows-x86

    开发工具 apache-tomcat-8.0.41-windows-x86开发工具 apache-tomcat-8.0.41-windows-x86开发工具 apache-tomcat-8.0.41-windows-x86开发工具 apache-tomcat-8.0.41-windows-x86开发工具 apache-tomcat-8.0.41-...

    tomcat7,tomcat8,tomcat9

    包含tomcat7,tomcat8,tomcat9,解压、在eclipse配置好即可。

    32位tomcat-7.0.55 工具下载

    Tomcat是Apache 软件基金会(Apache Software Foundation)的Jakarta 项目中的一个核心项目,由Apache、Sun 和其他一些公司及个人共同开发而成。由于有了Sun 的参与和支持,最新的Servlet 和JSP 规范总是能在Tomcat ...

    tomcat6.0 修改启动内存设置 java jvm参数配置

    在/usr/local/apache-tomcat-5.5.23/bin目录下的catalina.sh 添加:JAVA_OPTS='-Xms512m -Xmx1024m' 要加“m”说明是MB,否则就是KB了,在启动tomcat时会报内存不足。 -Xms:初始值 -Xmx:最大值 -Xmn:最小值 解决...

    tomcat8.0版本下载

    tomcat8.0版本下载tomcat8.0版本下载tomcat8.0版本下载tomcat8.0版本下载tomcat8.0版本下载tomcat8.0版本下载tomcat8.0版本下载tomcat8.0版本下载tomcat8.0版本下载tomcat8.0版本下载tomcat8.0版本下载tomcat8.0版本...

    tomcat安装包~~

    部署网站必不可缺少的tomcat安装包~~部署网站必不可缺少的tomcat安装包~~部署网站必不可缺少的tomcat安装包~~部署网站必不可缺少的tomcat安装包~~部署网站必不可缺少的tomcat安装包~~部署网站必不可缺少的tomcat...

    apache-tomcat 6到9的4个版本,Tomcat 6.zip Tomcat 7.zip Tomcat 8.zip Tomcat 9.zip

    Tomcat是由Apache软件基金会下属的Jakarta项目开发的一个Servlet容器,按照Sun Microsystems提供的技术规范,实现了对Servlet和JavaServer Page(JSP)的支持,并提供了作为 Web服务器的一些特有功能,如Tomcat管理...

    修改Tomcat默认访问根目录的方法

    在Tomcat默认安装后,tomcat的主目录是webapps/root目录。 在conf文件夹下面找到server.xml 打开 在&lt;hosts&gt; ……中间添加一行 代码如下:”” docBase=”/usr/tomcat/apache-tomcat-8.5.11/webapps/guanwang” ...

    最新版 绿色版TOMCAT8 百度网盘

    Tomcat 服务器是一个免费的开放源代码的Web 应用服务器,属于轻量级应用服务器,在中小型系统和并发访问用户不是很多的场合下被普遍使用,是开发和调试JSP 程序的首选。对于一个初学者来说,可以这样认为,当在一台...

    TongWeb和Tomcat的区别.doc

    TongWeb和Tomcat的区别 TongWeb和Tomcat都是应用服务器,但它们之间有很多区别。TongWeb是东方通中间件5.0版本,作为SOA实现提供了一个完善的企业级应用服务器,支持面向服务架构的开发和部署,通过可靠消息传递...

    tomcat6、tomcat7、tocmat8、tomcat9 linux版、windox版百度云

    tomcat6、tomcat7、tocmat8、tomcat9 linux版、windox版 32位 64位

    二级等保主机安全测评作业指导书-中间件Tomcat.pdf

    二级等保主机安全测评作业指导书-中间件Tomcat.pdf二级等保主机安全测评作业指导书-中间件Tomcat.pdf二级等保主机安全测评作业指导书-中间件Tomcat.pdf二级等保主机安全测评作业指导书-中间件Tomcat.pdf二级等保主机...

    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解决跨域访问问题配置

    tomcat解决跨域访问问题,具体配置如下: 1、修改tomcat下的Conf/web.xml文件,在该文件内容中新增以下配置,注意,若该web.xml中存在其它filter,则需要将该filter放在所有filter前面; &lt;filter-name&gt;...

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

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

Global site tag (gtag.js) - Google Analytics