You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by rj...@apache.org on 2010/02/23 05:15:50 UTC

svn commit: r915172 - in /tomcat/jk/trunk/conf: httpd-jk.conf workers.properties

Author: rjung
Date: Tue Feb 23 04:15:49 2010
New Revision: 915172

URL: http://svn.apache.org/viewvc?rev=915172&view=rev
Log:
Update our example configuration to something
more reasonable.

Added:
    tomcat/jk/trunk/conf/httpd-jk.conf
Modified:
    tomcat/jk/trunk/conf/workers.properties

Added: tomcat/jk/trunk/conf/httpd-jk.conf
URL: http://svn.apache.org/viewvc/tomcat/jk/trunk/conf/httpd-jk.conf?rev=915172&view=auto
==============================================================================
--- tomcat/jk/trunk/conf/httpd-jk.conf (added)
+++ tomcat/jk/trunk/conf/httpd-jk.conf Tue Feb 23 04:15:49 2010
@@ -0,0 +1,124 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this 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 with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed 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 and
+# limitations under the License.
+
+# Configuration Example for mod_jk
+# used in combination with Apache 2.2.x
+
+# Change the path and file name of the module, in case
+# you have installed it outside of httpd, or using
+# a versioned file name.
+LoadModule jk_module modules/mod_jk.so
+
+<IfModule jk_module>
+
+    # We need a workers file exactly once
+    # and in the global server
+    JkWorkersFile conf/workers.properties
+
+    # Our JK error log
+    # You can (and should) use rotatelogs here
+    JkLogFile logs/mod_jk.log
+
+    # Our JK log level (trace,debug,info,warn,error)
+    JkLogLevel info
+
+    # Define a new log format you can use in any CustomLog in order
+    # to add mod_jk specific information to your access log.
+    # LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" \"%{Cookie}i\" \"%{Set-Cookie}o\" %{pid}P %{tid}P %{JK_LB_FIRST_NAME}n %{JK_LB_LAST_NAME}n ACC %{JK_LB_LAST_ACCESSED}n ERR %{JK_LB_LAST_ERRORS}n BSY %{JK_LB_LAST_BUSY}n %{JK_LB_LAST_STATE}n %D" extended_jk
+
+    # This option will reject all requests, which contain an
+    # encoded percent sign (%25) or backslash (%5C) in the URL
+    # If you are sure, that your webapp doesn't use such
+    # URLs, enable the option to prevent double encoding attacks.
+    # Since: 1.2.24
+    # JkOptions +RejectUnsafeURI
+
+    # After setting JkStripSession to "On", mod_jk will
+    # strip all ";jsessionid=..." from request URLs it
+    # does *not* forward to a backend.
+    # This is useful, if all links in a webapp use
+    # URLencoded session IDs and parts of the static
+    # content should be delivered directly by Apache.
+    # Of course you can also do it with mod_rewrite.
+    # Since: 1.2.21
+    # JkStripSession On
+
+    # Start a separate thread for internal tasks like
+    # idle connection probing, connection pool resizing
+    # and load value decay.
+    # Run these tasks every JkWatchdogInterval seconds.
+    # Since: 1.2.27
+    JkWatchdogInterval 60
+
+    # Configure access to jk-status and jk-manager
+    # If you want to make this available in a virtual host,
+    # either move this block into the virtual host
+    # or copy it logically there by including "JkMountCopy On"
+    # in the virtual host.
+    # Add an appropriate authentication method here!
+    <Location /jk-status>
+        # Inside Location we can omit the URL in JkMount
+        JkMount jk-status
+        Order deny,allow
+        Deny from all
+        Allow from 127.0.0.1
+    </Location>
+    <Location /jk-manager>
+        # Inside Location we can omit the URL in JkMount
+        JkMount jk-manager
+        Order deny,allow
+        Deny from all
+        Allow from 127.0.0.1
+    </Location>
+
+    # If you want to put all mounts into an external file
+    # that gets reloaded automatically after changes
+    # (with a default latency of 1 minute),
+    # you can define the name of the file here.
+    # JkMountFile conf/extra/uriworkermap.properties
+
+    # Example for Mounting a context to the worker "balancer"
+    # The URL syntax "a|b" instantiates two mounts at once,
+    # the first one is "a", the second one is "ab".
+    # JkMount /myapp|/* balancer
+
+    # Example for UnMounting requests for all workers
+    # using a simple URL pattern
+    # Since: 1.2.26
+    # JkUnMount /myapp/static/* *
+
+    # Example for UnMounting requests for a named worker
+    # JkUnMount /myapp/images/* balancer
+
+    # Example for UnMounting requests using regexps
+    # SetEnvIf REQUEST_URI "\.(htm|html|css|gif|jpg|js)$" no-jk
+
+    # Example for setting a reply timeout depending on the requets URL
+    # Since: 1.2.27
+    # SetEnvIf Request_URI "/transactions/" JK_REPLY_TIMEOUT=600000
+
+    # Example for disabling reply timeouts for certain request URLs
+    # Since: 1.2.27
+    # SetEnvIf Request_URI "/reports/" JK_REPLY_TIMEOUT=0
+
+    # IMPORTANT: Mounts and virtual hosts
+    # If you are using VirtualHost elements, you
+    # - can put mounts only used in some virtual host into its VirtualHost element 
+    # - can copy all global mounts to it using "JkMountCopy On" inside the VirtualHost
+    # - can copy all global mounts to all virtual hosts by putting
+    #   "JkMountCopy All" into the global server
+    # Since: 1.2.26
+
+</IfModule>

