设为首页 收藏本站
查看: 644|回复: 0

[经验分享] Apache Tomcat Configuration Reference

[复制链接]

尚未签到

发表于 2015-8-1 08:58:24 | 显示全部楼层 |阅读模式
摘自 http://tomcat.apache.org/tomcat-5.5-doc/config/valve.html         
Apache http://www.apache.org/           
参考 http://tomcat.apache.org/tomcat-5.5-doc/catalina/docs/api/org/apache/catalina/valves/AccessLogValve.html
  
http://onexin.iyunv.com/source/plugin/onexin_bigdata/file:///C:/Documents%20and%20Settings/Administrator/Local%20Settings/Temp/WindowsLiveWriter-429641856/supfiles9E3BFE/tomcat_thumb.gif         The Apache Tomcat 5.5 Servlet/JSP Container
      
http://onexin.iyunv.com/source/plugin/onexin_bigdata/file:///C:/Documents%20and%20Settings/Administrator/Local%20Settings/Temp/WindowsLiveWriter-429641856/supfiles9E3BFE/asflogo_thumb.gif
  
         
           Links
         
               
  • Docs Home            
  • Config Ref. Home         
            Top Level Elements
         
               
  • Server            
  • Service         
            Connectors
         
               
  • HTTP            
  • AJP         
            Containers
         
               
  • Context            
  • Engine            
  • Host         
            Nested Components
         
               
  • Global Resources            
  • Loader            
  • Manager            
  • Realm            
  • Resources            
  • Valve         
            Global Settings
         
               
  • System properties         
      
         Apache Tomcat Configuration Reference
          The Valve Component
         
Table of Contents
                 
                  
                         
  • Introduction                     
  • Access Log Valve
                              
    • Introduction                          
    • Attributes                       
                                              
  • Remote Address Filter
                              
    • Introduction                          
    • Attributes                       
                                              
  • Remote Host Filter
                              
    • Introduction                          
    • Attributes                       
                                              
  • Request Dumper Valve
                              
    • Introduction                          
    • Attributes                       
                                              
  • Single Sign On Valve
                              
    • Introduction                          
    • Attributes                       
                                              
  • Basic Authenticator Valve
                              
    • Introduction                          
    • Attributes                       
                                              
  • Digest Authenticator Valve
                              
    • Introduction                          
    • Attributes                       
                                              
  • Form Authenticator Valve
                              
    • Introduction                          
    • Attributes                       
                                              
  • SSL Authenticator Valve
                              
    • Introduction                          
    • Attributes                       
                                           
                 
               
         
Introduction
                 
                     A Valve element represents a component that will be inserted into the request processing pipeline for the associated Catalina container (Engine, Host, or Context). Individual Valves have distinct processing capabilities, and are described individually below.
                    
                         The description below uses the variable name $CATALINA_HOME to refer to the directory into which you have installed Tomcat 5, and is the base directory against which most relative paths are resolved. However, if you have configured Tomcat 5 for multiple instances by setting a CATALINA_BASE directory, you should use $CATALINA_BASE instead of $CATALINA_HOME for each of these references.
                     
                 
               
         
Access Log Valve
                 
                  
Introduction
                           
                               The Access Log Valve creates log files in the same format as those created by standard web servers. These logs can later be analyzed by standard log analysis tools to track page hit counts, user session activity, and so on. The files produces by this Valve are rolled over nightly at midnight. This Valve may be associated with any Catalina container (Context, Host, or Engine), and will record ALL requests processed by that container.
                           
                        
                    
Attributes
                           
                               The Access Log Valve supports the following configuration attributes:
                                                                 Attribute                                    Description                                                                  
className                                       Java class name of the implementation to use. This MUST be set to org.apache.catalina.valves.AccessLogValve to use the default access log valve. To use a more optimized access log valve designed for production use, you MUST set this attribute to org.apache.catalina.valves.FastCommonAccessLogValve. In this case, only the common and combined patterns are supported.
                                   
directory                                       Absolute or relative pathname of a directory in which log files created by this valve will be placed. If a relative path is specified, it is interpreted as relative to $CATALINA_HOME. If no directory attribute is specified, the default value is "logs" (relative to $CATALINA_HOME).
                                   
pattern                                       A formatting layout identifying the various information fields from the request and response to be logged, or the word common or combined to select a standard format. See below for more information on configuring this attribute. Note that the optimized access does only support common and combined as the value for this attribute.
                                   
