Hi Chris,

Christopher Schultz wrote:
Strange... it looks like mod_jk is initializing itself more than once. I
even tried the binary available online for Apache httpd 2.2.4 (2.2.6
wasn't available), and it appears to be giving me the same results.

I would guess: the redundant log lines come from virtual servers. Most of mod_jk Apache httpd configuration is now well-behaved w.r.t. virtual servers, i.e. you can configure most items differently for each vhost. For example log file, JkOptions etc. Some exceptions exist, like JkWorkersFile or JkShmFile.

JkMount is not inherited automatically. I forgot, if they were for httpd 1.3 and maybe around JK 1.2.15 for httpd 2.x. If you don't want to copy the JkMounts to each VHost and instead want to inherit them from a less special VHost to a more special vhost, you need to set JkMountCopy.

Page

http://tomcat.apache.org/connectors-doc/reference/apache.html

says about JkMountCopy:

===
If this directive is set to On in some virtual server, the mounts from the global server will be copied to the virtual server, more precisely all mounts defined by JkMount or JkUnMount. The Mounts defined by JkMountFile and JkAutoAlias will only be inherited, if the VirtualHost does not define it's own JkMountFile or JkAutoAlias.
This directive is only allowed inside VirtualHost.
The default is Off.
===

The fact, that mounts are VHost-specific also has another consequence (unfortunately): the requests to the status worker are run in the context of the VHost that handles the request. The status worker can then only see the mounts defined for this vhost and show them on the results page.

So if you have different vhosts and want to check, which mounts are active in which vhost, you can define a status worker and call the url of the status worker in each vhost.

Just to add more information, I'm running Apache httpd 2.2.6 with no
options set for the MPM that I know of, and I can see multiple httpd
processes when I run 'ps', so I'd imagine that I'm using the prefork MPM.

You can find out about your MPM via "httpd -V". It contains the name of the MPM in one of the first lines of the output.

Concerning 2.0 vs. 2.2: yes, the binary build is different, but the module code is the same, because the2.0 and 2.2 APIs are very close. That's the reson, the build result is in the apache-2.0 directory and we don't have an apache-2.2 directory.

Concerning the workers config:

worker.worker3.connection_pool_size=1

Don't do that unless you are totally convinced you really want it :)

Concerning double log lines:

There are several aspects about "double". First during Apache httpd startup in fact initialization is done twice. This is standard and has nothing to do with mod_jk. In your appended log file this relates to a block of log lines contained process and thread ids [4723:3081406128] and after that the same log lines for [4724:3081406128].

The unusual thing is, that during each of the two passes, again lines are logged multiple times. Some if this is OK, because of the assumed vhost situation. Some of those are a little strange:

For example

[Tue Sep 18 11:05:24.002 2007] [4723:3081406128] [debug]
open_jklog::mod_jk.c (2652): log time stamp format is '[%a %b %d %H:%M:%S.%Q %Y] '

should only appear once for each different jk log file (JkLogFile).

So all in all something might be strange about the vhosts and the JK configuration. Could you post all Jk relevant configuration directives an their surrounding vhost structure?

Another thing: there is a non-debug startup message

[Tue Sep 18 11:05:24.003 2007] [4723:3081406128] [error]
init_jk::mod_jk.c (2732): Initializing
shm:/usr/lib/apache2/logs/jk-runtime-status.4723 errno=2. Load balancing
workers will not function properly.

I don't know what erno 2 is on your platform (btw: what's your platform), but most likely it's "No such file or directory". Ommit the "shm:" prefix and make sure the directory exists and is writable.

Below is the complete mod_jk log file I get when I start up Apache httpd
and do nothing else. This is the log output I get with the first
(failed) request:

[Tue Sep 18 11:08:37.316 2007] [4727:3081406128] [debug]
map_uri_to_worker::jk_uri_worker_map.c (597): Attempting to map URI
'/diagnosis/index.do' from 0 maps
[Tue Sep 18 11:08:37.316 2007] [4727:3081406128] [debug]
map_uri_to_worker::jk_uri_worker_map.c (597): Attempting to map URI
'/diagnosis/index.do' from 0 maps

I'm a little nervous about this child initialization after the request handling (new process). Just to make sure: there are no erros in the apache error log and no signs of core dumps? After the above lines get logged, the process which handled the request (pid 4727) still exists?

[Tue Sep 18 11:08:38.017 2007] [4741:3081406128] [debug]
jk_child_init::mod_jk.c (2682): Attached
shm:/usr/lib/apache2/logs/jk-runtime-status.4724
[Tue Sep 18 11:08:38.017 2007] [4741:3081406128] [debug]
jk_child_init::mod_jk.c (2692): Initialized mod_jk/1.2.25