Modified: tomcat/jk/trunk/conf/workers.properties
URL: http://svn.apache.org/viewvc/tomcat/jk/trunk/conf/workers.properties?rev=915172&r1=915171&r2=915172&view=diff
==============================================================================
--- tomcat/jk/trunk/conf/workers.properties (original)
+++ tomcat/jk/trunk/conf/workers.properties Tue Feb 23 04:15:49 2010
@@ -13,12 +13,10 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-# workers.properties -
+# Note that the distributed version of this file requires modification
+# before it is usable.
 #
-# This file provides jk derived plugins with the needed information to
-# connect to the different tomcat workers.  Note that the distributed
-# version of this file requires modification before it is usable by a
-# plugin.
+# Reference documentation: http://tomcat.apache.org/connectors-doc/reference/workers.html
 #
 # As a general note, the characters $( and ) are used internally to define
 # macros. Do not use them in your own configuration!!!
@@ -28,194 +26,140 @@
 # y=$(x)\something
 #
 # the final value for y will be value\something
-#
-# Normaly all you will need to do is un-comment and modify the first three
-# properties, i.e. workers.tomcat_home, workers.java_home and ps.
-# Most of the configuration is derived from these.
-#
-# When you are done updating workers.tomcat_home, workers.java_home and ps
-# you should have 3 workers configured:
-#
-# - An ajp12 worker that connects to localhost:8007
-# - An ajp13 worker that connects to localhost:8009
-# - A jni inprocess worker.
-# - A load balancer worker
-#
-# However by default the plugins will only use the ajp12 worker. To have
-# the plugins use other workers you should modify the worker.list property.
-#
-#
-
-# OPTIONS ( very important for jni mode ) 
-
-#
-# workers.tomcat_home should point to the location where you
-# installed tomcat. This is where you have your conf, webapps and lib
-# directories.
-#
-workers.tomcat_home=/var/tomcat3
-
-#
-# workers.java_home should point to your Java installation. Normally
-# you should have a bin and lib directories beneath it.
-#
-workers.java_home=/opt/IBMJava2-13
-
-#
-# You should configure your environment slash... ps=\ on NT and / on UNIX
-# and maybe something different elsewhere.
-#
-ps=/
-
-#
-#------ ADVANCED MODE ------------------------------------------------
-#---------------------------------------------------------------------
-#
-
-#
-#------ DEFAULT worker list ------------------------------------------
-#---------------------------------------------------------------------
-#
-#
-# The workers that your plugins should create and work with
-#
-# Add 'inprocess' if you want JNI connector 
-worker.list=ajp12, ajp13
-# , inprocess
-
-
-#
-#------ DEFAULT ajp12 WORKER DEFINITION ------------------------------
-#---------------------------------------------------------------------
-#
-
-#
-# Defining a worker named ajp12 and of type ajp12
-# Note that the name and the type do not have to match.
-#
-worker.ajp12.port=8007
-worker.ajp12.host=localhost
-worker.ajp12.type=ajp12
-#
-# Specifies the load balance factor when used with
-# a load balancing worker.
-# Note:
-#  ----> lbfactor must be > 0
-#  ----> Low lbfactor means less work done by the worker.
-worker.ajp12.lbfactor=1
-
-#
-#------ DEFAULT ajp13 WORKER DEFINITION ------------------------------
-#---------------------------------------------------------------------
-#
-
-#
-# Defining a worker named ajp13 and of type ajp13
-# Note that the name and the type do not have to match.
-#
-worker.ajp13.port=8009
-worker.ajp13.host=localhost
-worker.ajp13.type=ajp13
-#
-# Specifies the load balance factor when used with
-# a load balancing worker.
-# Note:
-#  ----> lbfactor must be > 0
-#  ----> Low lbfactor means less work done by the worker.
-worker.ajp13.lbfactor=1
-
-#
-# Specify the size of the open connection pool.
-#worker.ajp13.connection_pool_size
-
-#
-#------ DEFAULT LOAD BALANCER WORKER DEFINITION ----------------------
-#---------------------------------------------------------------------
-#
-
-#
-# The loadbalancer (type lb) workers perform wighted round-robin
-# load balancing with sticky sessions.
-# Note:
-#  ----> If a worker dies, the load balancer will check its state
-#        once in a while. Until then all work is redirected to peer
-#        workers.
-worker.loadbalancer.type=lb
-worker.loadbalancer.balance_workers=ajp12, ajp13
-
-
-#
-#------ DEFAULT JNI WORKER DEFINITION---------------------------------
-#---------------------------------------------------------------------
-#
-
-#
-# Defining a worker named inprocess and of type jni
-# Note that the name and the type do not have to match.
-#
-worker.inprocess.type=jni
-
-#
-#------ CLASSPATH DEFINITION -----------------------------------------
-#---------------------------------------------------------------------
-#
-
-#
-# Additional class path components.
-#
-worker.inprocess.class_path=$(workers.tomcat_home)$(ps)lib$(ps)tomcat.jar
-
-#
-# Setting the command line for tomcat. 
-# Note: The cmd_line string may not contain spaces.
-#
-worker.inprocess.cmd_line=start
-
-# Not needed, but can be customized.
-#worker.inprocess.cmd_line=-config
-#worker.inprocess.cmd_line=$(workers.tomcat_home)$(ps)conf$(ps)server.xml
-#worker.inprocess.cmd_line=-home
-#worker.inprocess.cmd_line=$(workers.tomcat_home)
-
-#
-# The JVM that we are about to use
-#
-# This is for Java2
-#
-# Windows
-worker.inprocess.jvm_lib=$(workers.java_home)$(ps)jre$(ps)bin$(ps)classic$(ps)jvm.dll
-# IBM JDK1.3 
-#worker.inprocess.jvm_lib=$(workers.java_home)$(ps)jre$(ps)bin$(ps)classic$(ps)libjvm.so
-# Unix - Sun VM or blackdown
-#worker.inprocess.jvm_lib=$(workers.java_home)$(ps)jre$(ps)lib$(ps)i386$(ps)classic$(ps)libjvm.so
-
-#
-# And this is for jdk1.1.X
-#
-#worker.inprocess.jvm_lib=$(workers.java_home)$(ps)bin$(ps)javai.dll
-
-
-#
-# Setting the place for the stdout and stderr of tomcat
-#
-worker.inprocess.stdout=$(workers.tomcat_home)$(ps)logs$(ps)inprocess.stdout
-worker.inprocess.stderr=$(workers.tomcat_home)$(ps)logs$(ps)inprocess.stderr
-
-#
-# Setting the tomcat.home Java property
-#
-#worker.inprocess.sysprops=tomcat.home=$(workers.tomcat_home)
-
-#
-# Java system properties
-#
-# worker.inprocess.sysprops=java.compiler=NONE
-# worker.inprocess.sysprops=myprop=mypropvalue
-
-#
-# Additional path components.
-#
-# worker.inprocess.ld_path=d:$(ps)SQLLIB$(ps)bin
-#
 
