Re: ColdFusion10 custom mod_jk difference
I completely agree with you, but unfortunately am stuck with CF as the developers won't switch and the company already made an investment in licenses. On Tue, Apr 8, 2014 at 3:08 PM, john Matlock wrote: > >Recommendation: > > > > >Switch away from Adobe CF 10 to Railo (www.getrailo.org) > >
ColdFusion10 custom mod_jk difference
We're moving from ColdFusion8 to CF10 where I work and ran into a strange issue. We tried using mod_jk-1.2.39 and it compiled fine. We were able to get the communication working, but ran into strange errors like below. Adobe provides their own customized version of mod_jk which appears to be built from 1.2.32. When I compiled their version from the source they provide our errors went away. I downloaded the source from here if anyone's interested: http://helpx.adobe.com/coldfusion/kb/rhel-connector-configuration.html. I'd like to avoid using their custom version as I don't know how it will play if other non-ColdFusion based apps want to use AJP in the future. Does anyone have any recommendations on how I might be able to figure out what was changed? I'm not a developer so I don't know much at the code level. [Fri Apr 04 15:22:49 2014] [9753:139964571830064] [debug] ajp_send_request::jk_ajp_common.c (1713): (cfusion) request body to send 0 - request body to resend 0 [Fri Apr 04 15:22:49 2014] [9753:139964571830064] [debug] ajp_connection_tcp_get_message::jk_ajp_common.c (1403): received from ajp13 pos=0 len=14 max=65536 [Fri Apr 04 15:22:49 2014] [9753:139964571830064] [debug] ajp_connection_tcp_get_message::jk_ajp_common.c (1403): 0F 00 0A 2F 69 6E 64 65 78 2E 68 74 6D 00 00 00 - .../index.htm ... [Fri Apr 04 15:22:49 2014] [9753:139964571830064] [error] ajp_process_callback::jk_ajp_common.c (2071): Unknown AJP protocol code: 0F [Fri Apr 04 15:22:49 2014] [9753:139964571830064] [info] ajp_service::jk_ajp_common.c (2669): (cfusion) sending request to tomcat failed (recoverable), because of server error (attempt=2) [Fri Apr 04 15:22:49 2014] [9753:139964571830064] [debug] jk_shutdown_socket::jk_connect.c (840): About to shutdown socket 25 [ 172.16.113.55:49315 -> 10.9.49.245:51010] [Fri Apr 04 15:22:49 2014] [9753:139964571830064] [debug] jk_is_input_event::jk_connect.c (1287): timeout during poll on socket 25 [ 172.16.113.55:49315 -> 10.9.49.245:51010] (timeout=2) [Fri Apr 04 15:22:49 2014] [9753:139964571830064] [debug] jk_shutdown_socket::jk_connect.c (922): Shutdown socket 25 [ 172.16.113.55:49315 -> 10.9.49.245:51010] and read 23848 lingering bytes in 0 sec. [Fri Apr 04 15:22:49 2014] [9753:139964571830064] [error] ajp_service::jk_ajp_common.c (2689): (cfusion) connecting to tomcat failed. [Fri Apr 04 15:22:49 2014] [9753:139964571830064] [debug] ajp_reset_endpoint::jk_ajp_common.c (810): (cfusion) resetting endpoint with socket -1 (socket shutdown) [Fri Apr 04 15:22:49 2014] [9753:139964571830064] [debug] ajp_done::jk_ajp_common.c (3140): recycling connection pool for worker cfusion and socket -1 [Fri Apr 04 15:22:49 2014] [9753:139964571830064] [info] jk_handler::mod_jk.c (2806): Service error=-3 for worker=cfusion
Re: Configuring mod_jk with multiple Apache HTTPD Virtual Hosts
The F5 issues were just due to poor environment configuration. Each F5 VIP was sending traffic to the same pool and that pool was only configured for 1 member. That 1 member IP/port was used by several apache virtual hosts. So basically I never knew which virtual host was getting the request which meant some requests were going to listeners not running mod_jk. Always fun joining a new company and having to piece together what someone else has done. Please remember that over 90% of these configs were created by the Adobe CF webserver config utility so I question some of it as well. Here is what's being used in the uriworkermap.properties: /cfformgateway/* = cfusion /CFFormGateway/* = cfusion /flex2gateway/* = cfusion /flex2gateway = cfusion /cffileservlet/* = cfusion /CFFileServlet/* = cfusion /cfform-internal/* = cfusion /flashservices/gateway/* = cfusion /flex-internal/* = cfusion /rest/* = cfusion /*.cfml/* = cfusion /*.mxml = cfusion /*.as = cfusion /*.cfm = cfusion /*.cfm/* = cfusion /*.swc = cfusion /*.cfml = cfusion /*.cfc = cfusion /*.cfc/* = cfusion /*.cfr = cfusion /*.cfswf = cfusion /*.sws = cfusion /*.jsp = cfusion /*.hbmxml = cfusion This is what I'm seeing in the mod_jk log. I've cut out a few sections of the "Attempting to map context URI" so there's less clutter. [Tue Mar 04 16:36:50 2014] [5763:140265396258560] [debug] map_uri_to_worker_ext::jk_uri_worker_map.c (1131): Attempting to map URI '/' from 24 maps [Tue Mar 04 16:36:50 2014] [5763:140265396258560] [debug] jk_translate::mod_jk.c (3723): no match for / found [Tue Mar 04 16:36:50 2014] [5763:140265396258560] [debug] map_uri_to_worker_ext::jk_uri_worker_map.c (1131): Attempting to map URI '/' from 24 maps [Tue Mar 04 16:36:50 2014] [5763:140265396258560] [debug] jk_map_to_storage::mod_jk.c (3798): no match for / found [Tue Mar 04 16:36:50 2014] [5763:140265396258560] [debug] map_uri_to_worker_ext::jk_uri_worker_map.c (1131): Attempting to map URI '/index.cfm' from 24 maps [ [Tue Mar 04 16:36:50 2014] [5763:140265396258560] [debug] find_match::jk_uri_worker_map.c (958): Found a wildchar match '/*.cfm=cfusion' [Tue Mar 04 16:36:50 2014] [5763:140265396258560] [debug] jk_handler::mod_jk.c (2621): Into handler jakarta-servlet worker=cfusion r->proxyreq=0 [Tue Mar 04 16:36:50 2014] [5763:140265396258560] [debug] wc_get_worker_for_name::jk_worker.c (115): found a worker cfusion [Tue Mar 04 16:36:50 2014] [5763:140265396258560] [debug] wc_get_name_for_type::jk_worker.c (292): Found worker type 'ajp13' [Tue Mar 04 16:36:50 2014] [5763:140265396258560] [debug] init_ws_service::mod_jk.c (1097): Service protocol=HTTP/0.9 method=GET ssl=false host=(null) addr=192.168.253.3 name=app1.dev5.abc.com port=80 auth=(null) user=(null) laddr=192.168.253.61 raddr=192.168.253.3 uri=/ [Tue Mar 04 16:36:50 2014] [5763:140265396258560] [debug] ajp_get_endpoint::jk_ajp_common.c (3161): acquired connection pool slot=0 after 0 retries [Tue Mar 04 16:36:50 2014] [5763:140265396258560] [debug] ajp_marshal_into_msgb::jk_ajp_common.c (626): ajp marshaling done [Tue Mar 04 16:36:50 2014] [5763:140265396258560] [debug] ajp_service::jk_ajp_common.c (2450): processing cfusion with 2 retries [Tue Mar 04 16:36:50 2014] [5763:140265396258560] [debug] ajp_connection_tcp_send_message::jk_ajp_common.c (1184): sending to ajp13 pos=4 len=185 max=8192 [Tue Mar 04 16:36:50 2014] [5763:140265396258560] [debug] ajp_connection_tcp_send_message::jk_ajp_common.c (1184): 12 34 00 B5 02 02 00 08 48 54 54 50 2F 30 2E 39 - .4..HTTP/0.9 [Tue Mar 04 16:36:50 2014] [5763:140265396258560] [debug] ajp_connection_tcp_send_message::jk_ajp_common.c (1184): 001000 00 01 2F 00 00 0D 31 39 32 2E 31 36 38 2E 32 - .../...192.168.2 [Tue Mar 04 16:36:50 2014] [5763:140265396258560] [debug] ajp_connection_tcp_send_message::jk_ajp_common.c (1184): 002035 33 2E 33 00 FF FF 00 22 63 6F 6D 6D 65 72 63 - 53.3"app1 [Tue Mar 04 16:36:50 2014] [5763:140265396258560] [debug] ajp_connection_tcp_send_message::jk_ajp_common.c (1184): 003065 2E 64 65 76 35 2E 6C 69 66 65 74 65 63 68 6E - dev5.abc [Tue Mar 04 16:36:50 2014] [5763:140265396258560] [debug] ajp_connection_tcp_send_message::jk_ajp_common.c (1184): 00406F 6C 6F 67 69 65 73 2E 63 6F 6D 00 00 50 00 00 - .com..P.. [Tue Mar 04 16:36:50 2014] [5763:140265396258560] [debug] ajp_connection_tcp_send_message::jk_ajp_common.c (1184): 005002 A0 09 00 27 54 4C 54 53 49 44 3D 31 38 36 35 - 'TLTSID=1865 [Tue Mar 04 16:36:50 2014] [5763:140265396258560] [debug] ajp_connection_tcp_send_message::jk_ajp_common.c (1184): 006037 36 41 32 41 33 45 35 31 30 41 33 30 30 30 33 - 76A2A3E510A30003 [Tue Mar 04 16:36:50 2014] [5763:140265396258560] [debug] ajp_connection_tcp_send_message::jk_ajp_common.c (1184): 007045 43 39 33 42 35 31 31 39 39 42 43 00 A0 08 00 - EC93B51199BC [Tue Mar 04 16:36:50 2014] [5763:140265396258560] [debug] ajp_connection_tcp_send_message::jk_ajp_common.c (1184): 008001 30 00 0A 00
Re: Configuring mod_jk with multiple Apache HTTPD Virtual Hosts
I went over the documentation multiple times and the light bulb finally went on after everyone's input. Most of the mod_jk configs were built by the Coldfusion web server config tool so that's why it's so cluttered. I made the configuration work by putting the below in httpd.conf: JkWorkersFile /apps/httpd/conf.d/modjk/workers.properties JkShmFile /weblogs/mod_jk.jk_shm Then I stripped out everything from the virtual host config besides the docroot and log configs like below which managed to start getting me responses. I also found there were major environment issues compounding my experience because the F5 wasn't always sending traffic to this apache host which is why I was banging my head most of the time trying to figure out why I wasn't seeing anything in my logs. Now that my apache config is good I need to figure out why coldfusion is returning a 302 for GET /. JkMountFile /apps/httpd/conf.d/modjk/app1.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 debug # 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 Order allow,deny Deny from all On Mon, Mar 3, 2014 at 1: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 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 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 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 >JkMount /myapp/ Test1 >JkMount /myapp/* Test1 > > in >JkMount /myapp/ Test2 >JkMount /myapp/* Test2 > > in >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 o
Configuring mod_jk with multiple Apache HTTPD Virtual Hosts
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 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 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 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 Order allow,deny Deny from all