prefix                                       The prefix added to the start of each log file's name. If not specified, the default value is "access_log.". To specify no prefix, use a zero-length string.
                                   
resolveHosts                                       Set to true to convert the IP address of the remote host into the corresponding host name via a DNS lookup. Set to false to skip this lookup, and report the remote IP address instead.
                                   
suffix                                       The suffix added to the end of each log file's name. If not specified, the default value is "". To specify no suffix, use a zero-length string.
                                   
rotatable                                       Default true. Flag to determine if log rotation should occur. If set to false, then this file is never rotated and fileDateFormat is ignored. Use with caution!
                                   
condition                                       Turns on conditional logging. If set, requests will be logged only if ServletRequest.getAttribute() is null. For example, if this value is set to junk, then a particular request will only be logged if ServletRequest.getAttribute("junk") == null. The use of Filters is an easy way to set/unset the attribute in the ServletRequest on many different requests.
                                   
fileDateFormat                                       Allows a customized date format in the access log file name. The date format also decides how often the file is rotated. If you wish to rotate every hour, then set this value to: yyyy-MM-dd.HH
                                   
                                Values for the pattern attribute are made up of literal text strings, combined with pattern identifiers prefixed by the "%" character to cause replacement by the corresponding variable value from the current request and response. The following pattern codes are supported:
                              
                                  
  • %a - Remote IP address                                
  • %A - Local IP address                                
  • %b - Bytes sent, excluding HTTP headers, or '-' if zero                                
  • %B - Bytes sent, excluding HTTP headers                                
  • %h - Remote host name (or IP address if resolveHosts is false)                                
  • %H - Request protocol                                
  • %l - Remote logical username from identd (always returns '-')                                
  • %m - Request method (GET, POST, etc.)                                
  • %p - Local port on which this request was received                                
  • %q - Query string (prepended with a '?' if it exists)                                
  • %r - First line of the request (method and request URI)                                
  • %s - HTTP status code of the response                                
  • %S - User session ID                                
  • %t - Date and time, in Common Log Format                                
  • %u - Remote user that was authenticated (if any), else '-'                                
  • %U - Requested URL path                                
  • %v - Local server name                                
  • %D - Time taken to process the request, in millis                                
  • %T - Time taken to process the request, in seconds                                
  • %I - current request thread name (can compare later with stacktraces)                             
                                There is also support to write information from the cookie, incoming header, outgoing response headers, the Session or something else in the ServletRequest. It is modeled after the apache syntax:
                              
                                  
  • %{xxx}i for incoming request headers                                
  • %{xxx}o for outgoing response headers                                
  • %{xxx}c for a specific request cookie                                
  • %{xxx}r xxx is an attribute in the ServletRequest                                
  • %{xxx}s xxx is an attribute in the HttpSession                             
                                
  The shorthand pattern name common (which is also the default) corresponds to '%h %l %u %t "%r" %s %b'.
  The shorthand pattern name combined appends the values of the Referer and User-Agent headers, each in double quotes, to the common pattern described in the previous paragraph.
                           
                        
                                
         
Remote Address Filter
                 
                  
Introduction
                           
                               The Remote Address Filter allows you to compare the IP address of the client that submitted this request against one or more regular expressions, and either allow the request to continue or refuse to process the request from this client. A Remote Address Filter can be associated with any Catalina container (Engine, Host, or Context), and must accept any request presented to this container for processing before it will be passed on.
  The syntax for regular expressions is different than that for 'standard' wildcard matching. Tomcat uses the java.util.regex package. Please consult the Java documentation for details of the expressions supported.
                           
                        
                    
Attributes
                           
                               The Remote Address Filter supports the following configuration attributes:
                                                                 Attribute                                    Description                                                                  
className                                       Java class name of the implementation to use. This MUST be set to org.apache.catalina.valves.RemoteAddrValve.
                                   
allow                                       A comma-separated list of regular expression patterns that the remote client's IP address is compared to. If this attribute is specified, the remote address MUST match for this request to be accepted. If this attribute is not specified, all requests will be accepted UNLESS the remote address matches a deny pattern.
                                   
