Need your help about In-process jk2 connection between Tomcat and Apache on Windows 2000
Hello All, I am doing in-process connection for Tomcat and Apache using jk2 on Windows 2000. The installed components are as below: Tomcat 4.1.24 Apache 2.0.46 mod_jk2-2.0.43.dll I have done following operation: 1. Install Tomcat in E:\jartomcatflex, it is correct. 2. Install Apache in E:\Apache2.0.46\Apache2, it is correct. 3. copy mod_jk2-2.0.43.dll to E:\Apache2.0.46\Apache2\modules\mod_jk2.dll 4. Add following command line in httpd.conf: LoadModule jk2_module modules/mod_jk2.dll 5. Add workers2.properties file under E:\Apache2.0.46\Apache2\conf, it likes below: # Define the comunication channel [channel.jni:jni] info=The jni channel, used if tomcat is started inprocess # Define the parameters for the Java Virtual Machine [vm:] info=Parameters used to load a JVM in the server process OPT=-Djava.class.path=e:\jartomcatflex\bin\tomcat-jni.jar OPT=-Dtomcat.home=e:\jartomcatflex OPT=-Dcatalina.home=e:\jartomcatflex OPT=-Xmx128M # JNI worker startup handler [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 stdout=e:\Apache2.0.46\Apache2\logs\stdout.log stderr=e:\Apache2.0.46\Apache2\logs\stderr.log # JNI worker shutdown handler [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 # Map the Tomcat examples webapp to the Web server uri space [uri:/examples/*] info=Map the whole webapp 6. Modify jk2.properties as below: # Add the apr and channelJni to the list of handlers handler.list=apr,request,container,channelJni # The native libraries will be registered by JK2 apr.jniModeSo=inprocess 7. Comments part I, uncomments part II in server.xml Part I !-- commented out because we dont need a standalone service -- !--Connector className=org.apache.coyote.tomcat4.CoyoteConnector port=9080 minProcessors=5 maxProcessors=75 enableLookups=true redirectPort=9443 acceptCount=100 debug=0 connectionTimeout=2 useURIValidationHack=false disableUploadTimeout=true /-- Part II !-- Define a Coyote/JK2 AJP 1.3 Connector on port 9009 -- Connector className=org.apache.coyote.tomcat4.CoyoteConnector port=9009 minProcessors=5 maxProcessors=75 enableLookups=true redirectPort=9443 acceptCount=10 debug=0 connectionTimeout=0 useURIValidationHack=false protocolHandlerClassName=org.apache.jk.server.JkCoyoteHandler/ 8. Startup Apache using below command: Apache -k start 9. Test using http://localhost/examples/, then shown: Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, [EMAIL PROTECTED] and inform them of the time the error occurred, and anything you might have done that may have caused the error. More information about this error may be available in the server error log. _ Apache/2.0.46 (Win32) mod_jk2/2.0.2 Server at localhost Port 80 The error log file shows: [Wed Jul 16 18:01:53 2003] [error] lb.getWorker() reenable ajp13:jni [Wed Jul 16 18:01:53 2003] [error] workerEnv.init() create slot epStat.0 failed [Wed Jul 16 18:01:54 2003] [error] lb.service() worker failed 12 for ajp13:jni [Wed Jul 16 18:01:54 2003] [error] lb.service() unrecoverable error... [Wed Jul 16 18:01:54 2003] [error] mod_jk.handler() Error connecting to tomcat 12 The stderr log file shows: TomcatStarter: main() Try org.apache.tomcat.startup.Main
RE: Need your help about In-process jk2 connection between Tomcat andApache on Windows 2000
Hi Cui, I think that you are missing the shm directive in workers2.properties and jk2.properties. Adding that directive should make everything go. _ Atreya Basu Developer, Greenfield Research Inc. e-mail: atreya (at) greenfieldresearch (dot) ca -Original Message- From: Cui Xiaojing-a13339 [mailto:[EMAIL PROTECTED] Sent: July 16, 2003 7:00 AM To: Tomcat Users List Subject: Need your help about In-process jk2 connection between Tomcat and Apache on Windows 2000 Hello All, I am doing in-process connection for Tomcat and Apache using jk2 on Windows 2000. The installed components are as below: Tomcat 4.1.24 Apache 2.0.46 mod_jk2-2.0.43.dll I have done following operation: 1. Install Tomcat in E:\jartomcatflex, it is correct. 2. Install Apache in E:\Apache2.0.46\Apache2, it is correct. 3. copy mod_jk2-2.0.43.dll to E:\Apache2.0.46\Apache2\modules\mod_jk2.dll 4. Add following command line in httpd.conf: LoadModule jk2_module modules/mod_jk2.dll 5. Add workers2.properties file under E:\Apache2.0.46\Apache2\conf, it likes below: # Define the comunication channel [channel.jni:jni] info=The jni channel, used if tomcat is started inprocess # Define the parameters for the Java Virtual Machine [vm:] info=Parameters used to load a JVM in the server process OPT=-Djava.class.path=e:\jartomcatflex\bin\tomcat-jni.jar OPT=-Dtomcat.home=e:\jartomcatflex OPT=-Dcatalina.home=e:\jartomcatflex OPT=-Xmx128M # JNI worker startup handler [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 stdout=e:\Apache2.0.46\Apache2\logs\stdout.log stderr=e:\Apache2.0.46\Apache2\logs\stderr.log # JNI worker shutdown handler [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 # Map the Tomcat examples webapp to the Web server uri space [uri:/examples/*] info=Map the whole webapp 6. Modify jk2.properties as below: # Add the apr and channelJni to the list of handlers handler.list=apr,request,container,channelJni # The native libraries will be registered by JK2 apr.jniModeSo=inprocess 7. Comments part I, uncomments part II in server.xml Part I !-- commented out because we don't need a standalone service -- !--Connector className=org.apache.coyote.tomcat4.CoyoteConnector port=9080 minProcessors=5 maxProcessors=75 enableLookups=true redirectPort=9443 acceptCount=100 debug=0 connectionTimeout=2 useURIValidationHack=false disableUploadTimeout=true /-- Part II !-- Define a Coyote/JK2 AJP 1.3 Connector on port 9009 -- Connector className=org.apache.coyote.tomcat4.CoyoteConnector port=9009 minProcessors=5 maxProcessors=75 enableLookups=true redirectPort=9443 acceptCount=10 debug=0 connectionTimeout=0 useURIValidationHack=false protocolHandlerClassName=org.apache.jk.server.JkCoyoteHandler/ 8. Startup Apache using below command: Apache -k start 9. Test using http://localhost/examples/, then shown: Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, [EMAIL PROTECTED] and inform them of the time the error occurred, and anything you might have done that may have caused the error. More information about this error may be available in the server error log. _ Apache/2.0.46 (Win32) mod_jk2/2.0.2 Server at localhost Port 80 The error log file shows: [Wed Jul 16 18:01:53 2003] [error] lb.getWorker() reenable ajp13:jni [Wed Jul 16 18:01:53 2003] [error] workerEnv.init() create slot epStat.0
RE: Need your help about In-process jk2 connection between Tomcat and Apache on Windows 2000
Hello Atreya Basu, It works now. Thanks you so much. Regards, Xiaojing -Original Message- From: Atreya Basu [mailto:[EMAIL PROTECTED] Sent: 2003716 18:45 To: 'Tomcat Users List' Subject: RE: Need your help about In-process jk2 connection between Tomcat and Apache on Windows 2000 Hi Cui, I think that you are missing the shm directive in workers2.properties and jk2.properties. Adding that directive should make everything go. _ Atreya Basu Developer, Greenfield Research Inc. e-mail: atreya (at) greenfieldresearch (dot) ca -Original Message- From: Cui Xiaojing-a13339 [mailto:[EMAIL PROTECTED] Sent: July 16, 2003 7:00 AM To: Tomcat Users List Subject: Need your help about In-process jk2 connection between Tomcat and Apache on Windows 2000 Hello All, I am doing in-process connection for Tomcat and Apache using jk2 on Windows 2000. The installed components are as below: Tomcat 4.1.24 Apache 2.0.46 mod_jk2-2.0.43.dll I have done following operation: 1. Install Tomcat in E:\jartomcatflex, it is correct. 2. Install Apache in E:\Apache2.0.46\Apache2, it is correct. 3. copy mod_jk2-2.0.43.dll to E:\Apache2.0.46\Apache2\modules\mod_jk2.dll 4. Add following command line in httpd.conf: LoadModule jk2_module modules/mod_jk2.dll 5. Add workers2.properties file under E:\Apache2.0.46\Apache2\conf, it likes below: # Define the comunication channel [channel.jni:jni] info=The jni channel, used if tomcat is started inprocess # Define the parameters for the Java Virtual Machine [vm:] info=Parameters used to load a JVM in the server process OPT=-Djava.class.path=e:\jartomcatflex\bin\tomcat-jni.jar OPT=-Dtomcat.home=e:\jartomcatflex OPT=-Dcatalina.home=e:\jartomcatflex OPT=-Xmx128M # JNI worker startup handler [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 stdout=e:\Apache2.0.46\Apache2\logs\stdout.log stderr=e:\Apache2.0.46\Apache2\logs\stderr.log # JNI worker shutdown handler [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 # Map the Tomcat examples webapp to the Web server uri space [uri:/examples/*] info=Map the whole webapp 6. Modify jk2.properties as below: # Add the apr and channelJni to the list of handlers handler.list=apr,request,container,channelJni # The native libraries will be registered by JK2 apr.jniModeSo=inprocess 7. Comments part I, uncomments part II in server.xml Part I !-- commented out because we don't need a standalone service -- !--Connector className=org.apache.coyote.tomcat4.CoyoteConnector port=9080 minProcessors=5 maxProcessors=75 enableLookups=true redirectPort=9443 acceptCount=100 debug=0 connectionTimeout=2 useURIValidationHack=false disableUploadTimeout=true /-- Part II !-- Define a Coyote/JK2 AJP 1.3 Connector on port 9009 -- Connector className=org.apache.coyote.tomcat4.CoyoteConnector port=9009 minProcessors=5 maxProcessors=75 enableLookups=true redirectPort=9443 acceptCount=10 debug=0 connectionTimeout=0 useURIValidationHack=false protocolHandlerClassName=org.apache.jk.server.JkCoyoteHandler/ 8. Startup Apache using below command: Apache -k start 9. Test using http://localhost/examples/, then shown: Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, [EMAIL PROTECTED] and inform them of the time the error occurred, and anything you might have done that may have caused the error. More information about this error may be available in the server error log
In Process JK2
Thanks to the WIKI page I've gotten almost everything working correctly with JK2. The only thing that I'm not able to do is start Tomcat inprocess. When I try to start Tomcat inprocess I get an error saying that apache couldn't find the libjvm.so file. Here is the error: [Fri Jul 11 17:38:10 2003] [notice] jni.guessJvmDll() failed /usr/java/j2sdk1.4.2/jre/bin/classic/libjvm\ .so [Fri Jul 11 17:38:10 2003] [notice] jni.guessJvmDll() failed /usr/java/j2sdk1.4.2/jre/bin/client/jvm.so [Fri Jul 11 17:38:10 2003] [notice] jni.guessJvmDll() failed /usr/java/j2sdk1.4.2/jre/lib/i386/classic/l\ ibjvm.so [Fri Jul 11 17:38:10 2003] [notice] jni.guessJvmDll() trying /usr/java/j2sdk1.4.2/jre/lib/i386/client/li\ bjvm.so [Fri Jul 11 17:38:10 2003] [notice] jni.guessJvmDll() could not find /usr/java/j2sdk1.4.2/jre/lib/i386/c\ lient/libjvm.so in the LD_LIBRARY_PATH [Fri Jul 11 17:38:10 2003] [error] vm.init(): no jvm_dll_path, will use LD_LIBRARY_PATH libjvm.so [Fri Jul 11 17:38:10 2003] [error] Can't load native library libjvm.so : libjvm.so: cannot open shared o\ bject file: No such file or directory [Fri Jul 11 17:38:10 2003] [error] jni.loadJvm() Error - can't load jvm dll I've tried to edit the jk_vm_default.c file to search the correct directory but that doesn't do anything. Does anyone have any insight into this? Has anyone gotten JK2 to start inprocess? _ Atreya Basu Developer, Greenfield Research Inc. e-mail: atreya (at) greenfieldresearch (dot) ca - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]