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 2007/11/04 18:18:19 UTC

svn commit: r591804 - in /tomcat/connectors/trunk/jk: native/common/jk_uri_worker_map.c xdocs/miscellaneous/changelog.xml xdocs/reference/apache.xml xdocs/reference/uriworkermap.xml

Author: rjung
Date: Sun Nov  4 09:18:13 2007
New Revision: 591804

URL: http://svn.apache.org/viewvc?rev=591804&view=rev
Log:
Make exclusion rules/JkUnMount easier.
Until now the worker name of the exclusion rule needs to reflect the worker
name of a mapping rule.

In order to be able to exclude completely based on URL pattern, we allow
the worker name '*' wor an exclusion. This will match any worker.


Modified:
    tomcat/connectors/trunk/jk/native/common/jk_uri_worker_map.c
    tomcat/connectors/trunk/jk/xdocs/miscellaneous/changelog.xml
    tomcat/connectors/trunk/jk/xdocs/reference/apache.xml
    tomcat/connectors/trunk/jk/xdocs/reference/uriworkermap.xml

Modified: tomcat/connectors/trunk/jk/native/common/jk_uri_worker_map.c
URL: http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/native/common/jk_uri_worker_map.c?rev=591804&r1=591803&r2=591804&view=diff
==============================================================================
--- tomcat/connectors/trunk/jk/native/common/jk_uri_worker_map.c (original)
+++ tomcat/connectors/trunk/jk/native/common/jk_uri_worker_map.c Sun Nov  4 09:18:13 2007
@@ -552,7 +552,7 @@
             (uwr->match_type & MATCH_TYPE_DISABLED))
             continue;
         /* Check only matching workers */