deny                                       A comma-separated list of regular expression patterns that the remote client's IP address is compared to. If this attribute is specified, the remote address MUST NOT match for this request to be accepted. If this attribute is not specified, request acceptance is governed solely by the accept attribute.
                                   
                           
                        
                                                       
Remote Host Filter
                 
                  
Introduction
                           
                               The Remote Host Filter allows you to compare the hostname of the client that submitted this request against one or more regular expressions, and either allow the request to continue or refuse to process the request from this client. A Remote Host Filter can be associated with any Catalina container (Engine, Host, or Context), and must accept any request presented to this container for processing before it will be passed on.
  The syntax for regular expressions is different than that for 'standard' wildcard matching. Tomcat uses the java.util.regex package. Please consult the Java documentation for details of the expressions supported.
                           
                        
                    
Attributes
                           
                               The Remote Host Filter supports the following configuration attributes:
                                                                 Attribute                                    Description                                                                  
className                                       Java class name of the implementation to use. This MUST be set to org.apache.catalina.valves.RemoteHostValve.
                                   
allow                                       A comma-separated list of regular expression patterns that the remote client's hostname is compared to. If this attribute is specified, the remote hostname MUST match for this request to be accepted. If this attribute is not specified, all requests will be accepted UNLESS the remote hostname matches a deny pattern.
                                   
deny                                       A comma-separated list of regular expression patterns that the remote client's hostname is compared to. If this attribute is specified, the remote hostname MUST NOT match for this request to be accepted. If this attribute is not specified, request acceptance is governed solely by the accept attribute.
                                   
                           
                        
                                                       
Request Dumper Valve
                 
                  
Introduction
                           
                               The Request Dumper Valve is a useful tool in debugging interactions with a client application (or browser) that is sending HTTP requests to your Tomcat-based server. When configured, it causes details about each request processed by its associated Engine, Host, or Context to be logged according to the logging configuration for that container.
  WARNING: Using this valve has side-effects. The output from this valve includes any parameters included with the request. The parameters will be decoded using the default platform encoding. Any subsequent calls to request.setCharacterEncoding() within the web application will have no effect.
  Note: this Valve is now deprecated in favor of the RequestDumperFilter, which does the same thing in a portable manner. This Filter is included in the examples application: see $CATALINA_HOME/webapps/examples/WEB-INF/classes/filters for the source.
                           
                        
                    
Attributes
                           
                               The Request Dumper Valve supports the following configuration attributes:
                                                                 Attribute                                    Description                                                                  
className                                       Java class name of the implementation to use. This MUST be set to org.apache.catalina.valves.RequestDumperValve.
                                   
                           
                        
                                                       
Single Sign On Valve
                 
                  
Introduction
                           
                               The Single Sign On Vale is utilized when you wish to give users the ability to sign on to any one of the web applications associated with your virtual host, and then have their identity recognized by all other web applications on the same virtual host.
  See the Single Sign On special feature on the Host element for more information.
                           
                        
                    
Attributes
                           
                               The Single Sign On Valve supports the following configuration attributes:
                                                                 Attribute                                    Description                                                                  
className                                       Java class name of the implementation to use. This MUST be set to org.apache.catalina.authenticator.SingleSignOn.
                                   
requireReauthentication                                       Default false. Flag to determine whether each request needs to be reauthenticated to the security Realm. If "true", this Valve uses cached security credentials (username and password) to reauthenticate to the Realm each request associated with an SSO session. If "false", the Valve can itself authenticate requests based on the presence of a valid SSO cookie, without rechecking with the Realm.
                                   
cookieDomain                                       Sets the host domain to be used for sso cookies.
                                   
                           
                        
                                                       
Basic Authenticator Valve
                 
                  
Introduction
                           
                               The Basic Authenticator Valve is automatically added to any Context that is configured to use BASIC authentication.
  If any non-default settings are required, the valve may be configured within Context element with the required values.
                           
                        
                    
Attributes
                           
                               The Basic Authenticator Valve supports the following configuration attributes:
                                                                 Attribute                                    Description                                                                  
className                                       Java class name of the implementation to use. This MUST be set to org.apache.catalina.authenticator.BasicAuthenticator.
                                   
changeSessionIdOnAuthentication                                       Controls if the session ID is changed if a session exists at the point where users are authenticated. This is to prevent session fixation attacks. If not set, the default value of false will be used.
                                   
disableProxyCaching                                       Controls the caching of pages that are protected by security constraints. Setting this to false may help work around caching issues in some browsers but will also cause secured pages to be cached by proxies which will almost certainly be a security issue. securePagesWithPragma offers an alternative, secure, workaround for browser caching issues. If not set, the default value of true will be used.
                                   