+# Define two status worker:
+# - jk-status for read-only use
+# - jk-manager for read/write use
+worker.list=jk-status
+worker.jk-status.type=status
+worker.jk-status.read_only=true
+
+worker.list=jk-manager
+worker.jk-manager.type=status
+
+# We define a load balancer worker
+# with name "balancer"
+worker.list=balancer
+worker.balancer.type=lb
+# error_escalation_time: seconds, default = recover_time/2 (=30)
+# Determines, how fast a detected error should switch from
+# local error state to global error state
+# Since: 1.2.28
+worker.balancer.error_escalation_time=0
+
+# - max_reply_timeouts: number, default=0
+#   If there are to many reply timeouts, a worker
+#   is put into the error state, i.e. it will become
+#   unavailable for all sessions residing on the respective
+#   Tomcat. The number of tolerated reply timeouts is
+#   configured with max_reply_timeouts. The number of
+#   timeouts occuring is divided by 2 once a minute and the
+#   resulting counter is compared against max_reply_timeouts.
+#   If you set max_reply_timeouts to N and the errors are
+#   occuring equally distributed over time, you will
+#   tolerate N/2 errors per minute. If they occur in a burst
+#   you will tolerate N errors.
+#   Since: 1.2.24
+worker.balancer.max_reply_timeouts=10
+
+
+
+# Now we add members to the load balancer
+# First member is "node1", most
+# attributes are inherited from the
+# template "worker.template".
+worker.balancer.balance_workers=node1
+worker.node1.reference=worker.template
+worker.node1.host=localhost
+worker.node1.port=8109
+# Activation allows to configure
+# whether this node should actually be used
+# A: active (use node fully)
+# D: disabled (only use, if sticky session needs this node)
+# S: stopped (do not use)
+#   Since: 1.2.19
+worker.node1.activation=A
+
+# Second member is "node2", most
+# attributes are inherited from the
+# template "worker.template".
+worker.balancer.balance_workers=node2
+worker.node2.reference=worker.template
+worker.node2.host=localhost
+worker.node2.port=8209
+# Activation allows to configure
+# whether this node should actually be used
+# A: active (use node fully)
+# D: disabled (only use, if sticky session needs this node)
+# S: stopped (do not use)
+#   Since: 1.2.19
+worker.node2.activation=A
+
+# Finally we put the parameters
+# which should apply to all our ajp13
+# workers into the referenced template
+# - Type is ajp13
+worker.template.type=ajp13
+
+# - socket_connect_timeout: milliseconds, default=0
+#   Since: 1.2.27
+worker.template.socket_connect_timeout=5000
+
+# - socket_keepalive: boolean, default=false
+#   Should we send TCP keepalive packets
+#   when connection is idle (socket option)?
+worker.template.socket_keepalive=true
+
+# - ping_mode: Character, default=none
+#   When should we use cping/cpong connection probing?
+#   C = directly after establishing a new connection
+#   P = directly before sending each request
+#   I = in regular intervals for idle connections
+#       using the watchdog thread
+#   A = all of the above
+#   Since: 1.2.27
+worker.template.ping_mode=A
+
+# - ping_timeout: milliseconds, default=10000
+#   Wait timeout for cpong after cping
+#   Can be overwritten for modes C and P
+#   Using connect_timeout and prepost_timeout.
+#   Since: 1.2.27
+worker.template.ping_timeout=10000
+
+# - connection_pool_minsize: number, default=connection_pool_size
+#   Lower pool size when shrinking pool due
+#   to idle connections
+#   We want all connections to be closed when
+#   idle for a long time in order to prevent
+#   firewall problems.
+#   Since: 1.2.16
+worker.template.connection_pool_minsize=0
+
+# - connection_pool_timeout: seconds, default=0
+#   Idle time, before a connection is eligible
+#   for being closed (pool shrinking).
+#   This should be the same value as connectionTimeout
+#   in the Tomcat AJP connector, but there it is
+#   milliseconds, here seconds.
+worker.template.connection_pool_timeout=600
+
+# - reply_timeout: milliseconds, default=0
+#   Any pause longer than this timeout during waiting
+#   for a part of the reply will abort handling the request
+#   in mod_jk. The request will proceed running in
+#   Tomcat, but the web server resources will be freed
+#   and an error is send to the client.
+#   For individual requests, the timeout can be overwritten
+#   by the Apache environment variable JK_REPLY_TIMEOUT.
+#   JK_REPLY_TIMEOUT since: 1.2.27
+worker.template.reply_timeout=300000
+
+# - recovery_options: number, default=0
+#   Bit mask to configure, if a request, which was send
+#   to a backend successfully, should be retried on another backend
+#   in case there's a problem with the response.
+#   Value "3" disables retries, whenever a part of the request was
+#   successfully send to the backend.
+worker.template.recovery_options=3
 



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org