-        if (strcmp(uwr->worker_name, worker))
+        if (*uwr->worker_name != '*' && strcmp(uwr->worker_name, worker))
             continue;
         if (uwr->match_type & MATCH_TYPE_WILDCHAR_PATH) {
             /* Map is already sorted by context_len */

Modified: tomcat/connectors/trunk/jk/xdocs/miscellaneous/changelog.xml
URL: http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/xdocs/miscellaneous/changelog.xml?rev=591804&r1=591803&r2=591804&view=diff
==============================================================================
--- tomcat/connectors/trunk/jk/xdocs/miscellaneous/changelog.xml (original)
+++ tomcat/connectors/trunk/jk/xdocs/miscellaneous/changelog.xml Sun Nov  4 09:18:13 2007
@@ -43,6 +43,10 @@
   <br />
   <subsection name="Native">
     <changelog>
+      <update>
+        Common: Allow '*' for the worker name in exclusion rules (resp. JkUnMount)
+        which will override all workers. (rjung)
+      </update>
       <fix>
         <bug>42038</bug>: Correct overlay of mounts and unmounts for IIS. (rjung)
       </fix>

Modified: tomcat/connectors/trunk/jk/xdocs/reference/apache.xml
URL: http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/xdocs/reference/apache.xml?rev=591804&r1=591803&r2=591804&view=diff
==============================================================================
--- tomcat/connectors/trunk/jk/xdocs/reference/apache.xml (original)
+++ tomcat/connectors/trunk/jk/xdocs/reference/apache.xml Sun Nov  4 09:18:13 2007
@@ -762,7 +762,7 @@
 You can use the JkMount directive at the top level or inside &lt;VirtualHost&gt;
 sections of your httpd.conf file.
 </p>
-<p><b>JkUnmount</b> directive acts as an opposite to JkMount and blocks access
+<p><b>JkUnMount</b> directive acts as an opposite to JkMount and blocks access
 to a particular URL. The purpose is to be able to filter out the particular content
 types from mounted context. The following example mounts /servlet/*
 context, but all .gif files that belongs to that context are not served.
@@ -775,8 +775,12 @@
 </source>
 <p>
 JkUnMount takes precedence over JkMount directives, meaning that the JK
-will first look for unmount and then for mount directives. The following
-example will block all .gif files.
+will first try to mount and then checks, if there is an exclusiond defined by a
+JkUnMount. A JkUnMount overrides a JkMount only, if the worker names in the
+JkMount and in the JkUnMount are the same.
+</p>
+<p>
+The following example will block all .gif files although there is a JkMount for them:
 </p>
 <source>
   # do not send requests ending with .gif to worker1
@@ -785,7 +789,20 @@
   # precedence over JkMount directive
   JkMount /servlet/*.gif worker1
 </source>
-
+<p>
+Starting with version 1.2.26 of JK you can apply a JkUnMount to any worker,
+by using the star character '*' as the worker name in the JkUnMount.
+More complex patterns in JkUnMount worker names are not allowed.
+</p>
+<source>
+  # Mapping the webapps myapp1 and myapp2:
+  /myapp1/*=worker1
+  /myapp2/*=worker2
+  # Exclude the all subdirectories static for all workers:
+  !/*/static/*=*
+  # Exclude some suffixes for all workers:
+  !*.html=*
+</source>
 <p>
 <b>JkAutoAlias</b> directive automatically <b>Alias</b> webapp context directories into
 the Apache document space. It enables Apache to serve a static context while Tomcat
@@ -825,7 +842,7 @@
 <p>
 <b>JkWorkerProperty</b> is a new directive available from JK 1.2.7
 version. It is a convenient method for setting directives that are
-usually set inside <b>workers.propeties</b>file. The parameter for
+usually set inside <b>workers.propeties</b> file. The parameter for
 that directive is raw line from workers.properties file.
 </p>
 <source>
@@ -849,7 +866,7 @@
   JkMountFile conf/uriworkermap.properties
 </source>
 <p>If the mount point uri starts with an exclamation mark '!'
-it defines an exclusion in the same way JkUnmount does.
+it defines an exclusion in the same way JkUnMount does.
 If the mount point uri starts with minus sign '-'
 the mount point will only be disabled. A disabled mount can be reenabled
 by deleting the minus sign and waiting for the JkMountFile to reload.

Modified: tomcat/connectors/trunk/jk/xdocs/reference/uriworkermap.xml
URL: http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/xdocs/reference/uriworkermap.xml?rev=591804&r1=591803&r2=591804&view=diff
==============================================================================
--- tomcat/connectors/trunk/jk/xdocs/reference/uriworkermap.xml (original)
+++ tomcat/connectors/trunk/jk/xdocs/reference/uriworkermap.xml Sun Nov  4 09:18:13 2007
@@ -142,7 +142,7 @@
 Exclusion rules allows to define exclusions from URI rules, which would forward
 requests to tomcat. If the exclusion rule matches, the request will not be forwarded.
 This is usually used to serve static content by the web server.
-An rule is an exclusion rule, if it is suffixed with '!':
+A rule is an exclusion rule, if it is suffixed with '!':
 <source>
   # Mapping the URI /myapp and everything under /myapp/:
   /myapp|/*=myworker
@@ -150,6 +150,20 @@
   !/myapp/static|/*=myworker
   # Exclude some suffixes:
   !*.html=myworker
+</source>
+An exclusion rule overrides a normal mapping rule only, if the worker names in the
+normal rule and in the exclusion rule are the same. Starting with version 1.2.26 of JK
+you can apply an exclusion rule to any worker, by using the star character '*' as
+the worker name in the exclusion rule.
+More complex patterns in exclusion worker names are not allowed.
+<source>
+  # Mapping the webapps /myapp1 and /myapp2:
+  /myapp1|/*=myworker1
+  /myapp2|/*=myworker2
+  # Exclude the all subdirectories static for all workers:
+  !/*/static|/*=*
+  # Exclude some suffixes for all workers:
+  !*.html=*
 </source>
 </p>
 <p>



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