• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

trouble with mod_jk2 / tomcat

S

SpeedPC

Guest
Hi all

We are using Plesk 8.0.1 on Debian 3.1.

I'm trying to get the following to work:

instead of using
http://domain.tld:9080/webapp1
I'd like to have
http://domain.tld/webapp1

Now I assume this should be possible by using mod_jk2.

As I saw in the httpd.include of domain.tld, Plesk already seems to add the required options to the apache-config:

<IfModule mod_jk2.c>
<Location "/webapp1">
RemoveHandler .jsp .jws .cfm .cfml .cfc
JkUriSet worker ajp13:localhost:9008
</Location>
</IfModule>

So I enabled the (already installed) mod_jk2 for apache, configured my workers2.properties and restarted apache.

worker and channel config in workers2.properties are:

# define the worker
[ajp13:localhost:9008]
channel=channel.socket:localhost:9008

[channel.socket:localhost:9008]
info=Ajp13 forwarding over socket

and in server.xml, Ajp13 seems to listen on 9008.

but after (successfully) restarting apache, I get the following messages when trying to access http://domain.tld/webapp1

[Wed Sep 27 20:43:41 2006] [notice] jk2_init() Found child 30438 in scoreboard slot 14
[Wed Sep 27 20:43:41 2006] [notice] channelApr.resolve(): create AF_NET localhost 9008
[Wed Sep 27 20:43:41 2006] [notice] workerEnv.init() ok /etc/apache2/workers2.properties
[Wed Sep 27 20:43:41 2006] [notice] mod_jk2 child 14 initialized
[Wed Sep 27 20:43:42 2006] [notice] jk2_init() Setting scoreboard slot 0 for child 30440
[Wed Sep 27 20:43:42 2006] [notice] channelApr.resolve(): create AF_NET localhost 9008
[Wed Sep 27 20:43:42 2006] [notice] workerEnv.init() ok /etc/apache2/workers2.properties
[Wed Sep 27 20:43:42 2006] [notice] mod_jk2 child 30440 initialized
[Wed Sep 27 20:43:42 2006] [notice] child pid 30384 exit signal Segmentation fault (11)
[Wed Sep 27 20:43:42 2006] [notice] jk2_init() Found child 30442 in scoreboard slot 30
[Wed Sep 27 20:43:42 2006] [notice] channelApr.resolve(): create AF_NET localhost 9008
[Wed Sep 27 20:43:42 2006] [notice] workerEnv.init() ok /etc/apache2/workers2.properties
[Wed Sep 27 20:43:42 2006] [notice] mod_jk2 child 30 initialized


Access through port 9080 still works and apache also seems to run, but when accessing http://domain.tld/webapp1, I just get a blank screen...

Has anyone had more success by getting mod_jk2 to work?

Thanks for your help.

Cheers,
Andreas
 
I find that if I grab the worker configuration properties and place them immediately after the LoadModule line like this:

PHP:
LoadModule jk_module /usr/lib/httpd/modules/mod_jk.so

JkWorkersFile /etc/httpd/conf/workers.properties
JkLogFile logs/mod_jk.log
JkLogLevel info

Then restart apache everything works as you would expect...for a while. Suddenly it will stop and then another restart of apache fixes it. This is obviously not an optimal fix but maybe it will give somebody a hint as to what's going on....

Steve
 
Hi Steve

thanks for your reply.

Your config looks like you are using mod_jk.
I tried the same with my setup of mod_jk2 but I don't get it to work. I restart apache, jk2 seems to be loaded but I can't access the webapp through port 80.

has anyone got this to work with jk2?
 
Back
Top