You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Jie Sheng Chua <ch...@gmail.com> on 2010/05/01 18:06:10 UTC

Tomcat Connector to Apache 2.2

Hi,

I operating Ubuntu 10.04 with Tomcat 6.0.24 on OpenJDK 6b18-1.8.
I trying to configure tomcat connector to allow (for now) all request to be
pass from Apache 2.2 to Tomcat 6.
I downloaded mod_jk-1.2.28-httpd-2.2.X.so<http://www.apache.org/dist/tomcat/tomcat-connectors/jk/binaries/linux/jk-1.2.28/x86_64/mod_jk-1.2.28-httpd-2.2.X.so>
.
With the help of the quick start
guide<http://tomcat.apache.org/connectors-doc/generic_howto/quick.html>,
i manage to configure my workers.properties, httpd.conf and tomcat
server.xml as follows.

After the below configuration, the connector didn't work. There are no error
display on the logs too.
Example context from tomcat is the tomcat supplied examples.

Does anyone know how to make this work out?

Thanks and Best Regards
Jie Sheng

*workers.properties*
*
*
*
# Define 1 real worker using ajp13
worker.list=tomcat1

# Set properties for worker1 (ajp13)
worker.tomcat1.type=ajp13
worker.tomcat1.host=localhost
worker.tomcat1.port=8009
*

*httpd.conf*

# Load mod_jk module
# Update this path to match your modules location
LoadModule    jk_module  /usr/lib/apache2/modules/mod_jk.so

# Declare the module for <IfModule directive> (remove this line on Apache
2.x)
# AddModule     mod_jk.c

# Where to find workers.properties
# Update this path to match your conf directory location (put
workers.properties next to httpd.conf)
JkWorkersFile /etc/apache2/workers.properties

# Where to put jk shared memory
# Update this path to match your local state directory or logs directory
JkShmFile     /var/log/apache2/mod_jk.shm

# Where to put jk logs
# Update this path to match your logs directory location (put mod_jk.log
next to access_log)
JkLogFile     /var/log/apache2/mod_jk.log

# Set the jk log level [debug/error/info]
JkLogLevel    info

# Select the timestamp log format
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "

# Send everything for context /examples to worker named worker1 (ajp13)
JkMount  /examples/* tomcat1

*tomcat server.xml*
*
*
*
<?xml version='1.0' encoding='utf-8'?>
<Server port="8005" shutdown="SHUTDOWN">
  <Listener className="org.apache.catalina.core.AprLifecycleListener"
SSLEngine="on" />
  <Listener className="org.apache.catalina.core.JasperListener" />
  <Listener
className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
  <Listener className="org.apache.catalina.mbeans.ServerLifecycleListener"
/>
  <Listener
className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
  <Listener className="org.apache.jk.config.ApacheConfig"
modJk="/usr/lib/apache2/modules/mod_jk.so" />

  <GlobalNamingResources>
    <Resource name="UserDatabase" auth="Container"
              type="org.apache.catalina.UserDatabase"
              description="User database that can be updated and saved"
              factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
              pathname="conf/tomcat-users.xml" />
  </GlobalNamingResources>

  <Service name="Catalina">
    <Executor name="tomcatThreadPool" namePrefix="catalina-exec-"
        maxThreads="150" minSpareThreads="4"/>
    <Connector port="8080" protocol="HTTP/1.1"
               connectionTimeout="20000"
               URIEncoding="UTF-8"
               redirectPort="8443" />
    <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />
    <Engine name="Catalina" defaultHost="localhost">
      <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
             resourceName="UserDatabase"/>
      <Host name="localhost"  appBase="webapps"
            unpackWARs="true" autoDeploy="true"
            xmlValidation="false" xmlNamespaceAware="false">
      </Host>
    </Engine>
  </Service>
</Server>

*

-- 
Jie Sheng, Chua
(+65) 97520245
chuajiesheng@gmail.com

The contents of this email are confidential to the intended recipient and
may not be disclosed. Although it is believed that this email and any
attachments are virus free, it is the responsibility of the recipient to
confirm this.

Re: Tomcat Connector to Apache 2.2

Posted by Jie Sheng Chua <ch...@gmail.com>.
Hi André,

The $ is because the line is too long and my putty end it up with a $.
Sorry for that problem.
The "Js-Server-Ubuntu.gateway.2wire.net" is rdns for my server ip address of
192.168.1.68. My router automatically reverse it.
Previously I used the default setting of my virtual host
(/etc/apache2/sites-available/default).
I changed the virtual host file, adding
        JkMount /examples tomcat1
        JkMount /examples/* tomcat1
after the line "ServerAdmin webmaster@localhost"
And IT WORK!
Also noting that after I restart my server, apache2 copied the conf
from /etc/apache2/sites-available/default
to /etc/apache2/sites-enabled/000-default

Sorry for all the little thing and Thanks André for guiding me so far.
You made me learn alot.

Thanks everyone for helping.
Hope this will help other later.

Thanks and Best Regards
Jie Sheng

On Mon, May 3, 2010 at 4:14 AM, André Warnier <aw...@ice-sa.com> wrote:

> Hi.
>
> First of all, I get all the messages posted to the list, so you do not need
> to send me a copy as a "cc", because that makes me get every message twice.
> Thanks.
>
> Next, do not change too many things at a time, that just confuses things
> for now.  So let's stick to the JkMount syntax for now.
>
> The log that you sent shows what happens when you restart Apache : the
> initialisation of mod_jk etc..
>
> It also seems that the log lines are all truncated to some length, ending
> up in a "$" sign. Is that something to do with your email program ?
> Example :
>
> > uri_worker_map_add::jk_uri_worker_map.c (720): wildchar rule
> > '/examples/*=tomcat1' source 'JkMou$
>
> The last part of that line should at least have 'JkMount' complete.
>
> Anyway, it means that apparently the JkMount directives are being read and
> understood,somewhere.
>
> What puzzles me is this part, at the end of the log :
>
>
> > [Mon May 03 02:27:18 2010] [3389:4042901264] [debug]
> jk_translate::mod_jk.c
> > (3419): missing uri map for Js-Server-Ubuntu.gateway.2wire.net:
> /examples/
> > [Mon May 03 02:27:18 2010] [3389:4042901264] [debug]
> > jk_map_to_storage::mod_jk.c (3579): missing uri map for
> > Js-Server-Ubuntu.gateway.2wire.net:/exam$
>
> Where does this "Js-Server-Ubuntu.gateway.2wire.net" come from ?
>
> You have not answered my question about VirtualHost's in Apache.
> I have a suspicion that this is where your problems come from.
> Re-read the end of my previous post.
>
> What it looks like to me, is that you have an Apache configuration using
> VirtualHost sections, and that the JkMount's are not in that VirtualHost
> section, nor are you using JkMountCopy.
>
> Basically and roughly what it means, is that the VirtualHost does have the
> mod_jk module loaded and active, but it does not know about your
> JkMount /examples
> directives.
> So it gets the request from Apache and looks at the URL, but does not
> recognise it as something it should handle.  So it gives it back to Apache
> and tells it "not for me, do it yourself".
>
> Do you understand what VirtualHost means, and where this is configured
> under Ubuntu ?
> Hava look at the httpd.conf for "Include" directives naming stuff like
> "vhosts.d" or "sites-enabled".
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>


-- 
Jie Sheng, Chua
(+65) 97520245
chuajiesheng@gmail.com

The contents of this email are confidential to the intended recipient and
may not be disclosed. Although it is believed that this email and any
attachments are virus free, it is the responsibility of the recipient to
confirm this.

Re: Tomcat Connector to Apache 2.2

Posted by André Warnier <aw...@ice-sa.com>.
Hi.

First of all, I get all the messages posted to the list, so you do not 
need to send me a copy as a "cc", because that makes me get every 
message twice. Thanks.

Next, do not change too many things at a time, that just confuses things 
for now.  So let's stick to the JkMount syntax for now.

The log that you sent shows what happens when you restart Apache : the 
initialisation of mod_jk etc..

It also seems that the log lines are all truncated to some length, 
ending up in a "$" sign. Is that something to do with your email program ?
Example :
 > uri_worker_map_add::jk_uri_worker_map.c (720): wildchar rule
 > '/examples/*=tomcat1' source 'JkMou$

The last part of that line should at least have 'JkMount' complete.

Anyway, it means that apparently the JkMount directives are being read 
and understood,somewhere.

What puzzles me is this part, at the end of the log :

 > [Mon May 03 02:27:18 2010] [3389:4042901264] [debug] 
jk_translate::mod_jk.c
 > (3419): missing uri map for Js-Server-Ubuntu.gateway.2wire.net:/examples/
 > [Mon May 03 02:27:18 2010] [3389:4042901264] [debug]
 > jk_map_to_storage::mod_jk.c (3579): missing uri map for
 > Js-Server-Ubuntu.gateway.2wire.net:/exam$

Where does this "Js-Server-Ubuntu.gateway.2wire.net" come from ?

You have not answered my question about VirtualHost's in Apache.
I have a suspicion that this is where your problems come from.
Re-read the end of my previous post.

What it looks like to me, is that you have an Apache configuration using 
VirtualHost sections, and that the JkMount's are not in that VirtualHost 
section, nor are you using JkMountCopy.

Basically and roughly what it means, is that the VirtualHost does have 
the mod_jk module loaded and active, but it does not know about your
JkMount /examples
directives.
So it gets the request from Apache and looks at the URL, but does not 
recognise it as something it should handle.  So it gives it back to 
Apache and tells it "not for me, do it yourself".

Do you understand what VirtualHost means, and where this is configured 
under Ubuntu ?
Hava look at the httpd.conf for "Include" directives naming stuff like 
"vhosts.d" or "sites-enabled".




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


Re: Tomcat Connector to Apache 2.2

Posted by Jie Sheng Chua <ch...@gmail.com>.
Hi André,

Sorry as this email will become quite long.
Thanks for your help so far.
I change the log to debug and this is the first type of log that I retrieve.

*Type 1 Log:*

[Mon May 03 02:27:12 2010] [3385:4191106880] [debug]
jk_set_time_fmt::jk_util.c (458): Pre-processed log time stamp format is
'[%a %b %d %H:%M:%S %Y]$
[Mon May 03 02:27:12 2010] [3385:4191106880] [debug]
uri_worker_map_open::jk_uri_worker_map.c (770): rule map size is 2
[Mon May 03 02:27:12 2010] [3385:4191106880] [debug]
uri_worker_map_add::jk_uri_worker_map.c (720): wildchar rule
'/examples/*=tomcat1' source 'JkMou$
[Mon May 03 02:27:12 2010] [3385:4191106880] [debug]
uri_worker_map_add::jk_uri_worker_map.c (729): exact rule
'/examples=tomcat1' source 'JkMount' w$
[Mon May 03 02:27:12 2010] [3385:4191106880] [debug]
uri_worker_map_dump::jk_uri_worker_map.c (171): uri map dump after map open:
index=0 file='(null$
[Mon May 03 02:27:12 2010] [3385:4191106880] [debug]
uri_worker_map_dump::jk_uri_worker_map.c (176): generation 0: size=0
nosize=0 capacity=0
[Mon May 03 02:27:12 2010] [3385:4191106880] [debug]
uri_worker_map_dump::jk_uri_worker_map.c (176): generation 1: size=2
nosize=0 capacity=4
[Mon May 03 02:27:12 2010] [3385:4191106880] [debug]
uri_worker_map_dump::jk_uri_worker_map.c (186): NEXT (1) map #0:
uri=/examples/* worker=tomcat1 $
[Mon May 03 02:27:12 2010] [3385:4191106880] [debug]
uri_worker_map_dump::jk_uri_worker_map.c (186): NEXT (1) map #1:
uri=/examples worker=tomcat1 co$
[Mon May 03 02:27:12 2010] [3385:4191106880] [debug]
jk_set_time_fmt::jk_util.c (458): Pre-processed log time stamp format is
'[%a %b %d %H:%M:%S %Y]$
[Mon May 03 02:27:12 2010] [3385:4191106880] [debug] init_jk::mod_jk.c
(3107): Using fcntl() for locking.
[Mon May 03 02:27:12 2010] [3385:4191106880] [debug] init_jk::mod_jk.c
(3123): Setting default connection pool max size to 25
[Mon May 03 02:27:12 2010] [3385:4191106880] [debug]
jk_map_read_property::jk_map.c (491): Adding property 'worker.list' with
value 'tomcat1' to map.
[Mon May 03 02:27:12 2010] [3385:4191106880] [debug]
jk_map_read_property::jk_map.c (491): Adding property 'worker.tomcat1.type'
with value 'ajp13' t$
[Mon May 03 02:27:12 2010] [3385:4191106880] [debug]
jk_map_read_property::jk_map.c (491): Adding property 'worker.tomcat1.host'
with value 'localhos$
[Mon May 03 02:27:12 2010] [3385:4191106880] [debug]
jk_map_read_property::jk_map.c (491): Adding property 'worker.tomcat1.port'
with value '8009' to$
[Mon May 03 02:27:12 2010] [3385:4191106880] [debug]
jk_map_resolve_references::jk_map.c (774): Checking for references with
prefix worker. with wild$
[Mon May 03 02:27:12 2010] [3385:4191106880] [debug]
jk_shm_calculate_size::jk_shm.c (132): shared memory will contain 1 ajp
workers of size 320 and $
[Mon May 03 02:27:12 2010] [3385:4191106880] [debug] do_shm_open::jk_shm.c
(493): Truncated shared memory to 448
[Mon May 03 02:27:12 2010] [3385:4191106880] [debug] do_shm_open::jk_shm.c
(538): Initialized shared memory /var/log/apache2/mod_jk.shm.3385 size=448$
[Mon May 03 02:27:12 2010] [3385:4191106880] [debug]
do_shm_open_lock::jk_shm.c (412): Opened shared memory lock
/var/log/apache2/mod_jk.shm.3385.lock
[Mon May 03 02:27:12 2010] [3385:4191106880] [debug] jk_map_dump::jk_map.c
(589): Dump of map: 'ServerRoot' -> '/etc/apache2'
[Mon May 03 02:27:12 2010] [3385:4191106880] [debug] jk_map_dump::jk_map.c
(589): Dump of map: 'worker.list' -> 'tomcat1'
[Mon May 03 02:27:12 2010] [3385:4191106880] [debug] jk_map_dump::jk_map.c
(589): Dump of map: 'worker.tomcat1.type' -> 'ajp13'
[Mon May 03 02:27:12 2010] [3385:4191106880] [debug] jk_map_dump::jk_map.c
(589): Dump of map: 'worker.tomcat1.host' -> 'localhost'
[Mon May 03 02:27:12 2010] [3385:4191106880] [debug] jk_map_dump::jk_map.c
(589): Dump of map: 'worker.tomcat1.port' -> '8009'
[Mon May 03 02:27:12 2010] [3385:4191106880] [debug]
build_worker_map::jk_worker.c (242): creating worker tomcat1
[Mon May 03 02:27:12 2010] [3385:4191106880] [debug]
wc_create_worker::jk_worker.c (146): about to create instance tomcat1 of
ajp13
[Mon May 03 02:27:12 2010] [3385:4191106880] [debug]
wc_create_worker::jk_worker.c (159): about to validate and init tomcat1
[Mon May 03 02:27:12 2010] [3385:4191106880] [debug]
ajp_validate::jk_ajp_common.c (2512): worker tomcat1 contact is
'localhost:8009'
[Mon May 03 02:27:12 2010] [3385:4191106880] [debug]
ajp_init::jk_ajp_common.c (2699): setting endpoint options:
[Mon May 03 02:27:12 2010] [3385:4191106880] [debug]
ajp_init::jk_ajp_common.c (2702): keepalive:              0
[Mon May 03 02:27:12 2010] [3385:4191106880] [debug]
ajp_init::jk_ajp_common.c (2706): socket timeout:         0
[Mon May 03 02:27:12 2010] [3385:4191106880] [debug]
ajp_init::jk_ajp_common.c (2710): socket connect timeout: 0
[Mon May 03 02:27:12 2010] [3385:4191106880] [debug]
ajp_init::jk_ajp_common.c (2714): buffer size:            0
[Mon May 03 02:27:12 2010] [3385:4191106880] [debug]
ajp_init::jk_ajp_common.c (2718): pool timeout:           0
[Mon May 03 02:27:12 2010] [3385:4191106880] [debug]
ajp_init::jk_ajp_common.c (2722): ping timeout:           10000
[Mon May 03 02:27:12 2010] [3385:4191106880] [debug]
ajp_init::jk_ajp_common.c (2726): connect timeout:        0
[Mon May 03 02:27:12 2010] [3385:4191106880] [debug]
ajp_init::jk_ajp_common.c (2730): reply timeout:          0
[Mon May 03 02:27:12 2010] [3385:4191106880] [debug]
ajp_init::jk_ajp_common.c (2734): prepost timeout:        0
[Mon May 03 02:27:12 2010] [3385:4191106880] [debug]
ajp_init::jk_ajp_common.c (2738): recovery options:       0
[Mon May 03 02:27:12 2010] [3385:4191106880] [debug]
ajp_init::jk_ajp_common.c (2742): retries:                2
[Mon May 03 02:27:12 2010] [3385:4191106880] [debug]
ajp_init::jk_ajp_common.c (2746): max packet size:        8192
[Mon May 03 02:27:12 2010] [3385:4191106880] [debug]
ajp_init::jk_ajp_common.c (2750): retry interval:         100
[Mon May 03 02:27:12 2010] [3385:4191106880] [debug]
ajp_create_endpoint_cache::jk_ajp_common.c (2562): setting connection pool
size to 25 with min 1$
[Mon May 03 02:27:12 2010] [3385:4191106880] [info] init_jk::mod_jk.c
(3183): mod_jk/1.2.28 initialized
[Mon May 03 02:27:12 2010] [3385:4191106880] [debug]
wc_get_worker_for_name::jk_worker.c (116): found a worker tomcat1
[Mon May 03 02:27:12 2010] [3385:4191106880] [debug]
wc_get_name_for_type::jk_worker.c (293): Found worker type 'ajp13'
[Mon May 03 02:27:12 2010] [3385:4191106880] [debug]
uri_worker_map_ext::jk_uri_worker_map.c (512): Checking extension for worker
0: tomcat1 of type $
[Mon May 03 02:27:12 2010] [3385:4191106880] [debug]
wc_get_worker_for_name::jk_worker.c (116): found a worker tomcat1
[Mon May 03 02:27:12 2010] [3385:4191106880] [debug]
wc_get_name_for_type::jk_worker.c (293): Found worker type 'ajp13'
[Mon May 03 02:27:12 2010] [3385:4191106880] [debug]
uri_worker_map_ext::jk_uri_worker_map.c (512): Checking extension for worker
1: tomcat1 of type $
[Mon May 03 02:27:12 2010] [3385:4191106880] [debug]
uri_worker_map_dump::jk_uri_worker_map.c (171): uri map dump after extension
stripping: index=0 $
[Mon May 03 02:27:12 2010] [3385:4191106880] [debug]
uri_worker_map_dump::jk_uri_worker_map.c (176): generation 0: size=0
nosize=0 capacity=0
[Mon May 03 02:27:12 2010] [3385:4191106880] [debug]
uri_worker_map_dump::jk_uri_worker_map.c (176): generation 1: size=2
nosize=0 capacity=4
[Mon May 03 02:27:12 2010] [3385:4191106880] [debug]
uri_worker_map_dump::jk_uri_worker_map.c (186): NEXT (1) map #0:
uri=/examples/* worker=tomcat1 $
[Mon May 03 02:27:12 2010] [3385:4191106880] [debug]
uri_worker_map_dump::jk_uri_worker_map.c (186): NEXT (1) map #1:
uri=/examples worker=tomcat1 co$
[Mon May 03 02:27:12 2010] [3385:4191106880] [debug]
uri_worker_map_switch::jk_uri_worker_map.c (482): Switching uri worker map
from index 0 to index$
[Mon May 03 02:27:12 2010] [3386:4191106880] [debug]
jk_set_time_fmt::jk_util.c (458): Pre-processed log time stamp format is
'[%a %b %d %H:%M:%S %Y]$
[Mon May 03 02:27:12 2010] [3386:4191106880] [debug]
uri_worker_map_open::jk_uri_worker_map.c (770): rule map size is 2
[Mon May 03 02:27:12 2010] [3386:4191106880] [debug]
uri_worker_map_add::jk_uri_worker_map.c (720): wildchar rule
'/examples/*=tomcat1' source 'JkMou$
[Mon May 03 02:27:12 2010] [3386:4191106880] [debug]
uri_worker_map_add::jk_uri_worker_map.c (729): exact rule
'/examples=tomcat1' source 'JkMount' w$
[Mon May 03 02:27:12 2010] [3386:4191106880] [debug]
uri_worker_map_dump::jk_uri_worker_map.c (171): uri map dump after map open:
index=0 file='(null$
[Mon May 03 02:27:12 2010] [3386:4191106880] [debug]
uri_worker_map_dump::jk_uri_worker_map.c (176): generation 0: size=0
nosize=0 capacity=0
[Mon May 03 02:27:12 2010] [3386:4191106880] [debug]
uri_worker_map_dump::jk_uri_worker_map.c (176): generation 1: size=2
nosize=0 capacity=4
[Mon May 03 02:27:12 2010] [3386:4191106880] [debug]
uri_worker_map_dump::jk_uri_worker_map.c (186): NEXT (1) map #0:
uri=/examples/* worker=tomcat1 $
[Mon May 03 02:27:12 2010] [3386:4191106880] [debug]
uri_worker_map_dump::jk_uri_worker_map.c (186): NEXT (1) map #1:
uri=/examples worker=tomcat1 co$
[Mon May 03 02:27:12 2010] [3386:4191106880] [debug]
jk_set_time_fmt::jk_util.c (458): Pre-processed log time stamp format is
'[%a %b %d %H:%M:%S %Y]$
[Mon May 03 02:27:12 2010] [3386:4191106880] [debug] init_jk::mod_jk.c
(3107): Using fcntl() for locking.
[Mon May 03 02:27:12 2010] [3386:4191106880] [debug] init_jk::mod_jk.c
(3123): Setting default connection pool max size to 25
[Mon May 03 02:27:12 2010] [3386:4191106880] [debug]
jk_map_read_property::jk_map.c (491): Adding property 'worker.list' with
value 'tomcat1' to map.
[Mon May 03 02:27:12 2010] [3386:4191106880] [debug]
jk_map_read_property::jk_map.c (491): Adding property 'worker.tomcat1.type'
with value 'ajp13' t$
[Mon May 03 02:27:12 2010] [3386:4191106880] [debug]
jk_map_read_property::jk_map.c (491): Adding property 'worker.tomcat1.host'
with value 'localhos$
[Mon May 03 02:27:12 2010] [3386:4191106880] [debug]
jk_map_read_property::jk_map.c (491): Adding property 'worker.tomcat1.port'
with value '8009' to$
[Mon May 03 02:27:12 2010] [3386:4191106880] [debug]
jk_map_resolve_references::jk_map.c (774): Checking for references with
prefix worker. with wild$
[Mon May 03 02:27:12 2010] [3386:4191106880] [debug]
jk_shm_calculate_size::jk_shm.c (132): shared memory will contain 1 ajp
workers of size 320 and $
[Mon May 03 02:27:12 2010] [3386:4191106880] [debug] do_shm_open::jk_shm.c
(493): Truncated shared memory to 448
[Mon May 03 02:27:12 2010] [3386:4191106880] [debug] do_shm_open::jk_shm.c
(538): Initialized shared memory /var/log/apache2/mod_jk.shm.3386 size=448$
[Mon May 03 02:27:12 2010] [3386:4191106880] [debug]
do_shm_open_lock::jk_shm.c (412): Opened shared memory lock
/var/log/apache2/mod_jk.shm.3386.lock
[Mon May 03 02:27:12 2010] [3386:4191106880] [debug] jk_map_dump::jk_map.c
(589): Dump of map: 'ServerRoot' -> '/etc/apache2'
[Mon May 03 02:27:12 2010] [3386:4191106880] [debug] jk_map_dump::jk_map.c
(589): Dump of map: 'worker.list' -> 'tomcat1'
[Mon May 03 02:27:12 2010] [3386:4191106880] [debug] jk_map_dump::jk_map.c
(589): Dump of map: 'worker.tomcat1.type' -> 'ajp13'
[Mon May 03 02:27:12 2010] [3386:4191106880] [debug] jk_map_dump::jk_map.c
(589): Dump of map: 'worker.tomcat1.host' -> 'localhost'
[Mon May 03 02:27:12 2010] [3386:4191106880] [debug] jk_map_dump::jk_map.c
(589): Dump of map: 'worker.tomcat1.port' -> '8009'
[Mon May 03 02:27:12 2010] [3386:4191106880] [debug]
build_worker_map::jk_worker.c (242): creating worker tomcat1
[Mon May 03 02:27:12 2010] [3386:4191106880] [debug]
wc_create_worker::jk_worker.c (146): about to create instance tomcat1 of
ajp13
[Mon May 03 02:27:12 2010] [3386:4191106880] [debug]
wc_create_worker::jk_worker.c (159): about to validate and init tomcat1
[Mon May 03 02:27:12 2010] [3386:4191106880] [debug]
ajp_validate::jk_ajp_common.c (2512): worker tomcat1 contact is
'localhost:8009'
[Mon May 03 02:27:12 2010] [3386:4191106880] [debug]
ajp_init::jk_ajp_common.c (2699): setting endpoint options:
[Mon May 03 02:27:12 2010] [3386:4191106880] [debug]
ajp_init::jk_ajp_common.c (2702): keepalive:              0
[Mon May 03 02:27:12 2010] [3386:4191106880] [debug]
ajp_init::jk_ajp_common.c (2706): socket timeout:         0
[Mon May 03 02:27:12 2010] [3386:4191106880] [debug]
ajp_init::jk_ajp_common.c (2710): socket connect timeout: 0
[Mon May 03 02:27:12 2010] [3386:4191106880] [debug]
ajp_init::jk_ajp_common.c (2714): buffer size:            0
[Mon May 03 02:27:12 2010] [3386:4191106880] [debug]
ajp_init::jk_ajp_common.c (2718): pool timeout:           0
[Mon May 03 02:27:12 2010] [3386:4191106880] [debug]
ajp_init::jk_ajp_common.c (2722): ping timeout:           10000
[Mon May 03 02:27:12 2010] [3386:4191106880] [debug]
ajp_init::jk_ajp_common.c (2726): connect timeout:        0
[Mon May 03 02:27:12 2010] [3386:4191106880] [debug]
ajp_init::jk_ajp_common.c (2730): reply timeout:          0
[Mon May 03 02:27:12 2010] [3386:4191106880] [debug]
ajp_init::jk_ajp_common.c (2734): prepost timeout:        0
[Mon May 03 02:27:12 2010] [3386:4191106880] [debug]
ajp_init::jk_ajp_common.c (2738): recovery options:       0
[Mon May 03 02:27:12 2010] [3386:4191106880] [debug]
ajp_init::jk_ajp_common.c (2742): retries:                2
[Mon May 03 02:27:12 2010] [3386:4191106880] [debug]
ajp_init::jk_ajp_common.c (2746): max packet size:        8192
[Mon May 03 02:27:12 2010] [3386:4191106880] [debug]
ajp_init::jk_ajp_common.c (2750): retry interval:         100
[Mon May 03 02:27:12 2010] [3386:4191106880] [debug]
ajp_create_endpoint_cache::jk_ajp_common.c (2562): setting connection pool
size to 25 with min 1$
[Mon May 03 02:27:12 2010] [3386:4191106880] [info] init_jk::mod_jk.c
(3183): mod_jk/1.2.28 initialized
[Mon May 03 02:27:12 2010] [3386:4191106880] [debug]
wc_get_worker_for_name::jk_worker.c (116): found a worker tomcat1
[Mon May 03 02:27:12 2010] [3386:4191106880] [debug]
wc_get_name_for_type::jk_worker.c (293): Found worker type 'ajp13'
[Mon May 03 02:27:12 2010] [3386:4191106880] [debug]
uri_worker_map_ext::jk_uri_worker_map.c (512): Checking extension for worker
0: tomcat1 of type $
[Mon May 03 02:27:12 2010] [3386:4191106880] [debug]
wc_get_worker_for_name::jk_worker.c (116): found a worker tomcat1
[Mon May 03 02:27:12 2010] [3386:4191106880] [debug]
wc_get_name_for_type::jk_worker.c (293): Found worker type 'ajp13'
[Mon May 03 02:27:12 2010] [3386:4191106880] [debug]
uri_worker_map_ext::jk_uri_worker_map.c (512): Checking extension for worker
1: tomcat1 of type $
[Mon May 03 02:27:12 2010] [3386:4191106880] [debug]
uri_worker_map_dump::jk_uri_worker_map.c (171): uri map dump after extension
stripping: index=0 $
[Mon May 03 02:27:12 2010] [3386:4191106880] [debug]
uri_worker_map_dump::jk_uri_worker_map.c (176): generation 0: size=0
nosize=0 capacity=0
[Mon May 03 02:27:12 2010] [3386:4191106880] [debug]
uri_worker_map_dump::jk_uri_worker_map.c (176): generation 1: size=2
nosize=0 capacity=4
[Mon May 03 02:27:12 2010] [3386:4191106880] [debug]
uri_worker_map_dump::jk_uri_worker_map.c (186): NEXT (1) map #0:
uri=/examples/* worker=tomcat1 $
[Mon May 03 02:27:12 2010] [3386:4191106880] [debug]
uri_worker_map_dump::jk_uri_worker_map.c (186): NEXT (1) map #1:
uri=/examples worker=tomcat1 co$
[Mon May 03 02:27:12 2010] [3386:4191106880] [debug]
uri_worker_map_switch::jk_uri_worker_map.c (482): Switching uri worker map
from index 0 to index$
[Mon May 03 02:27:12 2010] [3389:4191106880] [debug] do_shm_open::jk_shm.c
(550): Attached shared memory /var/log/apache2/mod_jk.shm.3386 [2] size=44$
[Mon May 03 02:27:12 2010] [3389:4191106880] [debug] do_shm_open::jk_shm.c
(564): Resetting the shared memory for child 2
[Mon May 03 02:27:12 2010] [3389:4191106880] [debug]
do_shm_open_lock::jk_shm.c (353): Duplicated shared memory lock
/var/log/apache2/mod_jk.shm.3386$
[Mon May 03 02:27:12 2010] [3389:4191106880] [debug] jk_child_init::mod_jk.c
(3068): Initialized mod_jk/1.2.28
[Mon May 03 02:27:12 2010] [3390:4191106880] [debug] do_shm_open::jk_shm.c
(550): Attached shared memory /var/log/apache2/mod_jk.shm.3386 [3] size=44$
[Mon May 03 02:27:12 2010] [3390:4191106880] [debug] do_shm_open::jk_shm.c
(564): Resetting the shared memory for child 3
[Mon May 03 02:27:12 2010] [3390:4191106880] [debug]
do_shm_open_lock::jk_shm.c (353): Duplicated shared memory lock
/var/log/apache2/mod_jk.shm.3386$
[Mon May 03 02:27:12 2010] [3390:4191106880] [debug] jk_child_init::mod_jk.c
(3068): Initialized mod_jk/1.2.28
[Mon May 03 02:27:18 2010] [3389:4042901264] [debug] jk_translate::mod_jk.c
(3419): missing uri map for Js-Server-Ubuntu.gateway.2wire.net:/examples/
[Mon May 03 02:27:18 2010] [3389:4042901264] [debug]
jk_map_to_storage::mod_jk.c (3579): missing uri map for
Js-Server-Ubuntu.gateway.2wire.net:/exam$

I realise that it create, map and dump a few time within the same second.
At the first highlighted red line, it initialized and start detecting
worker. But at the last part (3068), it initialized and didn't detect
worker.
Is it normal? It look to me like a bug.
I change my IE setting and it display Apache's "The requested URL /examples/
was not found on this server." error.

I went on to change my httpd.conf to with <Location>

*Type 2, httpd.conf:*

# Send everything for context /examples to worker named worker1 (ajp13)
#JkMount  /examples/* tomcat1
#JkMount  /examples tomcat1

<Location *;jsessionid=>
  SetHandler jakarta-servlet
  SetEnv JK_WORKER_NAME tomcat1
</Location>

<Location /examples>
  SetEnvIf REQUEST_URI ^/examples/*([^/]*)/ JK_WORKER_NAME=tomcat1
  SetEnvIf REQUEST_URI ^/examples([^/]*)/ JK_WORKER_NAME=tomcat1
</Location>

*Type 2 Log:*

[Mon May 03 02:39:37 2010] [3483:1686849344] [debug]
jk_set_time_fmt::jk_util.c (458): Pre-processed log time stamp format is
'[%a %b %d %H:%M:%S %Y]$
[Mon May 03 02:39:37 2010] [3483:1686849344] [debug]
uri_worker_map_open::jk_uri_worker_map.c (770): rule map size is 0
[Mon May 03 02:39:37 2010] [3483:1686849344] [debug]
uri_worker_map_dump::jk_uri_worker_map.c (171): uri map dump after map open:
index=0 file='(null$
[Mon May 03 02:39:37 2010] [3483:1686849344] [debug]
uri_worker_map_dump::jk_uri_worker_map.c (176): generation 0: size=0
nosize=0 capacity=0
[Mon May 03 02:39:37 2010] [3483:1686849344] [debug]
uri_worker_map_dump::jk_uri_worker_map.c (176): generation 1: size=0
nosize=0 capacity=0
[Mon May 03 02:39:37 2010] [3483:1686849344] [debug]
jk_set_time_fmt::jk_util.c (458): Pre-processed log time stamp format is
'[%a %b %d %H:%M:%S %Y]$
[Mon May 03 02:39:37 2010] [3483:1686849344] [debug] init_jk::mod_jk.c
(3107): Using fcntl() for locking.
[Mon May 03 02:39:37 2010] [3483:1686849344] [debug] init_jk::mod_jk.c
(3123): Setting default connection pool max size to 25
[Mon May 03 02:39:37 2010] [3483:1686849344] [debug]
jk_map_read_property::jk_map.c (491): Adding property 'worker.list' with
value 'tomcat1' to map.
[Mon May 03 02:39:37 2010] [3483:1686849344] [debug]
jk_map_read_property::jk_map.c (491): Adding property 'worker.tomcat1.type'
with value 'ajp13' t$
[Mon May 03 02:39:37 2010] [3483:1686849344] [debug]
jk_map_read_property::jk_map.c (491): Adding property 'worker.tomcat1.host'
with value 'localhos$
[Mon May 03 02:39:37 2010] [3483:1686849344] [debug]
jk_map_read_property::jk_map.c (491): Adding property 'worker.tomcat1.port'
with value '8009' to$
[Mon May 03 02:39:37 2010] [3483:1686849344] [debug]
jk_map_resolve_references::jk_map.c (774): Checking for references with
prefix worker. with wild$
[Mon May 03 02:39:37 2010] [3483:1686849344] [debug]
jk_shm_calculate_size::jk_shm.c (132): shared memory will contain 1 ajp
workers of size 320 and $
[Mon May 03 02:39:37 2010] [3483:1686849344] [debug] do_shm_open::jk_shm.c
(493): Truncated shared memory to 448
[Mon May 03 02:39:37 2010] [3483:1686849344] [debug] do_shm_open::jk_shm.c
(538): Initialized shared memory /var/log/apache2/mod_jk.shm.3483 size=448$
[Mon May 03 02:39:37 2010] [3483:1686849344] [debug]
do_shm_open_lock::jk_shm.c (412): Opened shared memory lock
/var/log/apache2/mod_jk.shm.3483.lock
[Mon May 03 02:39:37 2010] [3483:1686849344] [debug] jk_map_dump::jk_map.c
(589): Dump of map: 'ServerRoot' -> '/etc/apache2'
[Mon May 03 02:39:37 2010] [3483:1686849344] [debug] jk_map_dump::jk_map.c
(589): Dump of map: 'worker.list' -> 'tomcat1'
[Mon May 03 02:39:37 2010] [3483:1686849344] [debug] jk_map_dump::jk_map.c
(589): Dump of map: 'worker.tomcat1.type' -> 'ajp13'
[Mon May 03 02:39:37 2010] [3483:1686849344] [debug] jk_map_dump::jk_map.c
(589): Dump of map: 'worker.tomcat1.host' -> 'localhost'
[Mon May 03 02:39:37 2010] [3483:1686849344] [debug] jk_map_dump::jk_map.c
(589): Dump of map: 'worker.tomcat1.port' -> '8009'
[Mon May 03 02:39:37 2010] [3483:1686849344] [debug]
build_worker_map::jk_worker.c (242): creating worker tomcat1
[Mon May 03 02:39:37 2010] [3483:1686849344] [debug]
wc_create_worker::jk_worker.c (146): about to create instance tomcat1 of
ajp13
[Mon May 03 02:39:37 2010] [3483:1686849344] [debug]
wc_create_worker::jk_worker.c (159): about to validate and init tomcat1
[Mon May 03 02:39:37 2010] [3483:1686849344] [debug]
ajp_validate::jk_ajp_common.c (2512): worker tomcat1 contact is
'localhost:8009'
[Mon May 03 02:39:37 2010] [3483:1686849344] [debug]
ajp_init::jk_ajp_common.c (2699): setting endpoint options:
[Mon May 03 02:39:37 2010] [3483:1686849344] [debug]
ajp_init::jk_ajp_common.c (2702): keepalive:              0
[Mon May 03 02:39:37 2010] [3483:1686849344] [debug]
ajp_init::jk_ajp_common.c (2706): socket timeout:         0
[Mon May 03 02:39:37 2010] [3483:1686849344] [debug]
ajp_init::jk_ajp_common.c (2710): socket connect timeout: 0
[Mon May 03 02:39:37 2010] [3483:1686849344] [debug]
ajp_init::jk_ajp_common.c (2714): buffer size:            0
[Mon May 03 02:39:37 2010] [3483:1686849344] [debug]
ajp_init::jk_ajp_common.c (2718): pool timeout:           0
[Mon May 03 02:39:37 2010] [3483:1686849344] [debug]
ajp_init::jk_ajp_common.c (2722): ping timeout:           10000
[Mon May 03 02:39:37 2010] [3483:1686849344] [debug]
ajp_init::jk_ajp_common.c (2726): connect timeout:        0
[Mon May 03 02:39:37 2010] [3483:1686849344] [debug]
ajp_init::jk_ajp_common.c (2730): reply timeout:          0
[Mon May 03 02:39:37 2010] [3483:1686849344] [debug]
ajp_init::jk_ajp_common.c (2734): prepost timeout:        0
[Mon May 03 02:39:37 2010] [3483:1686849344] [debug]
ajp_init::jk_ajp_common.c (2738): recovery options:       0
[Mon May 03 02:39:37 2010] [3483:1686849344] [debug]
ajp_init::jk_ajp_common.c (2742): retries:                2
[Mon May 03 02:39:37 2010] [3483:1686849344] [debug]
ajp_init::jk_ajp_common.c (2746): max packet size:        8192
[Mon May 03 02:39:37 2010] [3483:1686849344] [debug]
ajp_init::jk_ajp_common.c (2750): retry interval:         100
[Mon May 03 02:39:37 2010] [3483:1686849344] [debug]
ajp_create_endpoint_cache::jk_ajp_common.c (2562): setting connection pool
size to 25 with min 1$
[Mon May 03 02:39:37 2010] [3483:1686849344] [info] init_jk::mod_jk.c
(3183): mod_jk/1.2.28 initialized
[Mon May 03 02:39:37 2010] [3483:1686849344] [debug]
uri_worker_map_dump::jk_uri_worker_map.c (171): uri map dump after extension
stripping: index=0 $
[Mon May 03 02:39:37 2010] [3483:1686849344] [debug]
uri_worker_map_dump::jk_uri_worker_map.c (176): generation 0: size=0
nosize=0 capacity=0
[Mon May 03 02:39:37 2010] [3483:1686849344] [debug]
uri_worker_map_dump::jk_uri_worker_map.c (176): generation 1: size=0
nosize=0 capacity=0
[Mon May 03 02:39:37 2010] [3483:1686849344] [debug]
uri_worker_map_switch::jk_uri_worker_map.c (482): Switching uri worker map
from index 0 to index$
[Mon May 03 02:39:37 2010] [3484:1686849344] [debug]
jk_set_time_fmt::jk_util.c (458): Pre-processed log time stamp format is
'[%a %b %d %H:%M:%S %Y]$
[Mon May 03 02:39:37 2010] [3484:1686849344] [debug]
uri_worker_map_open::jk_uri_worker_map.c (770): rule map size is 0
[Mon May 03 02:39:37 2010] [3484:1686849344] [debug]
uri_worker_map_dump::jk_uri_worker_map.c (171): uri map dump after map open:
index=0 file='(null$
[Mon May 03 02:39:37 2010] [3484:1686849344] [debug]
uri_worker_map_dump::jk_uri_worker_map.c (176): generation 0: size=0
nosize=0 capacity=0
[Mon May 03 02:39:37 2010] [3484:1686849344] [debug]
uri_worker_map_dump::jk_uri_worker_map.c (176): generation 1: size=0
nosize=0 capacity=0
[Mon May 03 02:39:37 2010] [3484:1686849344] [debug]
jk_set_time_fmt::jk_util.c (458): Pre-processed log time stamp format is
'[%a %b %d %H:%M:%S %Y]$
[Mon May 03 02:39:37 2010] [3484:1686849344] [debug] init_jk::mod_jk.c
(3107): Using fcntl() for locking.
[Mon May 03 02:39:37 2010] [3484:1686849344] [debug] init_jk::mod_jk.c
(3123): Setting default connection pool max size to 25
[Mon May 03 02:39:37 2010] [3484:1686849344] [debug]
jk_map_read_property::jk_map.c (491): Adding property 'worker.list' with
value 'tomcat1' to map.
[Mon May 03 02:39:37 2010] [3484:1686849344] [debug]
jk_map_read_property::jk_map.c (491): Adding property 'worker.tomcat1.type'
with value 'ajp13' t$
[Mon May 03 02:39:37 2010] [3484:1686849344] [debug]
jk_map_read_property::jk_map.c (491): Adding property 'worker.tomcat1.host'
with value 'localhos$
[Mon May 03 02:39:37 2010] [3484:1686849344] [debug]
jk_map_read_property::jk_map.c (491): Adding property 'worker.tomcat1.port'
with value '8009' to$
[Mon May 03 02:39:37 2010] [3484:1686849344] [debug]
jk_map_resolve_references::jk_map.c (774): Checking for references with
prefix worker. with wild$
[Mon May 03 02:39:37 2010] [3484:1686849344] [debug]
jk_shm_calculate_size::jk_shm.c (132): shared memory will contain 1 ajp
workers of size 320 and $
[Mon May 03 02:39:37 2010] [3484:1686849344] [debug] do_shm_open::jk_shm.c
(493): Truncated shared memory to 448
[Mon May 03 02:39:37 2010] [3484:1686849344] [debug] do_shm_open::jk_shm.c
(538): Initialized shared memory /var/log/apache2/mod_jk.shm.3484 size=448$
[Mon May 03 02:39:37 2010] [3484:1686849344] [debug]
do_shm_open_lock::jk_shm.c (412): Opened shared memory lock
/var/log/apache2/mod_jk.shm.3484.lock
[Mon May 03 02:39:37 2010] [3484:1686849344] [debug] jk_map_dump::jk_map.c
(589): Dump of map: 'ServerRoot' -> '/etc/apache2'
[Mon May 03 02:39:37 2010] [3484:1686849344] [debug] jk_map_dump::jk_map.c
(589): Dump of map: 'worker.list' -> 'tomcat1'
[Mon May 03 02:39:37 2010] [3484:1686849344] [debug] jk_map_dump::jk_map.c
(589): Dump of map: 'worker.tomcat1.type' -> 'ajp13'
[Mon May 03 02:39:37 2010] [3484:1686849344] [debug] jk_map_dump::jk_map.c
(589): Dump of map: 'worker.tomcat1.host' -> 'localhost'
[Mon May 03 02:39:37 2010] [3484:1686849344] [debug] jk_map_dump::jk_map.c
(589): Dump of map: 'worker.tomcat1.port' -> '8009'
[Mon May 03 02:39:37 2010] [3484:1686849344] [debug]
build_worker_map::jk_worker.c (242): creating worker tomcat1
[Mon May 03 02:39:37 2010] [3484:1686849344] [debug]
wc_create_worker::jk_worker.c (146): about to create instance tomcat1 of
ajp13
[Mon May 03 02:39:37 2010] [3484:1686849344] [debug]
wc_create_worker::jk_worker.c (159): about to validate and init tomcat1
[Mon May 03 02:39:37 2010] [3484:1686849344] [debug]
ajp_validate::jk_ajp_common.c (2512): worker tomcat1 contact is
'localhost:8009'
[Mon May 03 02:39:37 2010] [3484:1686849344] [debug]
ajp_init::jk_ajp_common.c (2699): setting endpoint options:
[Mon May 03 02:39:37 2010] [3484:1686849344] [debug]
ajp_init::jk_ajp_common.c (2702): keepalive:              0
[Mon May 03 02:39:37 2010] [3484:1686849344] [debug]
ajp_init::jk_ajp_common.c (2706): socket timeout:         0
[Mon May 03 02:39:37 2010] [3484:1686849344] [debug]
ajp_init::jk_ajp_common.c (2710): socket connect timeout: 0
[Mon May 03 02:39:37 2010] [3484:1686849344] [debug]
ajp_init::jk_ajp_common.c (2714): buffer size:            0
[Mon May 03 02:39:37 2010] [3484:1686849344] [debug]
ajp_init::jk_ajp_common.c (2718): pool timeout:           0
[Mon May 03 02:39:37 2010] [3484:1686849344] [debug]
ajp_init::jk_ajp_common.c (2722): ping timeout:           10000
[Mon May 03 02:39:37 2010] [3484:1686849344] [debug]
ajp_init::jk_ajp_common.c (2726): connect timeout:        0
[Mon May 03 02:39:37 2010] [3484:1686849344] [debug]
ajp_init::jk_ajp_common.c (2730): reply timeout:          0
[Mon May 03 02:39:37 2010] [3484:1686849344] [debug]
ajp_init::jk_ajp_common.c (2734): prepost timeout:        0
[Mon May 03 02:39:37 2010] [3484:1686849344] [debug]
ajp_init::jk_ajp_common.c (2738): recovery options:       0
[Mon May 03 02:39:37 2010] [3484:1686849344] [debug]
ajp_init::jk_ajp_common.c (2742): retries:                2
[Mon May 03 02:39:37 2010] [3484:1686849344] [debug]
ajp_init::jk_ajp_common.c (2746): max packet size:        8192
[Mon May 03 02:39:37 2010] [3484:1686849344] [debug]
ajp_init::jk_ajp_common.c (2750): retry interval:         100
[Mon May 03 02:39:37 2010] [3484:1686849344] [debug]
ajp_create_endpoint_cache::jk_ajp_common.c (2562): setting connection pool
size to 25 with min 1$
[Mon May 03 02:39:37 2010] [3484:1686849344] [info] init_jk::mod_jk.c
(3183): mod_jk/1.2.28 initialized
[Mon May 03 02:39:37 2010] [3484:1686849344] [debug]
uri_worker_map_dump::jk_uri_worker_map.c (171): uri map dump after extension
stripping: index=0 $
[Mon May 03 02:39:37 2010] [3484:1686849344] [debug]
uri_worker_map_dump::jk_uri_worker_map.c (176): generation 0: size=0
nosize=0 capacity=0
[Mon May 03 02:39:37 2010] [3484:1686849344] [debug]
uri_worker_map_dump::jk_uri_worker_map.c (176): generation 1: size=0
nosize=0 capacity=0
[Mon May 03 02:39:37 2010] [3484:1686849344] [debug]
uri_worker_map_switch::jk_uri_worker_map.c (482): Switching uri worker map
from index 0 to index$
[Mon May 03 02:39:37 2010] [3487:1686849344] [debug] do_shm_open::jk_shm.c
(550): Attached shared memory /var/log/apache2/mod_jk.shm.3484 [2] size=44$
[Mon May 03 02:39:37 2010] [3487:1686849344] [debug] do_shm_open::jk_shm.c
(564): Resetting the shared memory for child 2
[Mon May 03 02:39:37 2010] [3487:1686849344] [debug]
do_shm_open_lock::jk_shm.c (353): Duplicated shared memory lock
/var/log/apache2/mod_jk.shm.3484$
[Mon May 03 02:39:37 2010] [3487:1686849344] [debug] jk_child_init::mod_jk.c
(3068): Initialized mod_jk/1.2.28
[Mon May 03 02:39:37 2010] [3488:1686849344] [debug] do_shm_open::jk_shm.c
(550): Attached shared memory /var/log/apache2/mod_jk.shm.3484 [3] size=44$
[Mon May 03 02:39:37 2010] [3488:1686849344] [debug] do_shm_open::jk_shm.c
(564): Resetting the shared memory for child 3
[Mon May 03 02:39:37 2010] [3488:1686849344] [debug]
do_shm_open_lock::jk_shm.c (353): Duplicated shared memory lock
/var/log/apache2/mod_jk.shm.3484$
[Mon May 03 02:39:37 2010] [3488:1686849344] [debug] jk_child_init::mod_jk.c
(3068): Initialized mod_jk/1.2.28
[Mon May 03 02:39:41 2010] [3487:1547036432] [debug] jk_translate::mod_jk.c
(3419): missing uri map for Js-Server-Ubuntu.gateway.2wire.net:/examples/
[Mon May 03 02:39:41 2010] [3487:1547036432] [debug]
jk_map_to_storage::mod_jk.c (3579): missing uri map for
Js-Server-Ubuntu.gateway.2wire.net:/exam$

I remove the log and restart the server after changing the config.
This time round, the jk_uri_worker_map.c was not seen.
After <Location> tag, i move on to try <LocationMatch> tag. It produce the
same log message.
I insert the tag below the httpd.conf, hope is the correct location to place
it in.
Does your mod_jk log look the same? Mine look funny though.

Thanks and Best Regards
Jie Sheng


On Mon, May 3, 2010 at 12:42 AM, André Warnier <aw...@ice-sa.com> wrote:

> Hi.
>
> Jie Sheng Chua wrote:
>
>> Hi André and Juha,
>>
>>
>> I edit my tomcat server.xml as describe. my tomcat and apache listed that
>> the connector is started as in the log.
>> But when i access (http://192.168.1.68/examples/index.html) with IE, "The
>> webpage cannot be found" error is displayed.
>>
>
> Do yourself a favor, and in IE, in the settings, unclick the option for
> "use friendly error messages".
> This way, you will see the page really sent back by the server, and not the
> internal built-in IE "friendly" error page, which is useless.
>
>
>  When i access "http://192.168.1.68:8080/examples/index.html", the page
>> can
>> be display.
>>
>
> Ok. This means that at least Tomcat can find the page.
>
> Your Apache/mod_jk configuration also looks ok to me.
>
> ...
>
>
>>
>> -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>> *apache2: error.log*
>>
>>
>> [Sun May 02 23:02:33 2010] [notice] Apache/2.2.14 (Ubuntu) mod_jk/1.2.28
>> configured -- resuming normal operations
>> [Sun May 02 23:04:27 2010] [error] [client 192.168.1.66] File does not
>> exist: /var/www/examples
>>
>>
> The above can be 2 things :
> a) either Apache is not even trying to pass this request to mod_jk
> or
> b) Apache passes the request to mod_jk, but mod_jk returns the request to
> Apache with the code DECLINE.
> This would mean that mod_jk has examined the URL of the request, determined
> that it does not match any of its "JkMount", and decided this request is not
> for him and should be handled by Apache itself.
> Then Apache tries to find (himself) the requested document under its own
> DocumentRoot, and it fails, so it returns a 404 Not Found response.
>
> To find out more, increase the log level of mod_jk :
>
>
> > # Set the jk log level [debug/error/info]
> > JkLogLevel    info
> to
> JkLogLevel debug
>
> Then retry and look at /var/log/apache2/mod_jk.log.
> It will tell you, step by step, how it tries to match the request URL to
> one of its JkMount mappings.
>
> Or it will tell nothing, and in that case we are in case (a) above.
>
> One question : is does not look that way from the configuration you posted,
> but are you using VirtualHost(s) in Apache ?
> If yes, then make sure that your JkMount directives are in the VirtualHost
> configuration section, or lookup the "JkMountCopy" directive. (JkMount's are
> not automatically inherited by VirtualHost sections, from the main httpd
> section).
>
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>


-- 
Jie Sheng, Chua
(+65) 97520245
chuajiesheng@gmail.com

The contents of this email are confidential to the intended recipient and
may not be disclosed. Although it is believed that this email and any
attachments are virus free, it is the responsibility of the recipient to
confirm this.

Re: Tomcat Connector to Apache 2.2

Posted by André Warnier <aw...@ice-sa.com>.
David Smith wrote:
> Personally I highly recommend the Firebug plugin for Firefox to diagnose
> this stuff.  It does an amazing job of showing parameters, headers,
> responses, everything.
> 
In this case however, we know the request URL and we know the server 
response, so I don't think a browser-side plugin would tell us much.

In general though I agree, a tool like that is a must for debugging 
browser-server exchanges.
There are also, for Firefox, the LiveHttpHeaders and HttpFox plugins, 
and for IE, the Fiddler2 plugin.

My money so far is on the VirtualHost issue.


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


Re: Tomcat Connector to Apache 2.2

Posted by David Smith <da...@cornell.edu>.
Personally I highly recommend the Firebug plugin for Firefox to diagnose
this stuff.  It does an amazing job of showing parameters, headers,
responses, everything.

--David

On 5/2/2010 12:42 PM, André Warnier wrote:
> Hi.
>
> Jie Sheng Chua wrote:
>   
>> Hi André and Juha,
>>
>> I edit my tomcat server.xml as describe. my tomcat and apache listed that
>> the connector is started as in the log.
>> But when i access (http://192.168.1.68/examples/index.html) with IE, "The
>> webpage cannot be found" error is displayed.
>>     
> Do yourself a favor, and in IE, in the settings, unclick the option for 
> "use friendly error messages".
> This way, you will see the page really sent back by the server, and not 
> the internal built-in IE "friendly" error page, which is useless.
>
>   
>> When i access "http://192.168.1.68:8080/examples/index.html", the page can
>> be display.
>>     
> Ok. This means that at least Tomcat can find the page.
>
> Your Apache/mod_jk configuration also looks ok to me.
>
> ...
>
>   
>> -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>> *apache2: error.log*
>>
>> [Sun May 02 23:02:33 2010] [notice] Apache/2.2.14 (Ubuntu) mod_jk/1.2.28
>> configured -- resuming normal operations
>> [Sun May 02 23:04:27 2010] [error] [client 192.168.1.66] File does not
>> exist: /var/www/examples
>>
>>     
> The above can be 2 things :
> a) either Apache is not even trying to pass this request to mod_jk
> or
> b) Apache passes the request to mod_jk, but mod_jk returns the request 
> to Apache with the code DECLINE.
> This would mean that mod_jk has examined the URL of the request, 
> determined that it does not match any of its "JkMount", and decided this 
> request is not for him and should be handled by Apache itself.
> Then Apache tries to find (himself) the requested document under its own 
> DocumentRoot, and it fails, so it returns a 404 Not Found response.
>
> To find out more, increase the log level of mod_jk :
>
>  > # Set the jk log level [debug/error/info]
>  > JkLogLevel    info
> to
> JkLogLevel debug
>
> Then retry and look at /var/log/apache2/mod_jk.log.
> It will tell you, step by step, how it tries to match the request URL to 
> one of its JkMount mappings.
>
> Or it will tell nothing, and in that case we are in case (a) above.
>
> One question : is does not look that way from the configuration you 
> posted, but are you using VirtualHost(s) in Apache ?
> If yes, then make sure that your JkMount directives are in the 
> VirtualHost configuration section, or lookup the "JkMountCopy" 
> directive. (JkMount's are not automatically inherited by VirtualHost 
> sections, from the main httpd section).
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>   


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


Re: Tomcat Connector to Apache 2.2

Posted by André Warnier <aw...@ice-sa.com>.
Hi.

Jie Sheng Chua wrote:
> Hi André and Juha,
> 
> I edit my tomcat server.xml as describe. my tomcat and apache listed that
> the connector is started as in the log.
> But when i access (http://192.168.1.68/examples/index.html) with IE, "The
> webpage cannot be found" error is displayed.

Do yourself a favor, and in IE, in the settings, unclick the option for 
"use friendly error messages".
This way, you will see the page really sent back by the server, and not 
the internal built-in IE "friendly" error page, which is useless.

> When i access "http://192.168.1.68:8080/examples/index.html", the page can
> be display.

Ok. This means that at least Tomcat can find the page.

Your Apache/mod_jk configuration also looks ok to me.

...

> 
> -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
> *apache2: error.log*
> 
> [Sun May 02 23:02:33 2010] [notice] Apache/2.2.14 (Ubuntu) mod_jk/1.2.28
> configured -- resuming normal operations
> [Sun May 02 23:04:27 2010] [error] [client 192.168.1.66] File does not
> exist: /var/www/examples
>

The above can be 2 things :
a) either Apache is not even trying to pass this request to mod_jk
or
b) Apache passes the request to mod_jk, but mod_jk returns the request 
to Apache with the code DECLINE.
This would mean that mod_jk has examined the URL of the request, 
determined that it does not match any of its "JkMount", and decided this 
request is not for him and should be handled by Apache itself.
Then Apache tries to find (himself) the requested document under its own 
DocumentRoot, and it fails, so it returns a 404 Not Found response.

To find out more, increase the log level of mod_jk :

 > # Set the jk log level [debug/error/info]
 > JkLogLevel    info
to
JkLogLevel debug

Then retry and look at /var/log/apache2/mod_jk.log.
It will tell you, step by step, how it tries to match the request URL to 
one of its JkMount mappings.

Or it will tell nothing, and in that case we are in case (a) above.

One question : is does not look that way from the configuration you 
posted, but are you using VirtualHost(s) in Apache ?
If yes, then make sure that your JkMount directives are in the 
VirtualHost configuration section, or lookup the "JkMountCopy" 
directive. (JkMount's are not automatically inherited by VirtualHost 
sections, from the main httpd section).





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


Re: Tomcat Connector to Apache 2.2

Posted by Jie Sheng Chua <ch...@gmail.com>.
Hi André and Juha,

I edit my tomcat server.xml as describe. my tomcat and apache listed that
the connector is started as in the log.
But when i access (http://192.168.1.68/examples/index.html) with IE, "The
webpage cannot be found" error is displayed.
When i access "http://192.168.1.68:8080/examples/index.html", the page can
be display.
This tally with the error apache display in the log "error.log". But in the
same log it says that mod_jk configured and resuming normal operation.
There is a "Jk running ID=0 time=0/18  config=null" message when tomcat
start. I don't really understand what it is.
Hope to hear from you soon.
Log and config as below.

Thanks and Best Regard
Jie Sheng

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
*apache2: error.log*

[Sun May 02 23:02:33 2010] [notice] Apache/2.2.14 (Ubuntu) mod_jk/1.2.28
configured -- resuming normal operations
[Sun May 02 23:04:27 2010] [error] [client 192.168.1.66] File does not
exist: /var/www/examples

*apache2: access.log*

192.168.1.66 - - [02/May/2010:23:04:27 +0800] "GET /examples/index.html
HTTP/1.1" 404 510 "-" "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1;
Tri$

*apache2: mod_jk.log*

[Sun May 02 23:02:33 2010] [1593:4161124160] [info] init_jk::mod_jk.c
(3183): mod_jk/1.2.28 initialized
[Sun May 02 23:02:33 2010] [1594:4161124160] [info] init_jk::mod_jk.c
(3183): mod_jk/1.2.28 initialized

*tomcat6: catalina.out*

May 2, 2010 11:02:19 PM org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal
performance in production environments was not found on the
java.library.path: $
May 2, 2010 11:02:19 PM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
May 2, 2010 11:02:19 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 605 ms
May 2, 2010 11:02:20 PM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
May 2, 2010 11:02:20 PM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.24
May 2, 2010 11:02:20 PM org.apache.catalina.startup.HostConfig
deployDescriptor
INFO: Deploying configuration descriptor manager.xml
May 2, 2010 11:02:20 PM org.apache.catalina.startup.HostConfig
deployDescriptor
INFO: Deploying configuration descriptor examples.xml
May 2, 2010 11:02:20 PM org.apache.catalina.startup.HostConfig
deployDescriptor
INFO: Deploying configuration descriptor ROOT.xml
May 2, 2010 11:02:20 PM org.apache.catalina.startup.HostConfig
deployDescriptor
INFO: Deploying configuration descriptor host-manager.xml
May 2, 2010 11:02:20 PM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
May 2, 2010 11:02:20 PM org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
*May 2, 2010 11:02:20 PM org.apache.jk.server.JkMain start*
*INFO: Jk running ID=0 time=0/18  config=null*
May 2, 2010 11:02:20 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 571 ms

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

*apache2: workers.properties*

# Define 1 real worker using ajp13
worker.list=tomcat1

# Set properties for worker1 (ajp13)
worker.tomcat1.type=ajp13
worker.tomcat1.host=localhost
worker.tomcat1.port=8009

*apache2: httpd.conf*

# Load mod_jk module
# Update this path to match your modules location
LoadModule    jk_module  /usr/lib/apache2/modules/mod_jk.so

# Declare the module for <IfModule directive> (remove this line on Apache
2.x)
# AddModule     mod_jk.c

# Where to find workers.properties
# Update this path to match your conf directory location (put
workers.properties next to httpd.conf)
JkWorkersFile /etc/apache2/workers.properties

# Where to put jk shared memory
# Update this path to match your local state directory or logs directory
JkShmFile     /var/log/apache2/mod_jk.shm

# Where to put jk logs
# Update this path to match your logs directory location (put mod_jk.log
next to access_log)
JkLogFile     /var/log/apache2/mod_jk.log

# Set the jk log level [debug/error/info]
JkLogLevel    info

# Select the timestamp log format
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "

# Send everything for context /examples to worker named worker1 (ajp13)
JkMount  /examples/* tomcat1
JkMount  /examples tomcat1

*tomcat6: server.xml*

<?xml version='1.0' encoding='utf-8'?>

<Server port="8005" shutdown="SHUTDOWN">

  <Listener className="org.apache.catalina.core.JasperListener" />
  <Listener
className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
  <Listener className="org.apache.catalina.mbeans.ServerLifecycleListener"
/>
  <Listener
className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />

  <GlobalNamingResources>

    <Resource name="UserDatabase" auth="Container"
              type="org.apache.catalina.UserDatabase"
              description="User database that can be updated and saved"
              factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
              pathname="conf/tomcat-users.xml" />
  </GlobalNamingResources>

  <Service name="Catalina">

    <Connector port="8080" protocol="HTTP/1.1"
               connectionTimeout="20000"
               URIEncoding="UTF-8"
               redirectPort="8443" />

    <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />

    <Engine name="Catalina" defaultHost="localhost">

      <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
             resourceName="UserDatabase"/>
      <Host name="localhost"  appBase="webapps"
            unpackWARs="true" autoDeploy="true"
            xmlValidation="false" xmlNamespaceAware="false">
      </Host>
    </Engine>
  </Service>
</Server>

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

On Sun, May 2, 2010 at 6:14 PM, André Warnier <aw...@ice-sa.com> wrote:

> Jie Sheng Chua wrote:
>
>> Hi,
>>
>> I operating Ubuntu 10.04 with Tomcat 6.0.24 on OpenJDK 6b18-1.8.
>> I trying to configure tomcat connector to allow (for now) all request to
>> be
>> pass from Apache 2.2 to Tomcat 6.
>> I downloaded mod_jk-1.2.28-httpd-2.2.X.so<
>> http://www.apache.org/dist/tomcat/tomcat-connectors/jk/binaries/linux/jk-1.2.28/x86_64/mod_jk-1.2.28-httpd-2.2.X.so
>> >
>>
>> .
>> With the help of the quick start
>> guide<http://tomcat.apache.org/connectors-doc/generic_howto/quick.html>,
>> i manage to configure my workers.properties, httpd.conf and tomcat
>> server.xml as follows.
>>
>> After the below configuration, the connector didn't work. There are no
>> error
>> display on the logs too.
>>
>
> Can you define "didn't work" ?
>
>
>  Example context from tomcat is the tomcat supplied examples.
>>
>> Does anyone know how to make this work out?
>>
>> Thanks and Best Regards
>> Jie Sheng
>>
>> *workers.properties*
>> *
>> *
>> *
>> # Define 1 real worker using ajp13
>> worker.list=tomcat1
>>
>> # Set properties for worker1 (ajp13)
>> worker.tomcat1.type=ajp13
>> worker.tomcat1.host=localhost
>> worker.tomcat1.port=8009
>> *
>>
>>
> Looks fine.
>
>
>  *httpd.conf*
>>
>>
>> # Load mod_jk module
>> # Update this path to match your modules location
>> LoadModule    jk_module  /usr/lib/apache2/modules/mod_jk.so
>>
>>
> Looks fine, if the module is there.  But otherwise I guess Apache would not
> start.
>
>
>
>  # Declare the module for <IfModule directive> (remove this line on Apache
>> 2.x)
>> # AddModule     mod_jk.c
>>
>> # Where to find workers.properties
>> # Update this path to match your conf directory location (put
>> workers.properties next to httpd.conf)
>> JkWorkersFile /etc/apache2/workers.properties
>>
>> # Where to put jk shared memory
>> # Update this path to match your local state directory or logs directory
>> JkShmFile     /var/log/apache2/mod_jk.shm
>>
>> # Where to put jk logs
>> # Update this path to match your logs directory location (put mod_jk.log
>> next to access_log)
>> JkLogFile     /var/log/apache2/mod_jk.log
>>
>> # Set the jk log level [debug/error/info]
>> JkLogLevel    info
>>
>> # Select the timestamp log format
>> JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
>>
>> # Send everything for context /examples to worker named worker1 (ajp13)
>> JkMount  /examples/* tomcat1
>>
>>
> Note that the above will ONLY forward to the connector and Tomcat, requests
> for URLs which match the above pattern, like
> /examples/something.html
> It will not forward the URL
> /examples
> For that, you would need a second JkMount
> JkMount  /examples  tomcat1
>
> Also see note (1) below.
>
>  *tomcat server.xml*
>>
>> *
>> *
>> *
>> <?xml version='1.0' encoding='utf-8'?>
>> <Server port="8005" shutdown="SHUTDOWN">
>>  <Listener className="org.apache.catalina.core.AprLifecycleListener"
>> SSLEngine="on" />
>>  <Listener className="org.apache.catalina.core.JasperListener" />
>>  <Listener
>> className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
>>  <Listener className="org.apache.catalina.mbeans.ServerLifecycleListener"
>> />
>>  <Listener
>> className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
>>
>
> I believe your problem is here :
>
>
>   <Listener className="org.apache.jk.config.ApacheConfig"
>> modJk="/usr/lib/apache2/modules/mod_jk.so" />
>>
>>
> Remove the above and try again.
>
> I believe that you tried to mix two different techniques :
> - trying to use the "Tomcat auto-configure" feature of mod_jk
> and
> - configuring mod_jk yourself
>
> I think that the two do not play well together.
> And anyway :
> - I am not sure that the auto-configure feature still works
> - the documentation also says that it is specific to Tomcat 5.x
>
>
>
>   <GlobalNamingResources>
>>    <Resource name="UserDatabase" auth="Container"
>>              type="org.apache.catalina.UserDatabase"
>>              description="User database that can be updated and saved"
>>              factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
>>              pathname="conf/tomcat-users.xml" />
>>  </GlobalNamingResources>
>>
>>  <Service name="Catalina">
>>    <Executor name="tomcatThreadPool" namePrefix="catalina-exec-"
>>        maxThreads="150" minSpareThreads="4"/>
>>    <Connector port="8080" protocol="HTTP/1.1"
>>               connectionTimeout="20000"
>>               URIEncoding="UTF-8"
>>               redirectPort="8443" />
>>
>
>
>     <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />
>>
>
> The above is OK, leave it.
>
>
>     <Engine name="Catalina" defaultHost="localhost">
>>      <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
>>             resourceName="UserDatabase"/>
>>      <Host name="localhost"  appBase="webapps"
>>            unpackWARs="true" autoDeploy="true"
>>            xmlValidation="false" xmlNamespaceAware="false">
>>      </Host>
>>    </Engine>
>>  </Service>
>> </Server>
>>
>> *
>>
>>
>
> Note (1) :
> As an alternative to the JkMount/JkUnMount directives, there also exists
> the following (in the Apache httpd.conf) :
>
> <Location /examples>
>  SetHandler jakarta-servlet
>  ...
>
> </Location>
>
> (You can also use <LocationMatch> instead of <Location>)
>
> This is described here :
> http://tomcat.apache.org/connectors-doc/reference/apache.html
> , at the very end of the page, in the section "Using SetHandler and
> Environment Variables".
> Using this or the JkMount/JkUnMount syntax is a question of personal
> preference. I prefer this second form, because I find that it matches the
> general Apache configuration style better.  It also makes it easier to add
> additional Apache directives to be applied to the URLs which you forward to
> Tomcat.
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>


-- 
Jie Sheng, Chua
(+65) 97520245
chuajiesheng@gmail.com

The contents of this email are confidential to the intended recipient and
may not be disclosed. Although it is believed that this email and any
attachments are virus free, it is the responsibility of the recipient to
confirm this.

Re: Tomcat Connector to Apache 2.2

Posted by André Warnier <aw...@ice-sa.com>.
Jie Sheng Chua wrote:
> Hi,
> 
> I operating Ubuntu 10.04 with Tomcat 6.0.24 on OpenJDK 6b18-1.8.
> I trying to configure tomcat connector to allow (for now) all request to be
> pass from Apache 2.2 to Tomcat 6.
> I downloaded mod_jk-1.2.28-httpd-2.2.X.so<http://www.apache.org/dist/tomcat/tomcat-connectors/jk/binaries/linux/jk-1.2.28/x86_64/mod_jk-1.2.28-httpd-2.2.X.so>
> .
> With the help of the quick start
> guide<http://tomcat.apache.org/connectors-doc/generic_howto/quick.html>,
> i manage to configure my workers.properties, httpd.conf and tomcat
> server.xml as follows.
> 
> After the below configuration, the connector didn't work. There are no error
> display on the logs too.

Can you define "didn't work" ?


> Example context from tomcat is the tomcat supplied examples.
> 
> Does anyone know how to make this work out?
> 
> Thanks and Best Regards
> Jie Sheng
> 
> *workers.properties*
> *
> *
> *
> # Define 1 real worker using ajp13
> worker.list=tomcat1
> 
> # Set properties for worker1 (ajp13)
> worker.tomcat1.type=ajp13
> worker.tomcat1.host=localhost
> worker.tomcat1.port=8009
> *
> 

Looks fine.


> *httpd.conf*
> 
> # Load mod_jk module
> # Update this path to match your modules location
> LoadModule    jk_module  /usr/lib/apache2/modules/mod_jk.so
> 

Looks fine, if the module is there.  But otherwise I guess Apache would 
not start.


> # Declare the module for <IfModule directive> (remove this line on Apache
> 2.x)
> # AddModule     mod_jk.c
> 
> # Where to find workers.properties
> # Update this path to match your conf directory location (put
> workers.properties next to httpd.conf)
> JkWorkersFile /etc/apache2/workers.properties
> 
> # Where to put jk shared memory
> # Update this path to match your local state directory or logs directory
> JkShmFile     /var/log/apache2/mod_jk.shm
> 
> # Where to put jk logs
> # Update this path to match your logs directory location (put mod_jk.log
> next to access_log)
> JkLogFile     /var/log/apache2/mod_jk.log
> 
> # Set the jk log level [debug/error/info]
> JkLogLevel    info
> 
> # Select the timestamp log format
> JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
> 
> # Send everything for context /examples to worker named worker1 (ajp13)
> JkMount  /examples/* tomcat1
> 

Note that the above will ONLY forward to the connector and Tomcat, 
requests for URLs which match the above pattern, like
/examples/something.html
It will not forward the URL
/examples
For that, you would need a second JkMount
JkMount  /examples  tomcat1

Also see note (1) below.

> *tomcat server.xml*
> *
> *
> *
> <?xml version='1.0' encoding='utf-8'?>
> <Server port="8005" shutdown="SHUTDOWN">
>   <Listener className="org.apache.catalina.core.AprLifecycleListener"
> SSLEngine="on" />
>   <Listener className="org.apache.catalina.core.JasperListener" />
>   <Listener
> className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
>   <Listener className="org.apache.catalina.mbeans.ServerLifecycleListener"
> />
>   <Listener
> className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />

I believe your problem is here :

>   <Listener className="org.apache.jk.config.ApacheConfig"
> modJk="/usr/lib/apache2/modules/mod_jk.so" />
> 

Remove the above and try again.

I believe that you tried to mix two different techniques :
- trying to use the "Tomcat auto-configure" feature of mod_jk
and
- configuring mod_jk yourself

I think that the two do not play well together.
And anyway :
- I am not sure that the auto-configure feature still works
- the documentation also says that it is specific to Tomcat 5.x


>   <GlobalNamingResources>
>     <Resource name="UserDatabase" auth="Container"
>               type="org.apache.catalina.UserDatabase"
>               description="User database that can be updated and saved"
>               factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
>               pathname="conf/tomcat-users.xml" />
>   </GlobalNamingResources>
> 
>   <Service name="Catalina">
>     <Executor name="tomcatThreadPool" namePrefix="catalina-exec-"
>         maxThreads="150" minSpareThreads="4"/>
>     <Connector port="8080" protocol="HTTP/1.1"
>                connectionTimeout="20000"
>                URIEncoding="UTF-8"
>                redirectPort="8443" />


>     <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />

The above is OK, leave it.


>     <Engine name="Catalina" defaultHost="localhost">
>       <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
>              resourceName="UserDatabase"/>
>       <Host name="localhost"  appBase="webapps"
>             unpackWARs="true" autoDeploy="true"
>             xmlValidation="false" xmlNamespaceAware="false">
>       </Host>
>     </Engine>
>   </Service>
> </Server>
> 
> *
> 


Note (1) :
As an alternative to the JkMount/JkUnMount directives, there also exists 
the following (in the Apache httpd.conf) :

<Location /examples>
   SetHandler jakarta-servlet
   ...

</Location>

(You can also use <LocationMatch> instead of <Location>)

This is described here :
http://tomcat.apache.org/connectors-doc/reference/apache.html
, at the very end of the page, in the section "Using SetHandler and 
Environment Variables".
Using this or the JkMount/JkUnMount syntax is a question of personal 
preference. I prefer this second form, because I find that it matches 
the general Apache configuration style better.  It also makes it easier 
to add additional Apache directives to be applied to the URLs which you 
forward to Tomcat.



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


Re: Tomcat Connector to Apache 2.2

Posted by Juha Laiho <Ju...@iki.fi>.
Please clarify "does not work":
- after running the servers with the described configuration,
   what did you attempt to access?
- what was the response on the browser?
-- if using IE, do disable the "Show friendly HTTP error messages" in
    Internet Options/Advanced to see real server error messages
- what was logged of the access
-- in Apache httpd access_log, error_log?
-- in Tomcat logs?
-- in mod_jk log?

-- 
..Juha

On 1.5.2010 19:06, Jie Sheng Chua wrote:
> Hi,
>
> I operating Ubuntu 10.04 with Tomcat 6.0.24 on OpenJDK 6b18-1.8.
> I trying to configure tomcat connector to allow (for now) all request to be
> pass from Apache 2.2 to Tomcat 6.
> I downloaded mod_jk-1.2.28-httpd-2.2.X.so<http://www.apache.org/dist/tomcat/tomcat-connectors/jk/binaries/linux/jk-1.2.28/x86_64/mod_jk-1.2.28-httpd-2.2.X.so>
> .
> With the help of the quick start
> guide<http://tomcat.apache.org/connectors-doc/generic_howto/quick.html>,
> i manage to configure my workers.properties, httpd.conf and tomcat
> server.xml as follows.
>
> After the below configuration, the connector didn't work. There are no error
> display on the logs too.
> Example context from tomcat is the tomcat supplied examples.
>
> Does anyone know how to make this work out?
>
> Thanks and Best Regards
> Jie Sheng
>
> *workers.properties*
> *
> *
> *
> # Define 1 real worker using ajp13
> worker.list=tomcat1
>
> # Set properties for worker1 (ajp13)
> worker.tomcat1.type=ajp13
> worker.tomcat1.host=localhost
> worker.tomcat1.port=8009
> *
>
> *httpd.conf*
>
> # Load mod_jk module
> # Update this path to match your modules location
> LoadModule    jk_module  /usr/lib/apache2/modules/mod_jk.so
>
> # Declare the module for<IfModule directive>  (remove this line on Apache
> 2.x)
> # AddModule     mod_jk.c
>
> # Where to find workers.properties
> # Update this path to match your conf directory location (put
> workers.properties next to httpd.conf)
> JkWorkersFile /etc/apache2/workers.properties
>
> # Where to put jk shared memory
> # Update this path to match your local state directory or logs directory
> JkShmFile     /var/log/apache2/mod_jk.shm
>
> # Where to put jk logs
> # Update this path to match your logs directory location (put mod_jk.log
> next to access_log)
> JkLogFile     /var/log/apache2/mod_jk.log
>
> # Set the jk log level [debug/error/info]
> JkLogLevel    info
>
> # Select the timestamp log format
> JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
>
> # Send everything for context /examples to worker named worker1 (ajp13)
> JkMount  /examples/* tomcat1
>
> *tomcat server.xml*
> *
> *
> *
> <?xml version='1.0' encoding='utf-8'?>
> <Server port="8005" shutdown="SHUTDOWN">
>    <Listener className="org.apache.catalina.core.AprLifecycleListener"
> SSLEngine="on" />
>    <Listener className="org.apache.catalina.core.JasperListener" />
>    <Listener
> className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
>    <Listener className="org.apache.catalina.mbeans.ServerLifecycleListener"
> />
>    <Listener
> className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
>    <Listener className="org.apache.jk.config.ApacheConfig"
> modJk="/usr/lib/apache2/modules/mod_jk.so" />
>
>    <GlobalNamingResources>
>      <Resource name="UserDatabase" auth="Container"
>                type="org.apache.catalina.UserDatabase"
>                description="User database that can be updated and saved"
>                factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
>                pathname="conf/tomcat-users.xml" />
>    </GlobalNamingResources>
>
>    <Service name="Catalina">
>      <Executor name="tomcatThreadPool" namePrefix="catalina-exec-"
>          maxThreads="150" minSpareThreads="4"/>
>      <Connector port="8080" protocol="HTTP/1.1"
>                 connectionTimeout="20000"
>                 URIEncoding="UTF-8"
>                 redirectPort="8443" />
>      <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />
>      <Engine name="Catalina" defaultHost="localhost">
>        <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
>               resourceName="UserDatabase"/>
>        <Host name="localhost"  appBase="webapps"
>              unpackWARs="true" autoDeploy="true"
>              xmlValidation="false" xmlNamespaceAware="false">
>        </Host>
>      </Engine>
>    </Service>
> </Server>
>
> *
>


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