securePagesWithPragma                                       Controls the caching of pages that are protected by security constraints. Setting this to false may help work around caching issues in some browsers by using Cache-Control: private rather than the default of Pragma: No-cache and Cache-control: No-cache. If not set, the default value of true will be used.
                                   
                           
                        
                                                       
Digest Authenticator Valve
                 
                  
Introduction
                           
                               The Digest Authenticator Valve is automatically added to any Context that is configured to use DIGEST authentication.
  If any non-default settings are required, the valve may be configured within Context element with the required values.
                           
                        
                    
Attributes
                           
                               The Digest Authenticator Valve supports the following configuration attributes:
                                                                 Attribute                                    Description                                                                  
className                                       Java class name of the implementation to use. This MUST be set to org.apache.catalina.authenticator.DigestAuthenticator.
                                   
changeSessionIdOnAuthentication                                       Controls if the session ID is changed if a session exists at the point where users are authenticated. This is to prevent session fixation attacks. If not set, the default value of false will be used.
                                   
disableProxyCaching                                       Controls the caching of pages that are protected by security constraints. Setting this to false may help work around caching issues in some browsers but will also cause secured pages to be cached by proxies which will almost certainly be a security issue. securePagesWithPragma offers an alternative, secure, workaround for browser caching issues. If not set, the default value of true will be used.
                                   
securePagesWithPragma                                       Controls the caching of pages that are protected by security constraints. Setting this to false may help work around caching issues in some browsers by using Cache-Control: private rather than the default of Pragma: No-cache and Cache-control: No-cache. If not set, the default value of true will be used.
                                   
                           
                        
                                                       
Form Authenticator Valve
                 
                  
Introduction
                           
                               The Form Authenticator Valve is automatically added to any Context that is configured to use FORM authentication.
  If any non-default settings are required, the valve may be configured within Context element with the required values.
                           
                        
                    
Attributes
                           
                               The Form Authenticator Valve supports the following configuration attributes:
                                                                 Attribute                                    Description                                                                  
className                                       Java class name of the implementation to use. This MUST be set to org.apache.catalina.authenticator.FormAuthenticator.
                                   
changeSessionIdOnAuthentication                                       Controls if the session ID is changed if a session exists at the point where users are authenticated. This is to prevent session fixation attacks. If not set, the default value of false will be used.
                                   
characterEncoding                                       Character encoding to use to read the username and password parameters from the request. If not set, the encoding of the request body will be used.
                                   
disableProxyCaching                                       Controls the caching of pages that are protected by security constraints. Setting this to false may help work around caching issues in some browsers but will also cause secured pages to be cached by proxies which will almost certainly be a security issue. securePagesWithPragma offers an alternative, secure, workaround for browser caching issues. If not set, the default value of true will be used.
                                   
securePagesWithPragma                                       Controls the caching of pages that are protected by security constraints. Setting this to false may help work around caching issues in some browsers by using Cache-Control: private rather than the default of Pragma: No-cache and Cache-control: No-cache. If not set, the default value of true will be used.
                                   
                           
                        
                                                       
SSL Authenticator Valve
                 
                  
Introduction
                           
                               The SSL Authenticator Valve is automatically added to any Context that is configured to use SSL authentication.
  If any non-default settings are required, the valve may be configured within Context element with the required values.
                           
                        
                    
Attributes
                           
                               The SSL Authenticator Valve supports the following configuration attributes:
                                                                 Attribute                                    Description                                                                  
className                                       Java class name of the implementation to use. This MUST be set to org.apache.catalina.authenticator.SSLAuthenticator.
                                   
changeSessionIdOnAuthentication                                       Controls if the session ID is changed if a session exists at the point where users are authenticated. This is to prevent session fixation attacks. If not set, the default value of false will be used.
                                   
disableProxyCaching                                       Controls the caching of pages that are protected by security constraints. Setting this to false may help work around caching issues in some browsers but will also cause secured pages to be cached by proxies which will almost certainly be a security issue. securePagesWithPragma offers an alternative, secure, workaround for browser caching issues. If not set, the default value of true will be used.
                                   
securePagesWithPragma                                       Controls the caching of pages that are protected by security constraints. Setting this to false may help work around caching issues in some browsers by using Cache-Control: private rather than the default of Pragma: No-cache and Cache-control: No-cache. If not set, the default value of true will be used.
                                   
                           
                        
                                                                                                           
[size=-1]Copyright © 1999-2011, Apache Software Foundation             

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-92874-1-1.html 上篇帖子: 万网独享主机Apache为Ecshop商城添加404页面详解 下篇帖子: [try it] 使用Apache Ant
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表