another mod_jk problem...

another mod_jk problem...

am 13.05.2007 12:46:22 von francwalter

Hello,
i am running an apache2 and tomcat 5.5 on windows xpsp2.
apache is running and tomcat ist working. so i tried to use the mod_jk
module to connect the tomcat to the apache (i want to use the
svnwebclient). but it doesn't work.
i tried nearly everything, read a lot about it but it doesn't connect.
http://localhost:8080/jsp-examples
is working, giving me the working examples. even
http://localhost:8009/jsp-examples
is working.but when i try it with apache,
http://localhost/jsp-examples
after the timeout i get:
Service Temporarily Unavailable

I set the path:
user variables:
CATALINA_HOME=c:\Programme\Tomcat5.5
JAVA_HOME=c:\Programme\Java\jdk1.5.0
system variables:
Path= ....;C:\Programme\Java\jdk1.5.0\bin

the mod_jk is the version: mod_jk-apache-2.0.59.so
my apache shows me:
Apache/2.0.55 (Win32) DAV/2 mod_auth_sspi/1.0.4 mod_ssl/2.0.55 OpenSSL/
0.9.8a mod_jk/1.2.6 SVN/1.4.2 PHP/4.4.0 Server at localhost Port 80

my configurations:
httpd.conf:
....
LoadModule jk_module modules/mod_jk.so
JkWorkersFile "c:/programme/tomcat5.5/conf/workers.properties"
JkLogFile "C:/Programme/Tomcat5.5/logs/mod_jk.log"
JkLogLevel debug
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
Alias /jsp-examples "c:/Programme/Tomcat5.5/webapps/jsp-examples"
Alias /servlets-examples "c:/Programme/Tomcat5.5/webapps/servlets-
examples"
Alias /svnwebclient "c:/Programme/Tomcat5.5/webapps/svnwebclient"
JkMount /jsp-examples mainworker
JkMount /jsp-examples/* mainworker
JkMount /servlets-examples/* mainworker
JkMount /svnwebclient/* mainworker
JkMount /*.jsp mainworker
....

c:\Programme\Tomcat5.5\conf\server.xml:
className="org.apache.ajp.tomcat4.Ajp13Connector"
minProcessors="5" maxProcessors="75" acceptCount="10" debug="0" />

c:\Programme\Tomcat5.5\conf\workers.properties:
workers.tomcat_home="c:\Programme\Tomcat5.5"
workers.java_home=c:\Programme\Java\jdk1.5.0
ps=/
worker.list=mainworker
worker.mainworker.port=8009
worker.mainworker.host=localhost
worker.mainworker.type=ajp13

i dont find any clue in the log-files:

apache2\logs\error.log:
[Sun May 13 12:15:39 2007] [notice] Child 5984: Starting 250 worker
threads.
[Sun May 13 12:15:39 2007] [debug] child.c(697): Child 5984: Worker
thread 0 starting.
....
[Sun May 13 12:15:40 2007] [debug] child.c(697): Child 5984: Worker
thread 249 starting.

apache2\logs\access.log:
127.0.0.1 - - [13/May/2007:12:16:00 +0200] "GET /jsp-examples/ HTTP/
1.1" 503 487

Tomcat5.5\logs\catalina.2007-05-13.log:
13.05.2007 12:15:31 org.apache.coyote.http11.Http11BaseProtocol start
INFO: Starting Coyote HTTP/1.1 on http-8009
13.05.2007 12:15:31 org.apache.catalina.storeconfig.StoreLoader load
INFO: Find registry server-registry.xml at classpath resource
13.05.2007 12:15:31 org.apache.catalina.startup.Catalina start
INFO: Server startup in 6828 ms

Tomcat5.5\logs\mod_jk.log:
[Sun May 13 12:15:36 2007] [3120:3444] [debug] jk_uri_worker_map.c
(423): rule map size is 5
[Sun May 13 12:15:36 2007] [3120:3444] [debug] jk_uri_worker_map.c
(372): exact rule '/jsp-examples=mainworker' source 'JkMount' was
added
[Sun May 13 12:15:36 2007] [3120:3444] [debug] jk_uri_worker_map.c
(364): wildchar rule '/jsp-examples/*=mainworker' source 'JkMount' was
added
[Sun May 13 12:15:36 2007] [3120:3444] [debug] jk_uri_worker_map.c
(364): wildchar rule '/servlets-examples/*=mainworker' source
'JkMount' was added
[Sun May 13 12:15:36 2007] [3120:3444] [debug] jk_uri_worker_map.c
(364): wildchar rule '/svnwebclient/*=mainworker' source 'JkMount' was
added
[Sun May 13 12:15:36 2007] [3120:3444] [debug] jk_uri_worker_map.c
(364): wildchar rule '/*.jsp=mainworker' source 'JkMount' was added
[Sun May 13 12:15:36 2007] [3120:3444] [debug] jk_uri_worker_map.c
(423): rule map size is 5
[Sun May 13 12:15:36 2007] [3120:3444] [debug] jk_uri_worker_map.c
(372): exact rule '/jsp-examples=mainworker' source 'JkMount' was
added
....
[Sun May 13 12:15:36 2007] [3120:3444] [info] mod_jk.c (2743): mod_jk/
1.2.22 initialized
.... (no errors only debug messages)

Has anybody an idea what is wrong?
Any help would be very appreciated,
greetings, franc

Re: another mod_jk problem...

am 14.05.2007 00:14:58 von ge0rge

Franc Walter wrote:
> Hello,
> i am running an apache2 and tomcat 5.5 on windows xpsp2.
> apache is running and tomcat ist working. so i tried to use the mod_jk
> module to connect the tomcat to the apache (i want to use the
> svnwebclient). but it doesn't work.
> i tried nearly everything, read a lot about it but it doesn't connect.
> http://localhost:8080/jsp-examples
> is working, giving me the working examples. even
> http://localhost:8009/jsp-examples
> is working.but when i try it with apache,
> http://localhost/jsp-examples
> after the timeout i get:
> Service Temporarily Unavailable
>
> I set the path:
> user variables:
> CATALINA_HOME=c:\Programme\Tomcat5.5
> JAVA_HOME=c:\Programme\Java\jdk1.5.0
> system variables:
> Path= ....;C:\Programme\Java\jdk1.5.0\bin
>
> the mod_jk is the version: mod_jk-apache-2.0.59.so
> my apache shows me:
> Apache/2.0.55 (Win32) DAV/2 mod_auth_sspi/1.0.4 mod_ssl/2.0.55 OpenSSL/
> 0.9.8a mod_jk/1.2.6 SVN/1.4.2 PHP/4.4.0 Server at localhost Port 80


The documentation says that '... mod_jk-apache-2.0.59.so is for Apache
2.0, and works with Apache 2.0.59 and later. Rename to mod_jk.so before
putting it in your Apache2/modules directory'
You have Apache/2.0.55. This may/may not be an issue. Don't know really.


>
> my configurations:
> httpd.conf:
> ...
> LoadModule jk_module modules/mod_jk.so

Assuming here that you have renamed mod_jk-apache-2.0.59.so to mod_jk.so
and mod_jk.so is in the apache's modules directory.
(You have probably done that ... otherwise I think you will get a start
up failure)

> JkWorkersFile "c:/programme/tomcat5.5/conf/workers.properties"
> JkLogFile "C:/Programme/Tomcat5.5/logs/mod_jk.log"
> JkLogLevel debug
> JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
> Alias /jsp-examples "c:/Programme/Tomcat5.5/webapps/jsp-examples"
> Alias /servlets-examples "c:/Programme/Tomcat5.5/webapps/servlets-
> examples"
> Alias /svnwebclient "c:/Programme/Tomcat5.5/webapps/svnwebclient"
> JkMount /jsp-examples mainworker
> JkMount /jsp-examples/* mainworker
> JkMount /servlets-examples/* mainworker
> JkMount /svnwebclient/* mainworker
> JkMount /*.jsp mainworker

Possibly this is where the problem is -
I think the JkMount should be mapped to context /examples/* ... not to
/jsp-examples/* or /servlets-examples/*

Because when I run requests to Tomcat via Apache, the urls are
http://minime/examples/servlets/ for servlet examples
http://minime/examples/jsp/ for jsp examples

> ...
>
> c:\Programme\Tomcat5.5\conf\server.xml:
> > className="org.apache.ajp.tomcat4.Ajp13Connector"
> minProcessors="5" maxProcessors="75" acceptCount="10" debug="0" />
>
> c:\Programme\Tomcat5.5\conf\workers.properties:
> workers.tomcat_home="c:\Programme\Tomcat5.5"
> workers.java_home=c:\Programme\Java\jdk1.5.0
> ps=/
> worker.list=mainworker
> worker.mainworker.port=8009
> worker.mainworker.host=localhost
> worker.mainworker.type=ajp13
>
> i dont find any clue in the log-files:
>
> apache2\logs\error.log:
> [Sun May 13 12:15:39 2007] [notice] Child 5984: Starting 250 worker
> threads.
> [Sun May 13 12:15:39 2007] [debug] child.c(697): Child 5984: Worker
> thread 0 starting.
> ...
> [Sun May 13 12:15:40 2007] [debug] child.c(697): Child 5984: Worker
> thread 249 starting.
>
> apache2\logs\access.log:
> 127.0.0.1 - - [13/May/2007:12:16:00 +0200] "GET /jsp-examples/ HTTP/
> 1.1" 503 487
>
> Tomcat5.5\logs\catalina.2007-05-13.log:
> 13.05.2007 12:15:31 org.apache.coyote.http11.Http11BaseProtocol start
> INFO: Starting Coyote HTTP/1.1 on http-8009
> 13.05.2007 12:15:31 org.apache.catalina.storeconfig.StoreLoader load
> INFO: Find registry server-registry.xml at classpath resource
> 13.05.2007 12:15:31 org.apache.catalina.startup.Catalina start
> INFO: Server startup in 6828 ms
>
> Tomcat5.5\logs\mod_jk.log:
> [Sun May 13 12:15:36 2007] [3120:3444] [debug] jk_uri_worker_map.c
> (423): rule map size is 5
> [Sun May 13 12:15:36 2007] [3120:3444] [debug] jk_uri_worker_map.c
> (372): exact rule '/jsp-examples=mainworker' source 'JkMount' was
> added
> [Sun May 13 12:15:36 2007] [3120:3444] [debug] jk_uri_worker_map.c
> (364): wildchar rule '/jsp-examples/*=mainworker' source 'JkMount' was
> added
> [Sun May 13 12:15:36 2007] [3120:3444] [debug] jk_uri_worker_map.c
> (364): wildchar rule '/servlets-examples/*=mainworker' source
> 'JkMount' was added
> [Sun May 13 12:15:36 2007] [3120:3444] [debug] jk_uri_worker_map.c
> (364): wildchar rule '/svnwebclient/*=mainworker' source 'JkMount' was
> added
> [Sun May 13 12:15:36 2007] [3120:3444] [debug] jk_uri_worker_map.c
> (364): wildchar rule '/*.jsp=mainworker' source 'JkMount' was added
> [Sun May 13 12:15:36 2007] [3120:3444] [debug] jk_uri_worker_map.c
> (423): rule map size is 5
> [Sun May 13 12:15:36 2007] [3120:3444] [debug] jk_uri_worker_map.c
> (372): exact rule '/jsp-examples=mainworker' source 'JkMount' was
> added
> ...
> [Sun May 13 12:15:36 2007] [3120:3444] [info] mod_jk.c (2743): mod_jk/
> 1.2.22 initialized
> ... (no errors only debug messages)
>
> Has anybody an idea what is wrong?
> Any help would be very appreciated,
> greetings, franc
>

Re: another mod_jk problem...

am 14.05.2007 13:53:07 von francwalter

Thank you for your answer,
it doesnt work with JkMount /examples or similar. I think older
Tomcats examples name was like that, but now jsp-examples and servlets-
examples.
I tried the older mod_jk from archive
http://archive.apache.org/dist/tomcat/tomcat-connectors/jk/b inaries/win32/jk-1.2.15/mod_jk-apache-2.0.55.so
(naturally i renamed it in \modules\mod_jk, apache doesnt start with
not existing modules mentioned in httpd.conf)
but same thing. I try now apache 1.33 with the corresponding module,
maybe it has to do with the apache version (i dont want to upgrade to
2.0.59, fear of loosing ssl ability which is more important).

Re: another mod_jk problem...

am 14.05.2007 19:44:38 von francwalter

at least i found the error:

in the server.xml from tomcat5.5\config
it is false to write:

className="org.apache.ajp.tomcat4.Ajp13Connector"
..../>

instead it is better to do:

protocol="AJP/1.3"
..../>

this is the default and i discovered it when reinstalling tomcat. i
copied it from some old instructions.
may be something like className="org.apache.catalina.connector" should
work also?
it didnt like that with 5.5, i dont know.

Re: another mod_jk problem...

am 14.05.2007 22:21:48 von francwalter

Thank you,
i put this className="org.apache.ajp.tomcat4.Ajp13Connector" into the
Connector 8009 because it was indicated like this in a helpfile from
the svnwebclient 2.5.0 (in basicAuthenticationSettings.txt).
Its from Polarion.org. OpenSource, and it works, its nice.
This was the reason why i wanted to install Tomcat, to use svn over
net without client, which is possible with this svnwebclient.
So i followed the readmes, but as i didnt know tomcat at all i just
copied all.

Re: another mod_jk problem...

am 14.05.2007 22:28:30 von francwalter

and it is also on
http://www.onjava.com/pub/a/onjava/2002/11/20/tomcat.html?pa ge=1
which i considered as a quite complete guide, but refers to tomcat 4
which i didnt notice :-)

Re: another mod_jk problem...

am 15.05.2007 00:21:00 von ge0rge

Franc Walter wrote:
> at least i found the error:
>
> in the server.xml from tomcat5.5\config
> it is false to write:
>
> > className="org.apache.ajp.tomcat4.Ajp13Connector"
> .../>
>
> instead it is better to do:
>
> > protocol="AJP/1.3"
> .../>
>
> this is the default and i discovered it when reinstalling tomcat. i
> copied it from some old instructions.
> may be something like className="org.apache.catalina.connector" should
> work also?
> it didnt like that with 5.5, i dont know.
>
Sorry I can't be of much more specific help because my install is
obviously different. But for what it's worth, I have Apache 2.2.4,
Tomcat 6.0.10 and jre 6.0.01 on linux. Both Apache and Tomcat are
straight installs (no customisation except for ServerName in httpd.conf
and including a line tomcat configuration file). Here's the
workers.properties
# Define 1 real worker using ajp13
worker.list=worker1
# Set properties for worker1 (ajp13)
worker.worker1.type=ajp13
worker.worker1.host=localhost
worker.worker1.port=8009
(which is same as yours except I put it in the apache/conf directory)
The last entry in my httpd.conf, I have this
# Configuration for Tomcat Connector
Include conf/apacheMod_JK.conf

Here is my apacheMod_JK.conf
# Load mod_jk module
# Update this path to match your modules location
# LoadModule jk_module libexec/mod_jk.so
LoadModule jk_module
/opt/apache224/modules/mod_jk-1.2.21-apache-2.2.x-linux-i
686.so
# Declare the module for (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 /opt/apache224/conf/workers.properties
# Where to put jk shared memory
# Update this path to match your local state directory or logs directory
# JkShmFile /var/log/httpd/mod_jk.shm
JkShmFile /var/log/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/httpd/mod_jk.log
JkLogFile /var/log/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/* worker1


As you can see, it is pretty much standard (and by the way JKMount is
mapped to /examples/* and it worked in Tomcat 6.x)

Lastly just as you, I have this in Tomcat's server.xml


when I make a request to apache with context examples
(http://minime/examples/), it goes to tomcat