tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Doug Strick <douglas.str...@gmail.com>
Subject Configuring mod_jk with multiple Apache HTTPD Virtual Hosts
Date Mon, 03 Mar 2014 18:10:46 GMT
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?  This is
currently apache 2.2.26 compiled from source and mod_jk 1.2.37 compiled
from source as well.


--------------------VirtualHost Example--------------------------------
<VirtualHost 192.168.253.61:80 <http://192.168.253.61/>>
       DocumentRoot /web/app1.dev5.abc.com/scms
       ServerName app1.dev5.abc.com
       ServerAlias origin-app1.dev5.abc.com
       alias /shared-static /web/app1.dev5.abc.com/shared-static
       ErrorLog "|/apps/httpd/bin/rotatelogs
/weblogs/app1.dev5.abc-error.%Y%m%d 86400 -480"
       CustomLog "|/apps/httpd/bin/rotatelogs
/weblogs/app1.dev5.abc-access.%Y%m%d 86400 -480" combined env=!keepaliveuri
       DirectoryIndex index.cfm index.html index.html.var
      #AddDefaultCharset UTF-8

LoadModule jk_module  /apps/httpd/modules/mod_jk.so

        <IfModule mod_jk.c>
         JkMount / cfusion
         JkMount /* cfusion
# Where to find workers.properties
         JkWorkersFile /apps/httpd/conf.d/modjk/app1.dev5.workers.properties
         JkMountFile
/apps/httpd/conf.d/modjk/app1.dev5.uriworkermap.properties
# Where to put jk logs
         JkLogFile /weblogs/mod_jk.app1.dev5.log
# custom environment variables
         JkEnvVar REDIRECT_URL
         JkEnvVar REDIRECT_REMOTE_HOST
         JkEnvVar REDIRECT_PATH
         JkEnvVar REDIRECT_QUERY_STRING
         JkEnvVar REDIRECT_HTTP_ACCEPT
         JkEnvVar REDIRECT_HTTP_USER_AGENT
         JkEnvVar REDIRECT_REMOTE_ADDR
         JkEnvVar REDIRECT_SERVER_NAME
         JkEnvVar REDIRECT_SERVER_PORT
         JkEnvVar REDIRECT_SERVER_SOFTWARE
# Where to put jk shared memory
         JkShmFile /weblogs/app1.dev5.jk_shm
# Set the jk log level [debug/error/info]
         JkLogLevel info
# Select the timestamp log format
         JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
         JkOptions +ForwardDirectories
         AddHandler jakarta-servlet .cfm .cfml .cfc .cfr .cfswf
         DirectoryIndex index.cfm
           <Files ~ ".hbmxml$">
             Order allow,deny
             Deny from all
           </Files>
        </IfModule>
</VirtualHost>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message