Going to infinity+1:
I would guess: the redundant log lines come from virtual servers.
Okay. I don't believe I have more than one virtual server, so I would
have expected maybe a maximum of two "initialized" messages.
See below.
All of my JkMounts are in a single VirtualHost, and they are intended to
be accessed only through that VirtualHost.
This is a configuration that has been working, literally, for years, and
stopped working all of the sudden. I tried to downgrade to 2.0.x (on my
gentoo system using packaged apache httpd, which has always been very
good to work with) and I had dependency problems that I didn't feel like
dealing with. I'd prefer to get Apache 2.2 working properly.
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.
Gentoo does virtual hosts by having files in /etc/apache2/vhosts.d that
get loaded from httpd.conf like this:
Include /etc/apache2/vhosts.d/*.conf
My own virtual host file is called foo.conf and looks like this:
#LoadModule jk_module /usr/lib/apache2/extra-modules/mod_jk-1.2.25.so
LoadModule jk_module
/usr/lib/apache2/extra-modules/mod_jk-1.2.25-httpd-2.2.4.so
JkWorkersFile /etc/apache2/jk_workers.properties
JkLogFile /var/log/apache2/mod_jk.log
#JkLogLevel info
JkLogLevel debug
ServerTokens Major
<VirtualHost *:80>
... [what I posted in previous messages, including JkMounts]
</VirtualHost>
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?
The gentoo install comes with a "default" virtual host that basically
just sets up a standard /var/www/localhost/htdocs virtual host. It turns
on NameVirtualHost but then doesn't specify a server name, so I think it
only gets used when nothing else matches.
OK, does it contain a <VirtualHost> tag? If so, the NameVirtualHost will
then be resolved to the first VirtualHost found (and matching he IP/Port
restrictions). The first one is the default. Combined with your
difficulties to resolve static content, I expect this "default vhost" to
be a real vhost, which also gets used as the default. Understanding a
configuration combining vhosts with "*", vhosts with "_default", vhosts
with defined IP and port and finally name based vhosts is non trivial.
So if you don't intend to do name based virtual hosting, disable the
NameVirtualHost and also this "default" vhost. Consider using a real IP
instead of "*" in your vhost. Then only the global server and your vhost
(port 80) should remain.
Also consider defining a separate JkLogFile for the (not used) global
server. This way you can find out, what gets configured in the globl
server, and what gets configured in the vhost. It might also be good, to
add separate eror and access logs to the global server vs. the vhost, so
that you can easily detect configuration errors (whoops, I'm uing the
global server ...).
This is a testing server, so I don't really care that there's a useless
VirtualHost floating around.
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.
I'm using Gentoo Linux with a kernel version of 2.6.17. Errno 2 appears
to be:
# perror 2
OS error code 2: No such file or directory
Not surprising.
I am not intending to use shared memory or load balancing or anything
like that. Therefore, I have no such configuration in my
jk_workers.properties file. Could this be the reason why there appear to
be no "maps" when trying to match JkMounts? Are the workers being
configured and then discarded because there's no place to put them in
memory? That would suck, but at least make sense.
Should not be related. Nevertheless even without load balancing, using a
single member load balancer and shared memory can be interesting because
of the advanced managment and information features provided by the stu
worker (that uses the shared memory to comunicate with the lb).
I'm not sure which configuration directive to tweak in this case... any
ideas?
(Btw, I when building my own mod_jk.so, I didn't run 'make install'
since I don't want the installed messing with my config... I merely
copied the .so into the properly location and updated my configuration
accordingly. I hope that's not a problem.)
OK.
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?
No (relevant) errors in /var/log/apache2/error_log, which is the
configured error log file. This is the complete error log after startup
(but before any requests are made):
[Tue Sep 18 12:56:32 2007] [warn] No JkShmFile defined in httpd.conf.
Using default /usr/lib/apache2/logs/jk-runtime-status
[Tue Sep 18 12:56:32 2007] [notice] Digest: generating secret for digest
authentication ...
[Tue Sep 18 12:56:32 2007] [notice] Digest: done
[Tue Sep 18 12:56:33 2007] [warn] No JkShmFile defined in httpd.conf.
Using default /usr/lib/apache2/logs/jk-runtime-status
[Tue Sep 18 12:56:33 2007] [notice] Apache/2.2.6 (Unix) mod_jk/1.2.25
configured -- resuming normal operations
Then, after my first request:
[Tue Sep 18 12:57:49 2007] [error] [client 68.50.0.179] File does not
exist: /var/www/localhost/htdocs/diagnosis
Something must be wrong with Apache httpd as well, since it won't even
serve my index.html file from the Aliased directory for /diagnosis.
See above, it's pretty likely, that you don't hit "your" vhost.
When tailing all three log files (access, error, and mod_jk), this is
everything a single request generates:
==> /var/log/apache2/mod_jk.log <==
[Tue Sep 18 13:01:01.125 2007] [15226:3080726192] [debug]
map_uri_to_worker::jk_uri_worker_map.c (597): Attempting to map URI
'/diagnosis/index.do' from 0 maps
[Tue Sep 18 13:01:01.125 2007] [15226:3080726192] [debug]
map_uri_to_worker::jk_uri_worker_map.c (597): Attempting to map URI
'/diagnosis/index.do' from 0 maps
==> /var/log/apache2/access_log <==
68.50.0.179 - - [18/Sep/2007:13:01:01 -0400] "GET /diagnosis/index.do
HTTP/1.1" 404 294
==> /var/log/apache2/error_log <==
[Tue Sep 18 13:01:01 2007] [error] [client 68.50.0.179] File does not
exist: /var/www/localhost/htdocs/diagnosis
After the above lines get
logged, the process which handled the request (pid 4727) still exists?
That appears to be the case. For instance, in the above output, pid
15226 is handling the request, and here it is in a ps list moments later:
OK, so the child startup after the request was harmless.
apache 15224 0.0 0.1 8384 3020 ? S 12:59 0:00
/usr/sbin/apache2 -D
apache 15225 0.0 0.1 8384 3020 ? S 12:59 0:00
/usr/sbin/apache2 -D
apache 15226 0.0 0.1 8384 3020 ? S 12:59 0:00
/usr/sbin/apache2 -D
apache 15227 0.0 0.1 8384 3012 ? S 12:59 0:00
/usr/sbin/apache2 -D
apache 15228 0.0 0.1 8384 2560 ? S 12:59 0:00
/usr/sbin/apache2 -D
apache 15229 0.0 0.1 8384 2560 ? S 12:59 0:00
/usr/sbin/apache2 -D
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
Okay. Any way to find out what VH that is? I would not be surprised to
find one VH with JkMount and one with none.
Yep. Define a separat log file for the global server and each vhost,
including the default gentoo one.
The next one is strange. It should only appear for a new log file, but
we find it in the same log file.
Before startup, I deleted all log files, so this was fresh after a clean
startup.
[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:
Good! ;) That is exactly the number of JkMount directives I have in my
(desired) virtual host.
uri_worker_map_open::jk_uri_worker_map.c (423): rule map size is 23
Whops, and yet another log file/vhost?
Yeah, strange.
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)
Okay, I should probably remove them. As I said, this is from an ancient
configuration. We don't use load balancing or anything like that, so all
the lb_factors can probably go, too.
So it seems, there are 2 vhosts and the global server, and only one of
the three has JkMounts. Maybe your requests got handled by the global
server or the other vhost?
That appears to be the most likely scenario. I can't imagine what might
be happening, though. This is a pretty straightforward config (at least,
I thought it was). I'll play around with Apache independently of mod_jk
for a bit and see what I can come up with.
Thanks for your infinite patience, Rainer!
- -chris
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]