Any help would be greatly appreciated!

Thanks,
- -chris

=========================================

So, here's the startup log file:

* apologies for any word-wrapping
* all workers are configured similarly
  (workerN maps to localhost:8N80 with similar options)

[Tue Sep 18 11:05:24.002 2007] [4723:3081406128] [debug]
open_jklog::mod_jk.c (2652): log time stamp format is '[%a %b %d
%H:%M:%S.%Q %Y] '

This vhost has no JkMounts:

[Tue Sep 18 11:05:24.002 2007] [4723:3081406128] [debug]
uri_worker_map_open::jk_uri_worker_map.c (423): rule map size is 0

The next one is strange. It should only appear for a new log file, but we find it in the same log file.

[Tue Sep 18 11:05:24.003 2007] [4723:3081406128] [debug]
open_jklog::mod_jk.c (2652): log time stamp format is '[%a %b %d
%H:%M:%S.%Q %Y] '
[Tue Sep 18 11:05:24.003 2007] [4723:3081406128] [debug]

This vhost has 23 JkMounts:

uri_worker_map_open::jk_uri_worker_map.c (423): rule map size is 23
[Tue Sep 18 11:05:24.003 2007] [4723:3081406128] [debug]
uri_worker_map_add::jk_uri_worker_map.c (364): wildchar rule
'/dsm/*.jsp=worker4' source 'JkMount' was added
[Tue Sep 18 11:05:24.003 2007] [4723:3081406128] [debug]
uri_worker_map_add::jk_uri_worker_map.c (372): exact rule
'/dsm/authenticate/j_security_check=worker4' source 'JkMount' was added
[Tue Sep 18 11:05:24.003 2007] [4723:3081406128] [debug]
uri_worker_map_add::jk_uri_worker_map.c (372): exact rule
'/dsm/j_security_check=worker4' source 'JkMount' was added
[Tue Sep 18 11:05:24.003 2007] [4723:3081406128] [debug]
uri_worker_map_add::jk_uri_worker_map.c (372): exact rule
'/diagnosis/doctor/report/overview.html=worker5' source 'JkMount' was added
[Tue Sep 18 11:05:24.003 2007] [4723:3081406128] [debug]
uri_worker_map_add::jk_uri_worker_map.c (372): exact rule
'/diagnosis/doctor/report/details.html=worker5' source 'JkMount' was added
[Tue Sep 18 11:05:24.003 2007] [4723:3081406128] [debug]
uri_worker_map_add::jk_uri_worker_map.c (372): exact rule
'/diagnosis/doctor/report/bare_details.html=worker5' source 'JkMount'
was added
[Tue Sep 18 11:05:24.003 2007] [4723:3081406128] [debug]
uri_worker_map_add::jk_uri_worker_map.c (372): exact rule
'/diagnosis/doctor/report/physical.html=worker5' source 'JkMount' was added
[Tue Sep 18 11:05:24.003 2007] [4723:3081406128] [debug]
uri_worker_map_add::jk_uri_worker_map.c (372): exact rule
'/diagnosis/doctor/report/plan.html=worker5' source 'JkMount' was added
[Tue Sep 18 11:05:24.003 2007] [4723:3081406128] [debug]
uri_worker_map_add::jk_uri_worker_map.c (372): exact rule
'/diagnosis/doctor/report/full.html=worker5' source 'JkMount' was added
[Tue Sep 18 11:05:24.003 2007] [4723:3081406128] [debug]
uri_worker_map_add::jk_uri_worker_map.c (372): exact rule
'/diagnosis/doctor/report/report.pdf=worker5' source 'JkMount' was added
[Tue Sep 18 11:05:24.003 2007] [4723:3081406128] [debug]
uri_worker_map_add::jk_uri_worker_map.c (372): exact rule
'/diagnosis/doctor/showClinicianWorksheet.do=worker5' source 'JkMount'
was added
[Tue Sep 18 11:05:24.003 2007] [4723:3081406128] [debug]
uri_worker_map_add::jk_uri_worker_map.c (372): exact rule
'/diagnosis/doctor/report/resources/browse.html=worker5' source
'JkMount' was added
[Tue Sep 18 11:05:24.003 2007] [4723:3081406128] [debug]
uri_worker_map_add::jk_uri_worker_map.c (372): exact rule
'/diagnosis/doctor/report/resources/search.html=worker5' source
'JkMount' was added
[Tue Sep 18 11:05:24.003 2007] [4723:3081406128] [debug]
uri_worker_map_add::jk_uri_worker_map.c (372): exact rule
'/diagnosis/doctor/report/resources/list.html=worker5' source 'JkMount'
was added
[Tue Sep 18 11:05:24.003 2007] [4723:3081406128] [debug]
uri_worker_map_add::jk_uri_worker_map.c (372): exact rule
'/diagnosis/doctor/report/resources/details.html=worker5' source
'JkMount' was added
[Tue Sep 18 11:05:24.003 2007] [4723:3081406128] [debug]
uri_worker_map_add::jk_uri_worker_map.c (372): exact rule
'/diagnosis/doctor/report/resources/printable.html=worker5' source
'JkMount' was added
[Tue Sep 18 11:05:24.003 2007] [4723:3081406128] [debug]
uri_worker_map_add::jk_uri_worker_map.c (372): exact rule
'/diagnosis/doctor/report/resources/dtw.html=worker5' source 'JkMount'
was added
[Tue Sep 18 11:05:24.003 2007] [4723:3081406128] [debug]
uri_worker_map_add::jk_uri_worker_map.c (364): wildchar rule
'/diagnosis/*.do=worker3' source 'JkMount' was added
[Tue Sep 18 11:05:24.003 2007] [4723:3081406128] [debug]
uri_worker_map_add::jk_uri_worker_map.c (372): exact rule
'/diagnosis/j_security_check=worker3' source 'JkMount' was added
[Tue Sep 18 11:05:24.003 2007] [4723:3081406128] [debug]
uri_worker_map_add::jk_uri_worker_map.c (364): wildchar rule
'/diagnosis/*.jsp=worker3' source 'JkMount' was added
[Tue Sep 18 11:05:24.003 2007] [4723:3081406128] [debug]
uri_worker_map_add::jk_uri_worker_map.c (372): exact rule
'/diagnosis/servlet/dxtree=worker3' source 'JkMount' was added
[Tue Sep 18 11:05:24.003 2007] [4723:3081406128] [debug]
uri_worker_map_add::jk_uri_worker_map.c (372): exact rule
'/diagnosis/provision=worker3' source 'JkMount' was added
[Tue Sep 18 11:05:24.003 2007] [4723:3081406128] [debug]
uri_worker_map_add::jk_uri_worker_map.c (364): wildchar rule
'/diagnosis/staff/questionnaire/*=worker3' source 'JkMount' was added

