-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Rainer,

Thanks for the reply.

Rainer Jung wrote:
> 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.

> 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.

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.

>> 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.

Yep: I'm using the prefork MPM:

# /usr/sbin/apache2 -V
Server version: Apache/2.2.6 (Unix)
Server built:   Sep 18 2007 08:55:32
Server's Module Magic Number: 20051115:5
Server loaded:  APR 1.2.8, APR-Util 1.2.8
Compiled using: APR 1.2.8, APR-Util 1.2.8
Architecture:   32-bit
Server MPM:     Prefork
  threaded:     no
    forked:     yes (variable process count)
Server compiled with....
 -D APACHE_MPM_DIR="server/mpm/prefork"
 -D APR_HAS_SENDFILE
 -D APR_HAS_MMAP
 -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
 -D APR_USE_SYSVSEM_SERIALIZE
 -D APR_USE_PTHREAD_SERIALIZE
 -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
 -D APR_HAS_OTHER_CHILD
 -D AP_HAVE_RELIABLE_PIPED_LOGS
 -D DYNAMIC_MODULE_LIMIT=128
 -D HTTPD_ROOT="/usr"
 -D SUEXEC_BIN="/usr/sbin/suexec"
 -D DEFAULT_PIDLOG="/var/run/httpd.pid"
 -D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
 -D DEFAULT_LOCKFILE="/var/run/accept.lock"
 -D DEFAULT_ERRORLOG="logs/error_log"
 -D AP_TYPES_CONFIG_FILE="/etc/apache2/mime.types"
 -D SERVER_CONFIG_FILE="/etc/apache2/httpd.conf"
#

> 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.

Okay, thanks for the info. I wasn't too worried, since Apache was happy
to load the module and it looked like it was initializing properly.

> Concerning the workers config:
> 
> worker.worker3.connection_pool_size=1
> 
> Don't do that unless you are totally convinced you really want it :)

Heh; I'm not... like I said, this is an old configuration that has
served us well for years.

> 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.

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.

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.)

>> 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.

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:

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.

> 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

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFG8AYw9CaO5/Lv0PARAkmLAJ95QE8Qdu+bk01DhdVywaY0abLemgCguxDB
4jEXNSunnlRJRbxqybdi+MQ=
=56Ci
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
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