Hello William, Thanks for the very helpful reply. Your assistance is much appreciated. Here's the contents of my mod_jk.conf file: JkWorkersFile /opt/catalina/conf/workers.properties JkLogFile /var/log/httpd/mod_jk.log JkLogLevel error JkMount /*.jsp ajp13 JkMount /servlet/* ajp13 And this is what I added to httpd.conf to get the mod_jk loaded: <Location ~ ".*/WEB-INF/"> AllowOverride None deny from all </Location> <Location ~ ".*/META-INF/"> AllowOverride None deny from all </Location> LoadModule jk_module modules/mod_jk.so Include /opt/jakarta-tomcat/conf/mod_jk.confI think you might be right in thinking the error is in here. Although I've tried various additional JkMount commands with no luck; i.e. /examples/*.jsp ajp13 and /examples/servlet/* ajp13
This certainly could have been a problem as I've tried relentlessly different server.xml configs. Indeed the examples app does now indeed appear to be partially working. Browse http://www.r-hosts.com/examples to see what I mean. None of the servlets are found but some of the .jsps load correctly others report java errors.It could be something as simple as the order you started things. Make sure to start Tomcat and have it fully up and running before you start Apache. I usually will wait almost a minute in between starting Tomcat and then Apache.
I had another look at the logs and noticed this in apache's: 2003-03-28 18:25:01 Internal Error: File /WEB-INF/web.xml not foundIn an attempt to fix this (there is certainly no WEB-INF/web.xml directory in home/sites/site1/web directory only in the webapp directories within it, i.e. examples) I tried changing the Context docBase in server.xml to /home/sites/site1/web/examples rather than /home/sites/site1/web/ and ammending the JkMounts to include /examples at the beginning of their paths but then nothing worked – all .jsps had Tomcat reporting 404s again.
This could have to do with the invoker being disabled in current releases of Tomcat. This mainly is a problem with Servlets but can effect JSPs as well. I have not found a recommended way around this problem. I simply uncommented the invoker, and let it run as it used to back in the day. Look in the web.xml file next to your server.xml file. See if the invoker servlet is commented out. If so uncomment it and restart Tomcat and see what you get.
I've checked this and it looks enabled correctly. Not sure where to go from here :-(Thanks again for your generosity with your time; I was going quite potty with frustration!
Peter
Hi William, I've been trying for the past four days(!) to get Tomcat 4 running correctly with Apache on Cobalt. Following your instructions at http://list.cobalt.com/pipermail/cobalt-developers/2003-February/ 038679.html I've got, I think, almost there.Thanks for looking and doing all you can before asking. I am much more inclined to help those willing to help themselves first.Tomcat and JDK 1.4.1 were installed successfully – with the default server.xml I could connect to www.r-hosts.com:8080/examples and run them successfully.Good so Tomcat is up and running.Then the next step, installing mod_jk, went okay. I managed to compile the mod_jk.so module from source and, by modifying httpd.conf, it appears to load okay.Did you also do the mappings for each virtual site in your httpd.conf? JkMount /*.jsp ajp13 JkMount /servlet/* ajp13However I'm having great difficulty configuring server.xml (and possibly the JkMount parts of httpd.conf) to make my webapps available on www.r-hosts.com/webapp/OkMy server.xml file is configured as follows: <Server port="8005" shutdown="SHUTDOWN" debug="0"> <Service name="Tomcat-Apache"> <Connector className="org.apache.ajp.tomcat4.Ajp13Connector" port="8009" minProcessors="5" maxProcessors="75" acceptCount="10" debug="0"/> <Engine className="org.apache.catalina.connector.warp.WarpEngine" name="Apache" defaultHost="www.r-hosts.com" debug="0" appBase="webapps"> <!-- Global logger unless overridden at lower levels --> <Logger className="org.apache.catalina.logger.FileLogger" prefix="apache-." suffix=".log" timestamp="true"/> <Host name="www.r-hosts.com"> <Context path="" docBase="/home/sites/site1/web" crossContext="true" debug="0" reloadable="false" trusted="false" > </Context> </Host> </Engine> </Service> </Server> When I browse http://www.r-home.com/examples I can browse the .html files but .jsps report an internal server error.Your server.xml file looks good. Keep in mind with this config, Tomcat will only serve requests to Apache. It will not server direct requests on port 8080. If you need that just add that part to your server.xml. Get it out of the default server.xml. Although I do not use it and have never needed it directly. I always use Tomcat with Apache.The mod_jk log reports the following: [Fri Mar 28 16:48:45 2003] [jk_ajp_common.c (872)]: Error connecting to the Tomcat process. [Fri Mar 28 16:48:45 2003] [jk_ajp_common.c (1181)]: In jk_endpoint_t::service, ajp_send_request failed in send loop 2 [Fri Mar 28 16:48:45 2003] [jk_ajp_common.c (1375)]: Into jk_endpoint_t::done, closing connection 0 [Fri Mar 28 16:48:45 2003] [jk_ajp_common.c (561)]: In jk_endpoint_t::ajp_close_endpoint [Fri Mar 28 16:48:45 2003] [jk_uri_worker_map.c (460)]: Into jk_uri_worker_map_t::map_uri_to_workerIt could be something as simple as the order you started things. Make sure to start Tomcat and have it fully up and running before you start Apache. I usually will wait almost a minute in between starting Tomcat and then Apache.The examples log this: LifecycleException: Container StandardContext[/examples] has not been started at org.apache.catalina.core.ContainerBase.stop(ContainerBase.java:1147) atorg.apache.catalina.core.StandardContext.stop(StandardContext.java:349 5)atorg.apache.catalina.core.StandardContext.start(StandardContext.java:34 34) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1123) at org.apache.catalina.core.StandardHost.start(StandardHost.java:638) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1123) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:343) atorg.apache.catalina.core.StandardService.start(StandardService.java:38 8)at org.apache.catalina.core.StandardServer.start(StandardServer.java:506)at org.apache.catalina.startup.Catalina.start(Catalina.java:781)at org.apache.catalina.startup.Catalina.execute(Catalina.java:681) at org.apache.catalina.startup.Catalina.process(Catalina.java:179)at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)atsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.j ava:39) atsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccess orImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:243)This could have to do with the invoker being disabled in current releases of Tomcat. This mainly is a problem with Servlets but can effect JSPs as well. I have not found a recommended way around this problem. I simply uncommented the invoker, and let it run as it used to back in the day. Look in the web.xml file next to your server.xml file. See if the invoker servlet is commented out. If so uncomment it and restart Tomcat and see what you get.Any light you could shed upon the problem would be much appreciated. And if you are willing to help me fix the problem I could give you access to the machine – just let me know what your quote would be for the work.Hopefully that will not be needed. As for payment, that also should not be necessary unless you want me to stop what I am doing and focus on helping you to get up and running. For that I would charge a flat ratethat we can negotiate. However I am pretty sure with patience we can getthings going at no expense to you other than time.If you could just get the examples running successfully on the www.r-hosts.com virtual host I think I can get the various other webapps I have on other sites going on that template.Great a goal. Yes, once one is up and running, others will be allot easier.My set up is almost exactly as you recommended with the exception that tomcat and my jdk are in /home – I've created symbolic links in opt – and I'm using an external file called from httpd.conf in $CATALINA/conf/mod_jk.conf to issue all the JkWorkers, JkMount etc. commands.It all about personal preferences. I do not care where you put stuff, orwhere you put your config. Just so long as it's all there.I would be curious to see the contents of your mod_jk.conf. Just to makesure there is not a problem there. That could make or break things. It definitely seems like your problem is with Apache and Tomcat. Not a big one to trouble shoot. Let me know and we will go from there. -- Sincerely, William L. Thomson Jr. Support Group Obsidian-Studios, Inc. 3548 Jamestown Ln. Jacksonville, FL 32223 Phone/Fax 904.260.2445 http://www.obsidian-studios.com
Hi William,I've been trying for the past four days(!) to get Tomcat 4 running correctly with Apache on Cobalt. Following your instructions at http://list.cobalt.com/pipermail/cobalt-developers/2003-February/ 038679.html I've got, I think, almost there.Tomcat and JDK 1.4.1 were installed successfully – with the default server.xml I could connect to www.r-hosts.com:8080/examples and run them successfully.Then the next step, installing mod_jk, went okay. I managed to compile the mod_jk.so module from source and, by modifying httpd.conf, it appears to load okay.However I'm having great difficulty configuring server.xml (and possibly the JkMount parts of httpd.conf) to make my webapps available on www.r-hosts.com/webapp/My server.xml file is configured as follows: <Server port="8005" shutdown="SHUTDOWN" debug="0"> <Service name="Tomcat-Apache"> <Connector className="org.apache.ajp.tomcat4.Ajp13Connector" port="8009" minProcessors="5" maxProcessors="75" acceptCount="10" debug="0"/> <Engine className="org.apache.catalina.connector.warp.WarpEngine" name="Apache" defaultHost="www.r-hosts.com" debug="0" appBase="webapps"> <!-- Global logger unless overridden at lower levels --> <Logger className="org.apache.catalina.logger.FileLogger" prefix="apache-." suffix=".log" timestamp="true"/> <Host name="www.r-hosts.com"> <Context path="" docBase="/home/sites/site1/web" crossContext="true" debug="0" reloadable="false" trusted="false" > </Context> </Host> </Engine> </Service> </Server>When I browse http://www.r-home.com/examples I can browse the .html files but .jsps report an internal server error.The mod_jk log reports the following:[Fri Mar 28 16:48:45 2003] [jk_ajp_common.c (872)]: Error connecting to the Tomcat process. [Fri Mar 28 16:48:45 2003] [jk_ajp_common.c (1181)]: In jk_endpoint_t::service, ajp_send_request failed in send loop 2 [Fri Mar 28 16:48:45 2003] [jk_ajp_common.c (1375)]: Into jk_endpoint_t::done, closing connection 0 [Fri Mar 28 16:48:45 2003] [jk_ajp_common.c (561)]: In jk_endpoint_t::ajp_close_endpoint [Fri Mar 28 16:48:45 2003] [jk_uri_worker_map.c (460)]: Into jk_uri_worker_map_t::map_uri_to_workerThe examples log this:LifecycleException: Container StandardContext[/examples] has not been started at org.apache.catalina.core.ContainerBase.stop(ContainerBase.java:1147) at org.apache.catalina.core.StandardContext.stop(StandardContext.java:349 5) at org.apache.catalina.core.StandardContext.start(StandardContext.java:34 34) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1123) at org.apache.catalina.core.StandardHost.start(StandardHost.java:638) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1123) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:343) at org.apache.catalina.core.StandardService.start(StandardService.java:38 8) at org.apache.catalina.core.StandardServer.start(StandardServer.java:506) at org.apache.catalina.startup.Catalina.start(Catalina.java:781) at org.apache.catalina.startup.Catalina.execute(Catalina.java:681) at org.apache.catalina.startup.Catalina.process(Catalina.java:179)at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.j ava:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccess orImpl.java:25)at java.lang.reflect.Method.invoke(Method.java:324)at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:243)Any light you could shed upon the problem would be much appreciated. And if you are willing to help me fix the problem I could give you access to the machine – just let me know what your quote would be for the work.If you could just get the examples running successfully on the www.r-hosts.com virtual host I think I can get the various other webapps I have on other sites going on that template.My set up is almost exactly as you recommended with the exception that tomcat and my jdk are in /home – I've created symbolic links in opt – and I'm using an external file called from httpd.conf in $CATALINA/conf/mod_jk.conf to issue all the JkWorkers, JkMount etc. commands.Thanks, Peter