-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

André,

On 3/3/14, 4:57 PM, André Warnier wrote:
> Doug Strick wrote:
>> Hello,
>> 
>> I'm currently working on a project where we're migrating from
>> Adobe Coldfusion 8 to CF 10.  Adobe CF10 now uses tomcat as the
>> underlying server and mod_jk is the standard connector used.  On
>> our test environment we have a single apache httpd instance
>> serving multiple domains with each going to a different CF
>> instance.  We really only want specific workers enabled for 
>> specific virtual hosts like below.
>> 
>> test1.abc.com --> HTTPD test1 VirtualHost --> CF Test1 
>> test2.abc.com --> HTTPD test2 VirtualHost --> CF Test2 
>> test3.abc.com --> HTTPD test3 VirtualHost --> CF Test3
>> 
>> Each CF instance is on a separate host. A developer has managed
>> to get a config working on their local desktop where CF10 runs
>> under windows and apache runs under a linux VM.  The real dev
>> environment is a lot more complicated with multiple virtual
>> hosts.  CF is the only one where we're going to use mod_jk (CF 8
>> used mod_jrun22) so this is the first time using mod_jk in our
>> environment.  Using the below config I keep getting 
>> "JkWorkersFile cannot occur within <VirtualHost> section".  Does
>> anyone have any suggestions as to what I need to do to make this
>> work?
> 
> See http://tomcat.apache.org/connectors-doc/reference/apache.html
> 
> quote
> 
> JkWorkersFile
> 
> The name of a worker file for the Tomcat servlet containers. This
> directive is only allowed once. It must be put into the global
> part of the configuration. [...]
> 
> unquote
> 
> And the same for the "JkShmFile" directive.
> 
> The "global part of the configuration" refers to the main (or
> default) Apache httpd configuration file (apache2.conf or
> httpd.conf e.g.), *outside* of any <VirtualHost> section.
> 
> The "JkWorkersFile" file defines *all* the "workers" (in mod_jk 
> parlance, a "worker" is usually "one back-end Tomcat instance"). So
> in your case, you would have 3 workers (Test1, Test2 and Test3).
> 
> Then inside of each <VirtualHost> section, you would use "JkMount" 
> directives, to indicate *for this VirtualHost* which URI's should
> be proxied to which of the known workers. For example, in
> <VirtualHost #1> JkMount /myapp/ Test1 JkMount /myapp/* Test1
> 
> in <VirtualHost #2> JkMount /myapp/ Test2 JkMount /myapp/* Test2
> 
> in <VirtualHost #3> JkMount /myapp/ Test3 JkMount /myapp/* Test3
> 
> 
> Also, it does not really make much sense to have both "JkMount" 
> directives directly in your configuration, *and* a "JkMountFile" 
> directive. Usually, one uses the one or the other. It is less
> confusing, because both specify lists of URI's which should
> be/should not be proxied to Tomcat.

+1

It's bad enough that mod_jk has to have a separate configuration file
(it's one of the only significant improvements mod_proxy_ajp has over
mod_jk), but separating your configuration into 2 different files is
going to confuse you in the long run.

Along with this, I note that you are mapping "/" and "/*" to your
mod_jk worker, and then also using "AddHandler" as well. I suspect you
could probably remove all of your JkMount, JkMountFile, and AddHandler
directives and replace them all with these:

  JkMount /*.cfm   cfusion
  JkMount /*.cfml  cfusion
  JkMount /*.cfc   cfusion
  JkMount /*.cfr   cfusion
  JkMount /*.cfswf cfusion

This will *only* send requests for the above URL extensions to Tomcat,
and everything else (static content, etc.) will be handled by httpd.
You should probably set a DocumentRoot for this VirtualHost.

I'm not sure if you ever had a problem with the "one frontend -> one
backend" configuration because you don't appear to have gotten that
far. It's trivial to configure httpd to do that: just use different
worker names for each back-end and then in httpd.conf, simply use one
of them. If you ever want to load-balance, just create a
balancing-worker that balances between the workers you're already
defined and then use /that/ in httpd.conf.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJTFQAqAAoJEBzwKT+lPKRY4FMP/Axum0yT0E4g3tTuXkT+saHf
jOF6/mwAjC60+WZONTJJRS7B2yli+rr50m1oRKuT0MjrBcnaHLjUH4sX0DhipVis
6G4+cYFNxcxPQR9T/qNXASKXb3g0LP+QzZ2Z6tuI7ouvfgG+2qM2tudLuzF82l3i
4ZrxYsD1wSyfLiz+HHpjiaNxmUuLe7CuDlWR1WBSaSet8Ekm1THaNpV7SulJIlOb
7hezzn9W+4DCmNONlMKkGywVTN3xQ0nr7erbDwoz/Q2MytpozN1duXeGC/CoZrQU
3/2FFtA3GxYzCz953p+7+KVnXYU0yrW7raMC7261x3XuHvn2QTQ1DU3BPqEIQWY3
fYvEXdq2tdu9BCrd0NtEd6pTJC9A4u2QqJUW2wgbdjTs+hlyFFS8kCwyWiwJhpbu
xcfPEH91rj8pgq6u2lBM4QRtZWNo7fGYhs+EAMrsVoO0bHY8iXige2f6WlbmDHAC
x/EW3O8Cpb3XFPofKG9VgFWtL/m8/OXKX4oy4AEpiyS/Sv0TkTiz6NXuIfYG6C9Q
e1w1jMNET/CcJKCMtgL7mmS8skA0NXsXug9mLCu5tp1wK/3son9eJ5Eyc0QaoTTK
eLO5MeNX5WZiEXGebTmy/wTsd9RXUJtzpqj1bzaye+1vjjd63f904u2vMDOom5ZR
h2/oNGT7l3lph86+3giS
=KRdb
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to