You are not logged in.

#1 2004-03-09 20:44:58

Dusty
Schwag Merchant
From: Medicine Hat, Alberta, Canada
Registered: 2004-01-18
Posts: 5,986
Website

Tomcat and Apache via JK2

Hello,

Has anybody ever gotten tomcat and apache working properly? I'm having a hell of a time with it. I have them working independently, and have JK2 installed (made a package for it). I used the tomcat 4.1 package from incoming...

I can post configs and such if anybody thinks they can help. Right now, this is just a probe to see if anyone thinks they can help. wink  I need a break from it, been scrapping with it for three hours now.

Once I get this working, I'll post a howto to the Wiki, I promise. :-D

Thanks for any info,

Dusty

Offline

#2 2004-03-10 00:30:31

chane
Member
Registered: 2003-12-02
Posts: 93

Re: Tomcat and Apache via JK2

Dusty,

I might be able to help a bit.  I have apache 2.x and Tomact 4.1.29 running with JK2.

From what I remember it was pretty simple to setup although EVERYTHING has to be just right....

From what I remember this is how I did it:
in httpd.conf added a module:
LoadModule jk2_module   lib/apache/rh72-2.0.2-mod_jk2.so

I don't remember where I got or built the rh72-2.0.2-mod_jk2.so but it works for my site (I was running red hat at the time, reason for rh72).  If you get an updated version working that would probably be a good thing since there has been some work done on the connector lately.

in the same directory (as httpd.conf) there is the workers2.properties file:
[shm]
file=/var/run/shm.file
size=1048576

[channel.socket:localhost:8009]
port=8009
host=127.0.0.1

[ajp13:localhost:8009]
channel=channel.socket:localhost:8009

[uri:/examples/*]

In the tomcat server.conf there is a connector for Coyote/JK2 AJP 1.3, make sure this is not commented and is on port 8009.

I setup my version over 6 months ago and this is pretty rough and from memory without a lot of digging.  Let me know if it works....

Chris....

Offline

#3 2004-03-10 16:58:08

Dusty
Schwag Merchant
From: Medicine Hat, Alberta, Canada
Registered: 2004-01-18
Posts: 5,986
Website

Re: Tomcat and Apache via JK2

Thanks for the info so far, it's still not working though... here's what I'm getting:

chane wrote:

I might be able to help a bit.  I have apache 2.x and Tomact 4.1.29 running with JK2.

I've got apache 2.0.48, tomcat 4.1.27, and jk2 2.0.2. Tomcat is from incoming, I built jk2 from ABS myself; It puts mod_jk2.so in /usr/lib/apache.

in httpd.conf added a module:
LoadModule jk2_module   lib/apache/rh72-2.0.2-mod_jk2.so

I've got:
LoadModule jk2_module           lib/apache/mod_jk2.so

I think that's right; it seems to be loading the module (see error messages below)

in the same directory (as httpd.conf) there is the workers2.properties file:

I've tried various versions of that file. I just tried it with the one you gave copy-pasted into place, same problems.

In the tomcat server.conf there is a connector for Coyote/JK2 AJP 1.3, make sure this is not commented and is on port 8009.

I think I've got that set up properly. Isn't there some command I can use to test if there is a service running on port 8009?

Anyway, when I go to http://localhost:8080/examples/jsp, for example, it works with tomcat. But if I go to http://localhost/examples/jsp I get a 404 not found; apache isn't forwarding the request to tomcat, for whatever reason.

In /var/log/httpd/error_log, I've got this info:
[Wed Mar 10 10:44:18 2004] [error] config.update(): Can't find config file /usr/conf/workers2.properties
[Wed Mar 10 10:44:18 2004] [error] shm.init(): No file
[Wed Mar 10 10:44:18 2004] [error] jk2_init() Can't find child 452 in scoreboard
[Wed Mar 10 10:44:18 2004] [error] shm.init(): No file
[Wed Mar 10 10:44:18 2004] [error] mod_jk child init 1 -2
[Wed Mar 10 10:44:18 2004] [error] jk2_init() Can't find child 453 in scoreboard
[Wed Mar 10 10:44:18 2004] [error] shm.init(): No file
[Wed Mar 10 10:44:18 2004] [error] mod_jk child init 1 -2
[Wed Mar 10 10:44:18 2004] [error] shm.init(): No file
[Wed Mar 10 10:44:18 2004] [error] shm.init(): No file
[Wed Mar 10 10:44:18 2004] [error] jk2_init() Can't find child 456 in scoreboard
[Wed Mar 10 10:44:18 2004] [error] shm.init(): No file
[Wed Mar 10 10:44:18 2004] [error] mod_jk child init 1 -2
[Wed Mar 10 10:44:18 2004] [notice] Apache configured -- resuming normal operations
[Wed Mar 10 10:44:28 2004] [error] shm.init(): No file
[Wed Mar 10 10:44:28 2004] [error] [client 127.0.0.1] File does not exist: /home/httpd/html/examples

I can't tell if it isn't finding workers2.properties in the right place (why look in /usr/conf), or if its looking in two places and then not finding the shm file??

Do you have anything in ${TOMCAT_HOME}/conf/jk2.properties? All the stuff I've seen online wants me to add stuff to that file, but its never the same stuff. wink

Thanks very much,
Dusty

Offline

#4 2004-03-10 17:21:14

Dusty
Schwag Merchant
From: Medicine Hat, Alberta, Canada
Registered: 2004-01-18
Posts: 5,986
Website

Re: Tomcat and Apache via JK2

hmmm, it wasn't reading /etc/httpd/conf/workers.properties at all. I got it working fine with your configurations after simply sym-linking /usr/conf to /etc/httpd/conf. However, this is a messy workaround.

I tried the suggestion here:
http://archives.real-time.com/pipermail … 89411.html

to "include a directive in your httpd.conf file like:
JkSet conf:file etc/httpd/workers2.properties"

but that didn't seem to work.

I'm betting that the location of the workers2.properties is compiled into JK2 and I have to edit the configure script or Makefile to get it working... ugh.

Dusty

Offline

#5 2004-03-10 17:32:45

Dusty
Schwag Merchant
From: Medicine Hat, Alberta, Canada
Registered: 2004-01-18
Posts: 5,986
Website

Re: Tomcat and Apache via JK2

I've got it! The line needed to set the config file is:

JKSet config:file /etc/httpd/conf/workers2.properties

It could/should be placed in IfModule tags.

I'm going to get started on that wiki post now. smile

Dusty

Offline

#6 2004-03-11 00:52:45

Guest
Guest

Re: Tomcat and Apache via JK2

Glad you got it to work.  Any chance you want to share the JK2 module you compiled or even the scripts you used to compile it.

I haven't ventured down the compilation path yet for anything on Linux and usually look for compiled modules from somewhere.  I'm very much in the Java world right now and it's been a while since I worked with C and make files....

Chris....

#7 2004-03-11 02:28:04

Xentac
Forum Fellow
From: Victoria, BC
Registered: 2003-01-17
Posts: 1,797
Website

Re: Tomcat and Apache via JK2

Another idea is to check your PKGBUILD.

Try out stuff like: ./configure --prefix=/usr --sysconfdir=/etc/httpd/conf


I have discovered that all of mans unhappiness derives from only one source, not being able to sit quietly in a room
- Blaise Pascal

Offline

Board footer

Powered by FluxBB