Win2K, ApacheHTTPD2.0.5, Tomcat5 and JK2

2004-07-20 Thread Andrew Pealing
Hello all

I've got a win2k server running Apache2.0.5, mod_jk2/2.0.2 and tomcat4.1, using the 
inprocess worker

I am trying to upgrade to Tomcat 5 and mod_jk2/2.0.4

If I start Tomcat5 manually, then ApacheHTTPd and mod_jk2 succesfully pass the 
requests through and jsp and servlets work. However, just starting the ApacheHTTP, 
tomcat won't start.

I've tried upgrading just the mod_jk2 , and leaving Tomcat at 4.1, with no difference 
- Tomcat doesn't appear to attempt to start. 

If I try to upgrade Tomcat to 5 and leave mod_jk2 at mod_jk2/2.0.2, then I get errors 
in the error.log regarding classes not found. I've tried various combinations of 
classpath in the workers2.properties, including all the jar files in 
${CATALINA_HOME}/bin and $(CATALINA_HOME}/server/lib. The class not found varies 
depending on the classpath. With all the jar files in the classpath, there are no 
errors re class not ofund, but the workers do not start.

Below are my workers2.properties and my jk2.properties.

Anyone made Apache/Tomcat5 communicate using the inprocess worker? Any tips?

Roo

jk2.properties
--
apr.jniModeSo=inprocess

workers2.properties
---


[logger]
level=ERROR

[shm]
file=D:/www/logs/jk2.shm
size=1048576
disabled=0

# Example socket channel, override port and host.
[channel.socket:localhost:8009]
port=8009
host=127.0.0.1

#InProcess Channel
[channel.jni:jni]
info=The jni channel - used if Tomcat is started inprocess

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

[vm:]
info=Parameters used to load a JVM in the server process
OPT=-Djava.class.path=C:/Programs/ApacheGroup/tomcat5/server/lib/tomcat-jk2.jar;C:/Programs/ApacheGroup/tomcat5/server/lib/catalina.jar;C:/Programs/ApacheGroup/tomcat5/server/lib/tomcat-jni.jar
OPT=-Dtomcat.home=C:/Programs/ApacheGroup/tomcat5
OPT=-Dcatalina.home=C:/Programs/ApacheGroup/tomcat5
OPT=-Xmx128M
disabled=0

[worker.jni:onStartup]
info=Command to be executed by the VM on startup. This one will start tomcat.
class=org/apache/jk/apr/TomcatStarter
ARG=start
disabled=0
stdout=D:/www/logs/stdout.log
stderr=D:/www/logs/stderr.log

[worker.jni:onShutdown]
info=Command to be executed by the VM on shutdown. This one will stop tomcat.
class=org/apache/jk/apr/TomcatStarter
ARG=stop
disabled=0