Whops, and yet another log file/vhost?

[Tue Sep 18 11:05:24.003 2007] [4723:3081406128] [debug]
open_jklog::mod_jk.c (2652): log time stamp format is '[%a %b %d
%H:%M:%S.%Q %Y] '

That one again has no JkMounts:

[Tue Sep 18 11:05:24.003 2007] [4723:3081406128] [debug]
uri_worker_map_open::jk_uri_worker_map.c (423): rule map size is 0

And now for the global initialization ...

[Tue Sep 18 11:05:24.003 2007] [4723:3081406128] [error]
init_jk::mod_jk.c (2732): Initializing
shm:/usr/lib/apache2/logs/jk-runtime-status.4723 errno=2. Load balancing
workers will not function properly.

Aha, looks like it's a prefork MPM:

[Tue Sep 18 11:05:24.003 2007] [4723:3081406128] [debug]
init_jk::mod_jk.c (2743): Setting default connection pool max size to 1

The properties to here until ===END=== have no builtin meaing for JK. If you don't use them as variables, delete them. Most of them had some meaning a long time ago (in the context of embedded tomcat)

[Tue Sep 18 11:05:24.003 2007] [4723:3081406128] [debug]
jk_map_read_property::jk_map.c (495): Adding property
'workers.apache_log' with value '/var/log/apache2/mod_jk.log' to map.
[Tue Sep 18 11:05:24.004 2007] [4723:3081406128] [debug]
jk_map_read_property::jk_map.c (495): Adding property
'workers.tomcat_home' with value '/usr/local/tomcat/' to map.
[Tue Sep 18 11:05:24.004 2007] [4723:3081406128] [debug]
jk_map_read_property::jk_map.c (495): Adding property
'workers.java_home' with value '/usr/local/java/' to map.
[Tue Sep 18 11:05:24.004 2007] [4723:3081406128] [debug]
jk_map_read_property::jk_map.c (495): Adding property 'ps' with value
'/' to map.

=== END ===

So it seems, there are 2 vhosts and the global server, and only one of the three has JkMounts. Maybe your requests goit handled by the global server or the other vhost?

Regards,

Rainer

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to