# Uri mapping
[uri:/ROOT/*]
[uri:/jsp-examples/*]
[uri:/servlets-examples/*]
[uri:/balancer/*]
[uri:/tomcat-docs/*]
#worker=ajp13:localhost:8009

# define the worker
[status:status]

# Uri mapping
[uri:/jkstatus/*]
worker=status:status


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Linux tomcat startup

2002-12-16 Thread Andrew Pealing
I assume you mean the Gnome Services GUI

Try using chkconfig. Man chkconfig explains what's required, but 
basically you will need to create a startup script (called for instance 
'tomcat4') in /etc/rc.c/init.d/ that has the right headers – copy 
another one and edit it is a good plan.

Then use chkconfig –add tomcat4

Personally, I prefer to use the command line chkconfig to the gnome 
services, as it gives control over what run level the daemons start at.

Andrew

 Original Message 

On 17/12/2002, 05:54:45, [EMAIL PROTECTED] wrote regarding Linux 
tomcat startup:


 How can I add tomcat to Services on a Red HAt 8.0 linux system, just 
like apache?

 I know I can add a line to /etc/rc.d/init.d/httpd to start it at bootup, 
but I'd like to have it show up under Services, so I can stop and restart 
when I need it.

 Thanks,
 Peter

 __
 The NEW Netscape 7.0 browser is now available. Upgrade now! 
http://channels.netscape.com/ns/browsers/download.jsp

 Get your own FREE, personal Netscape Mail account today at 
http://webmail.netscape.com/

 --
 To unsubscribe, e-mail:   
mailto:[EMAIL PROTECTED]
 For additional commands, e-mail: 
mailto:[EMAIL PROTECTED]

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Re: switching from mod_jk to mod_jk2

2002-12-16 Thread Andrew Pealing
I think that you'll find apache users workers2.properties in the same 
conf dir as the httpd.conf, whereas tomcat4 uses the jk2.properties, 
which on my RH7.3 install was in /etc/tomcat4

ie You don't tell apache where jk2.properties is – it uses 
workers2.properties

 Original Message 

On 16/12/2002, 16:46:43, Debra Mendelson, CCE [EMAIL PROTECTED] 
wrote regarding switching from mod_jk to mod_jk2:


 I am using httpd 2.0.43 and tomcat 4.1.12

 I have been using mod_jk and would like to move to mod_jk2

 in mod_jk I added the following directives to point apache to my
 application:
   JkWorkersFile /myapp/conf/workers.properties
   JkLogFile  /myapp/logs/jk.log
   JkLogLevel warn
   JkMount /servlet/* trueoutcomes30

 From the documentation I have read I assume that the content in
 workers.properties changes and many downloads offer a sample 
jk2.properties
 file.

 My question is if the JkWorkersFile directive does not exist in 
httpd.conf,
 than how do I tell apache where my jk2.properties file is?


 --
 To unsubscribe, e-mail:   
mailto:[EMAIL PROTECTED]
 For additional commands, e-mail: 
mailto:[EMAIL PROTECTED]

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Re: Linux tomcat startup

2002-12-16 Thread Andrew Pealing
Attached is the one I used on RH7.3

(I didn't write this – it came as part of the rpm I used)

However, if you look, it does an 'su - ${TOMCAT_USER}' to start tomcat, 
so environment is OK.

 Original Message 

On 17/12/2002, 10:23:45, [EMAIL PROTECTED] wrote regarding Re: Linux 
tomcat startup:


 Will this run before or after profiles.conf, starting tomcat needs the 
JAVA_HOME, CATALINA_HOME etc info...



 Peter


 Andrew Pealing [EMAIL PROTECTED] wrote:

 I assume you mean the Gnome Services GUI
 
 Try using chkconfig. Man chkconfig explains what's required, but
 basically you will need to create a startup script (called for instance
 'tomcat4') in /etc/rc.c/init.d/ that has the right headers – copy
 another one and edit it is a good plan.
 
 Then use chkconfig –add tomcat4
 
 Personally, I prefer to use the command line chkconfig to the gnome
 services, as it gives control over what run level the daemons start at.
 
 Andrew
 
  Original Message 
 
 On 17/12/2002, 05:54:45, [EMAIL PROTECTED] wrote regarding Linux
 tomcat startup:
 
 
  How can I add tomcat to Services on a Red HAt 8.0 linux system, just
 like apache?
 
  I know I can add a line to /etc/rc.d/init.d/httpd to start it at bootup,
 but I'd like to have it show up under Services, so I can stop and 
restart
 when I need it.
 
  Thanks,
  Peter
 
  __
  The NEW Netscape 7.0 browser is now available. Upgrade now!
 http://channels.netscape.com/ns/browsers/download.jsp
 
  Get your own FREE, personal Netscape Mail account today at
 http://webmail.netscape.com/
 
  --
  To unsubscribe, e-mail:
 mailto:[EMAIL PROTECTED]
  For additional commands, e-mail:
 mailto:[EMAIL PROTECTED]
 
 --
 To unsubscribe, e-mail:   
mailto:[EMAIL PROTECTED]
 For additional commands, e-mail: 
mailto:[EMAIL PROTECTED]
 
 

 __
 The NEW Netscape 7.0 browser is now available. Upgrade now! 
http://channels.netscape.com/ns/browsers/download.jsp

 Get your own FREE, personal Netscape Mail account today at 
http://webmail.netscape.com/

 --
 To unsubscribe, e-mail:   
mailto:[EMAIL PROTECTED]
 For additional commands, e-mail: 
mailto:[EMAIL PROTECTED]
#!/bin/sh
#
# Startup script for Tomcat 4.0, the Apache Servlet Engine
#
# chkconfig: - 80 20
# description: Tomcat 4.0 is the Apache Servlet Engine RI for Servlet 2.3/JSP 1.2
# processname: tomcat
# pidfile: /var/run/tomcat4.pid
# config:  /etc/tomcat4/tomcat4.conf
#
# Gomez Henri [EMAIL PROTECTED]
# Keith Irwin [EMAIL PROTECTED]
# Nicolas Mailhot [EMAIL PROTECTED]
#
# version 1.02 - Removed initlog support
# version 1.03 - Removed config:
# version 1.04 - tomcat will start before httpd and stop after httpd
# version 1.05 - jdk hardcoded to link /usr/java/jdk and tomcat runs as nobody
# version 1.06 - split up into script and config file
# version 1.07 - Rework from Nicolas ideas
# version 1.08 - Fix work dir permission at start time, switch to use tomcat4
# version 1.09 - Fix pidfile and config tags
# version 1.10 - Fallback to su direct use on systems without Redhat/Mandrake init.d 
functions
# version 1.11 - Fix webapps dir permissions
# version 1.12 - remove initial start/stop level for chkconfig (- 80 20)
# version 1.13 - remove chown of logs/work/temp/webapps dir, owned by tomcat4 at 
install time
# version 1.14 - correct the start/stop ugly hack by waiting all the threads stops
# version 1.15 - ensure we're looking for TOMCAT_USER running catalina
#

# Source function library.
if [ -x /etc/rc.d/init.d/functions ]; then
. /etc/rc.d/init.d/functions
fi

# Get Tomcat config

TOMCAT_CFG=/etc/tomcat4/tomcat4.conf

[ -r $TOMCAT_CFG ]  . ${TOMCAT_CFG}

# Path to the tomcat launch script (direct don't use wrapper)
TOMCAT_SCRIPT=/usr/bin/dtomcat4

# Tomcat name :)
TOMCAT_PROG=tomcat4

# if TOMCAT_USER is not set, use tomcat4 like Apache HTTP server
if [ -z $TOMCAT_USER ]; then
TOMCAT_USER=tomcat4
fi

# Since the daemon function will sandbox $tomcat
# no environment stuff should be defined here anymore.
# Please use the /etc/tomcat.conf file instead ; it will
# be read by the $tomcat script

RETVAL=0

# See how we were called.
start() {
echo -n Starting $TOMCAT_PROG: 

if [ -x /etc/rc.d/init.d/functions ]; then
daemon --user $TOMCAT_USER $TOMCAT_SCRIPT start
else
su - $TOMCAT_USER -c $TOMCAT_SCRIPT start
fi

RETVAL=$?
echo
[ $RETVAL = 0 ]  touch /var/lock/subsys/tomcat4
return $RETVAL
}

stop() {
echo -n Stopping $TOMCAT_PROG: 

if [ -f /var/lock/subsys/tomcat4 ] ; then
  if [ -x /etc/rc.d/init.d/functions ]; then
  daemon --user $TOMCAT_USER $TOMCAT_SCRIPT stop
  else
  su - $TOMCAT_USER -c $TOMCAT_SCRIPT stop
  fi
  RETVAL=$?

  tc4run=1
  until [ $tc4run = '0' ]
  do
  tc4run=`ps -aux | grep catalina | grep -v grep | grep $TOMCAT_USER -c`
  sleep 1
  done
  rm -f /var/lock

Tomcat4, Apache2,mod_jk2, inprocess

2002-12-11 Thread Andrew Pealing
I'm attempting (and struggling) to use the inprocess worker.

(Using ajp13 works fine)

Any ideas from the error messages below as to what's wrong? I guess it's 
something to do with the vm section of the workers2.properties (below).

I'm using jdk1.3.1_02 in RH7.3

When starting Apache, this is the error I get in my error_log:

[Thu Dec 12 11:17:07 2002] [error] Can't load native library 
/usr/java/jdk1.3.1_02/jre/lib/i386/classic/libjvm.so : 
/usr/java/jdk1.3.1_02/jre/lib/i386/classic/libjvm.so: undefined symbol: 
jdk_sem_post
[Thu Dec 12 11:17:07 2002] [error] jni.loadJvm() Error - can't load jvm 
dll
[Thu Dec 12 11:17:07 2002] [error] workerJni.init() Can't attach to VM
[Thu Dec 12 11:17:07 2002] [error] workerEnv.initWorkers() init failed 
for worker.jni:onStartup
[Thu Dec 12 11:17:07 2002] [error] workerJni.init() Can't attach to VM
[Thu Dec 12 11:17:07 2002] [error] workerEnv.initWorkers() init failed 
for worker.jni:onShutdown
[Thu Dec 12 11:17:07 2002] [error] Can't load native library 
/usr/java/jdk1.3.1_02/jre/lib/i386/classic/libjvm.so : 
/usr/java/jdk1.3.1_02/jre/lib/i386/classic/libjvm.so: undefined symbol: 
jdk_sem_post
[Thu Dec 12 11:17:07 2002] [error] jni.loadJvm() Error - can't load jvm 
dll
[Thu Dec 12 11:17:07 2002] [error] workerJni.init() Can't attach to VM
[Thu Dec 12 11:17:07 2002] [error] workerEnv.initWorkers() init failed 
for worker.jni:onStartup
[Thu Dec 12 11:17:07 2002] [error] workerJni.init() Can't attach to VM
[Thu Dec 12 11:17:07 2002] [error] workerEnv.initWorkers() init failed 
for worker.jni:onShutdown
[Thu Dec 12 11:17:07 2002] [notice] Apache/2.0.43 (Unix) mod_jk2/2.0.0 
configured -- resuming normal operations
[Thu Dec 12 11:17:07 2002] [error] Can't load native library 
/usr/java/jdk1.3.1_02/jre/lib/i386/classic/libjvm.so : 
/usr/java/jdk1.3.1_02/jre/lib/i386/classic/libjvm.so: undefined symbol: 
jdk_sem_post
[Thu Dec 12 11:17:07 2002] [error] jni.loadJvm() Error - can't load jvm 
dll
[Thu Dec 12 11:17:07 2002] [error] workerJni.init() Can't attach to VM
[Thu Dec 12 11:17:07 2002] [error] workerEnv.initWorkers() init failed 
for worker.jni:onStartup
[Thu Dec 12 11:17:07 2002] [error] workerJni.init() Can't attach to VM
[Thu Dec 12 11:17:07 2002] [error] workerEnv.initWorkers() init failed 
for worker.jni:onShutdown
[Thu Dec 12 11:17:07 2002] [error] Can't load native library 
/usr/java/jdk1.3.1_02/jre/lib/i386/classic/libjvm.so : 
/usr/java/jdk1.3.1_02/jre/lib/i386/classic/libjvm.so: undefined symbol: 
jdk_sem_post
[Thu Dec 12 11:17:07 2002] [error] jni.loadJvm() Error - can't load jvm 
dll
[Thu Dec 12 11:17:07 2002] [error] workerJni.init() Can't attach to VM
[Thu Dec 12 11:17:07 2002] [error] workerEnv.initWorkers() init failed 
for worker.jni:onStartup
[Thu Dec 12 11:17:07 2002] [error] workerJni.init() Can't attach to VM
[Thu Dec 12 11:17:07 2002] [error] workerEnv.initWorkers() init failed 
for worker.jni:onShutdown
[Thu Dec 12 11:17:07 2002] [error] Can't load native library 
/usr/java/jdk1.3.1_02/jre/lib/i386/classic/libjvm.so : 
/usr/java/jdk1.3.1_02/jre/lib/i386/classic/libjvm.so: undefined symbol: 
jdk_sem_post
[Thu Dec 12 11:17:07 2002] [error] jni.loadJvm() Error - can't load jvm 
dll
[Thu Dec 12 11:17:07 2002] [error] workerJni.init() Can't attach to VM
[Thu Dec 12 11:17:07 2002] [error] workerEnv.initWorkers() init failed 
for worker.jni:onStartup
[Thu Dec 12 11:17:07 2002] [error] workerJni.init() Can't attach to VM
[Thu Dec 12 11:17:07 2002] [error] workerEnv.initWorkers() init failed 
for worker.jni:onShutdown



This is a snippet from my workers2.properties:

[vm:]
info=Parameters used to load a JVM in the server process
OPT=-Djava.class.path=/var/tomcat4/bin/tomcat-jni.jar:/var/tomcat4/bin/t
omcat.jar
OPT=-Dtomcat.home=/var/tomcat4
OPT=-Dcatalina.home=/var/tomcat4
OPT=-Xmx128M
disabled=0

[worker.jni:onStartup]
info=Command to be executed by the VM on startup. This one will start 
tomcat.
class=org/apache/jk/apr/TomcatStarter
ARG=start
disabled=0
stdout=/www/logs/stdout.log
stderr=/www/logs/stderr.log




--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]