RE: Multiple Tomcat-Instances problem
Tino - I'm sorry to answer your question with a different suggestion, but... I have a set-up in which I'm using the same physical copy of a 5.5.15 Tomcat distribution, but I run two instances simultaneously by using command lines with two different settings of CATALINA_BASE. In each case CATALINA_BASE is a directory outside the tree in which the physical copy of Tomcat lives. This works fine - which is not surprising, because as you know that was the idea behind CATALINA_BASE, to allow people to have a single Tomcat installation but multiple runtime instances with completely different configuration. Something else I'm doing is avoiding environment variables everywhere - I hate them! They make it so difficult to debug problems. Instead, I have replaced them with literal paths, including in Tomcat shell files. (Actually, I have replaced them with properties named like {{runtime.catalina.base}}, and I use Ant to substitute these properties at build time - it works very well.) I hope this is useful. I also hope I don't sound smug - it took me an age to arrive at the idea... Jon -Original Message- From: news [mailto:[EMAIL PROTECTED] On Behalf Of Tino Schöllhorn Sent: 28 January 2006 17:06 To: users@tomcat.apache.org Subject: Multiple Tomcat-Instances problem Hi, I am using tomcat 5.5.12 on linux. We have installed 2 tomcat-instances - which I thought worked. But now I noticed that those 2 instances are using the same classes and the same classpath, which they should'nt. Here is the configuration: /our-apps/apache-tomcat-5.5.12 for Tomcat 1 /our-apps/tomcat-production for Tomcat 2 with the directories * conf * logs * shared * temp * webapps * work Tomcat 1 is working normally. But Tomcat 2 is using the same classes and libraries as Tomcat 1 in a context which is named "kos" respectively. I think I have messed up with the startup files. So here is the startup-file for the "production" tomcat. The startup-file for Tomcat 1 is basically the same but with no CATALINA_BASE option. So do you have any idea what I am doing wrong? #!/bin/sh ### BEGIN INIT INFO # Provides: tomcat-production # Required-Start: $local_fs $remote_fs # X-UnitedLinux-Should-Start: $named $syslog $time # Required-Stop: $local_fs $remote_fs # X-UnitedLinux-Should-Stop: $named $syslog $time # Default-Start: 3 5 # Default-Stop: 0 1 2 6 # Short-Description: Tomcat-Production # Description: Start Tomcat-Production ### END INIT INFO JRE_HOME=/our-apps/jdk1.5.0_05/jre export JRE_HOME CATALINA_OPTS="-Xms256M -Xmx512M" export CATALINA_OPTS CATALINA_HOME=/our-apps/apache-tomcat-5.5.12 export CATALINA_HOME CATALINA_BASE=/our-apps/tomcat-production export CATALINA_BASE cd ${CATALINA_HOME} case "$1" in start) echo "Starting Tomcat-Production ${CATALINA_HOME}..." su tomcat -s /bin/bash -c "${CATALINA_HOME}/bin/startup.sh" > "$CATALINA_BASE/logs/start.log" 2>&1 ;; restart) echo "Restarting Tomcat-Production ${CATALINA_HOME}..." $0 stop $0 start ;; stop) echo "Stopping Tomcat-Production ${CATALINA_HOME}..." su tomcat -s /bin/bash -c "${CATALINA_HOME}/bin/shutdown.sh" > "$CATALINA_BASE/logs/stop.log" 2>&1 ;; *) echo "usage: rctomcat-production [ start | stop | restart ]" ;; esac - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
ANSWER: mod_jk configuration directives in VirtualHost sections
I've sorted my problem out. It appears that at least for Apache 1.3.x, you cannot have the JkWorkersFile directive in a VirtualHost section; it has to be in the main server section. If it isn't, then mod_jk doesn't seem to be able to find the worker in the workers map. Other directives - e.g. JkLogFile etc - can be invoked per VirtualHost. Maybe this could be documented in the future... Jon -Original Message- From: Jonathan Woods [mailto:[EMAIL PROTECTED] Sent: 26 January 2006 22:11 To: 'Tomcat Users List' Subject: RE: mod_jk configuration directives in VirtualHost sections Dan - Thanks very much for all this - looks like it should work with mod_jk too! I'll let you know how I get on. Jon -Original Message- From: Didier McGillis [mailto:[EMAIL PROTECTED] Sent: 26 January 2006 19:32 To: users@tomcat.apache.org Subject: RE: mod_jk configuration directives in VirtualHost sections I did mod_jk2 with Virtual Host, and while its not the same I think that doing VH will not be a problem once you get an idea of how it should/can be setup. THIS IS PSEUDO, DO NOT TAKE AS GOSPEL TRUTH !!! NO SUPPORT! :p -- workers.properties file -- # Setting Tomcat & Java Home workers.tomcat_home=/usr/local/tomcat55 workers.java_home=/usr/local/java ps=/ worker.list=host1 worker.ajp13.port=8009 worker.ajp13.host=localhost worker.ajp13.type=ajp13 ps=/ worker.list=host2 worker.ajp13.port=9009 worker.ajp13.host=localhost worker.ajp13.type=ajp13 ps=/ worker.list=host3 worker.ajp13.port=10009 worker.ajp13.host=localhost worker.ajp13.type=ajp13 -- workers.properties file -- -- httpd.conf file -- ServerName host1:8009 DocumentRoot /usr/local/tomcat55/webapps/host1 DirectoryIndex index.html index.jsp ... LoadModule jk_module /usr/lib64/httpd/modules/mod_jk.so JkWorkersFile "/usr/local/tomcat55/conf/jk/host1-workers.properties" JkLogFile "/usr/local/tomcat55/logs/host1-mod_jk.log" JkLogLevel debug Alias / "/usr/local/tomcat55/webapps/host1" Options Indexes +FollowSymLinks JkMount /* host1 ... ServerName host1:9009 DocumentRoot /usr/local/tomcat55/webapps/host2 DirectoryIndex index.html index.jsp ... LoadModule jk_module /usr/lib64/httpd/modules/mod_jk.so JkWorkersFile "/usr/local/tomcat55/conf/jk/host2-workers.properties" JkLogFile "/usr/local/tomcat55/logs/host2-mod_jk.log" JkLogLevel debug Alias / "/usr/local/tomcat55/webapps/host2" Options Indexes +FollowSymLinks JkMount /* host2 ... -- httpd.conf file -- -- server.xml file -- ... -- server.xml file -- Try that and see how it works, again I did something similar with mod_jk2, I havent done this yet in mod_jk that is coming next. If you have different paths and arent putting the code in webapps, I currently have different paths for the different code, then the big change will be in the Server.xml where the appbase will need to be the full path to the code. Let me know if this works or if you did any tweeks. HTH Dan >From: "Jonathan Woods" <[EMAIL PROTECTED]> >Reply-To: "Tomcat Users List" >To: >Subject: mod_jk configuration directives in VirtualHost sections >Date: Wed, 25 Jan 2006 21:55:55 - > >Hello, list. > >I have Apache 1.3.33 running on Linux and talking successfully to >Tomcat >5.5.15 through mod_jk. I'd now like to host multiple instances of >Tomcat (or maybe just multiple Tomcat connectors within one instance) >to receive requests dispatched at multiple VirtualHosts on the same server. > >Is it possible to have more than one workers.properties file, and >therefore more than one JkWorkersFile directive, per Apache? Ideally, >I'd like one workers.properties file per VirtualHost just to make app-building easier. >The documentation says that certain directives may be repeated in >VirtualHost sections - e.g. JkLogFile - but doesn't mention JkWorkersFile. > >Thanks in advance - > >Jon - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: mod_jk configuration directives in VirtualHost sections
Dan - Thanks very much for all this - looks like it should work with mod_jk too! I'll let you know how I get on. Jon -Original Message- From: Didier McGillis [mailto:[EMAIL PROTECTED] Sent: 26 January 2006 19:32 To: users@tomcat.apache.org Subject: RE: mod_jk configuration directives in VirtualHost sections I did mod_jk2 with Virtual Host, and while its not the same I think that doing VH will not be a problem once you get an idea of how it should/can be setup. THIS IS PSEUDO, DO NOT TAKE AS GOSPEL TRUTH !!! NO SUPPORT! :p -- workers.properties file -- # Setting Tomcat & Java Home workers.tomcat_home=/usr/local/tomcat55 workers.java_home=/usr/local/java ps=/ worker.list=host1 worker.ajp13.port=8009 worker.ajp13.host=localhost worker.ajp13.type=ajp13 ps=/ worker.list=host2 worker.ajp13.port=9009 worker.ajp13.host=localhost worker.ajp13.type=ajp13 ps=/ worker.list=host3 worker.ajp13.port=10009 worker.ajp13.host=localhost worker.ajp13.type=ajp13 -- workers.properties file -- -- httpd.conf file -- ServerName host1:8009 DocumentRoot /usr/local/tomcat55/webapps/host1 DirectoryIndex index.html index.jsp ... LoadModule jk_module /usr/lib64/httpd/modules/mod_jk.so JkWorkersFile "/usr/local/tomcat55/conf/jk/host1-workers.properties" JkLogFile "/usr/local/tomcat55/logs/host1-mod_jk.log" JkLogLevel debug Alias / "/usr/local/tomcat55/webapps/host1" Options Indexes +FollowSymLinks JkMount /* host1 ... ServerName host1:9009 DocumentRoot /usr/local/tomcat55/webapps/host2 DirectoryIndex index.html index.jsp ... LoadModule jk_module /usr/lib64/httpd/modules/mod_jk.so JkWorkersFile "/usr/local/tomcat55/conf/jk/host2-workers.properties" JkLogFile "/usr/local/tomcat55/logs/host2-mod_jk.log" JkLogLevel debug Alias / "/usr/local/tomcat55/webapps/host2" Options Indexes +FollowSymLinks JkMount /* host2 ... -- httpd.conf file -- -- server.xml file -- ... -- server.xml file -- Try that and see how it works, again I did something similar with mod_jk2, I havent done this yet in mod_jk that is coming next. If you have different paths and arent putting the code in webapps, I currently have different paths for the different code, then the big change will be in the Server.xml where the appbase will need to be the full path to the code. Let me know if this works or if you did any tweeks. HTH Dan >From: "Jonathan Woods" <[EMAIL PROTECTED]> >Reply-To: "Tomcat Users List" >To: >Subject: mod_jk configuration directives in VirtualHost sections >Date: Wed, 25 Jan 2006 21:55:55 - > >Hello, list. > >I have Apache 1.3.33 running on Linux and talking successfully to >Tomcat >5.5.15 through mod_jk. I'd now like to host multiple instances of >Tomcat (or maybe just multiple Tomcat connectors within one instance) >to receive requests dispatched at multiple VirtualHosts on the same server. > >Is it possible to have more than one workers.properties file, and >therefore more than one JkWorkersFile directive, per Apache? Ideally, >I'd like one workers.properties file per VirtualHost just to make app-building easier. >The documentation says that certain directives may be repeated in >VirtualHost sections - e.g. JkLogFile - but doesn't mention JkWorkersFile. > >Thanks in advance - > >Jon - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat and mod_jk question on Red Hat 9
Sorry, Adrian - out of ideas, and Googling around for the error messages doesn't help much. I would certainly try updating mod_jk to the latest version, or recompiling from the version shipped with whichever Tomcat distribution you're using, all the while keeping your fingers crossed! However, it does feel more like a problem at the Tomcat end. If you are completely free to use whichever version of Tomcat you like, and you're already running web apps using 5.5.x, then you could try upgrading to 5.5.15, recently out of beta. Good luck - Jon -Original Message- From: Adrian Nadeau [mailto:[EMAIL PROTECTED] Sent: 26 January 2006 17:01 To: Jonathan Woods Cc: 'Tomcat Users List' Subject: Re: Tomcat and mod_jk question on Red Hat 9 Thanks for the information... In our mod_jk log we have the following showing up: [Wed Jan 25 13:21:33 2006] [jk_ajp_common.c (1401)]: ERROR: Receiving from tomcat failed, recoverable operation. err=1 [Wed Jan 25 13:21:33 2006] [jk_ajp_common.c (836)]: ajp_connection_tcp_get_message: Error - Wrong message format 0x4854 [Wed Jan 25 13:21:33 2006] [jk_ajp_common.c (1248)]: Error reading reply from tomcat. Tomcat is down or network problems. [Wed Jan 25 13:21:33 2006] [jk_ajp_common.c (1401)]: ERROR: Receiving from tomcat failed, recoverable operation. err=2 [Wed Jan 25 13:21:33 2006] [jk_ajp_common.c (1429)]: Error connecting to tomcat. Tomcat is probably not started or is listening on the wrong port. worker=ajp13 failed errno = 11 That's after it actually works a few times, so Tomcat is definitely running and accessible (thru port 8080 also). In error log there a lot of processes that haven't exited, here is some information from it when we actually do a restart: start[Thu Jan 26 10:31:24 2006] [warn] child process 5805 still did not exit, sending a SIGTERM [Thu Jan 26 10:31:24 2006] [warn] child process 5806 still did not exit, sending a SIGTERM [Thu Jan 26 10:31:24 2006] [warn] child process 6668 still did not exit, sending a SIGTERM [Thu Jan 26 10:31:24 2006] [warn] child process 28585 still did not exit, sending a SIGTERM [Thu Jan 26 10:31:24 2006] [warn] child process 13921 still did not exit, sending a SIGTERM [Thu Jan 26 10:31:24 2006] [warn] child process 27065 still did not exit, sending a SIGTERM [Thu Jan 26 10:31:24 2006] [warn] child process 13928 still did not exit, sending a SIGTERM [Thu Jan 26 10:31:24 2006] [warn] child process 27152 still did not exit, sending a SIGTERM [Thu Jan 26 10:31:24 2006] [warn] child process 18708 still did not exit, sending a SIGTERM [Thu Jan 26 10:31:24 2006] [warn] child process 18714 still did not exit, sending a SIGTERM [Thu Jan 26 10:31:25 2006] [warn] child process 5805 still did not exit, sending a SIGTERM [Thu Jan 26 10:31:25 2006] [warn] child process 5806 still did not exit, sending a SIGTERM [Thu Jan 26 10:31:25 2006] [warn] child process 6668 still did not exit, sending a SIGTERM [Thu Jan 26 10:31:25 2006] [warn] child process 28585 still did not exit, sending a SIGTERM [Thu Jan 26 10:31:25 2006] [warn] child process 13921 still did not exit, sending a SIGTERM [Thu Jan 26 10:31:25 2006] [warn] child process 27065 still did not exit, sending a SIGTERM [Thu Jan 26 10:31:25 2006] [warn] child process 13928 still did not exit, sending a SIGTERM [Thu Jan 26 10:31:25 2006] [warn] child process 27152 still did not exit, sending a SIGTERM [Thu Jan 26 10:31:25 2006] [warn] child process 18708 still did not exit, sending a SIGTERM [Thu Jan 26 10:31:25 2006] [warn] child process 18714 still did not exit, sending a SIGTERM [Thu Jan 26 10:31:26 2006] [notice] caught SIGTERM, shutting down [Thu Jan 26 10:31:31 2006] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec) [Thu Jan 26 10:31:31 2006] [notice] Digest: generating secret for digest authentication ... [Thu Jan 26 10:31:31 2006] [notice] Digest: done [Thu Jan 26 10:31:32 2006] [notice] Apache/2.0.40 (Red Hat Linux) configured -- resuming normal operations I don't believe it's our browser, we can actually reopen a new browser and it won't work right also (if we do it around the same time). I'm going to check the mod_jk file again and make 100% sure it's compatable with our versions of Tomcat and Apache. Do you think this could be causing the problem possibly? Any other suggestions would be great, Thanks again. Adrian Nadeau VP, Development Evolving Solutions...Technology for changing [EMAIL PROTECTED] www.evolvingsolutions.ca 506.633.2012 Jonathan Woods wrote: >Adrian - > >I haven't met this problem, but a few things occurred to me after >reading your message: > >1. Don't forgot you could probably (depending on your config) always >use mod_proxy instead of mod_jk, just as a temporary measure. > >2. Sometimes browsers are set to have only 2 or 3 concurrent >connections open to a server. Maybe something about your config - e.g. >the resource
RE: Tomcat and mod_jk question on Red Hat 9
Adrian - I haven't met this problem, but a few things occurred to me after reading your message: 1. Don't forgot you could probably (depending on your config) always use mod_proxy instead of mod_jk, just as a temporary measure. 2. Sometimes browsers are set to have only 2 or 3 concurrent connections open to a server. Maybe something about your config - e.g. the resources being served up, or a mod_jk problem - means that the connections aren't properly closed, so on the third click it's actually your browser waiting until the other connections are closed. 3. It also sounds like a threading problem could cause these symptoms. Is there any 2- or 3-ness about the Tomcat config - e.g. the size of the pool of servlet instances maintained? Are the resources you're reaching when you click threadsafe? 4. Try looking in Apache's error log and in mod_jk's log (assuming you write one - JkLogFile directive). Jon -Original Message- From: Adrian Nadeau [mailto:[EMAIL PROTECTED] Sent: 26 January 2006 14:56 To: users@tomcat.apache.org Subject: Tomcat and mod_jk question on Red Hat 9 Hello, We recently setup mod_jk on a server running Red Hat 9. We are having some odd problems with the new setup. For some reason, everything works fine for the first 2 clicks when testing the process (running the examples webapp thru Apache 2.0.40). However, when we click something (anything, doesn't have to be the same steps) for the third time, it seems as though mod_jk cannot connect through AJP13 (Tomcat version is 4.1.29) . It trys to load for a long time and then nothing loads. If we wait for a bit and then do the same test again, the same thing happens. I can post more information and config settings, but I wanted to see if this is a common problem or not? We've had no problems running mod_jk in a Windows environment or Solaris in the past. If we need to post more information that is not a problem, we can do that. We talked to our hosting provider and they seem to think it's that we are running out of TCP Sockets? Any information would be great as we are trying to get a number of applications running on the server ASAP (of course). Thanks! Regards, Adrian Nadeau VP, Development Evolving Solutions...Technology for changing [EMAIL PROTECTED] www.evolvingsolutions.ca 506.633.2012 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
mod_jk configuration directives in VirtualHost sections
Hello, list. I have Apache 1.3.33 running on Linux and talking successfully to Tomcat 5.5.15 through mod_jk. I'd now like to host multiple instances of Tomcat (or maybe just multiple Tomcat connectors within one instance) to receive requests dispatched at multiple VirtualHosts on the same server. Is it possible to have more than one workers.properties file, and therefore more than one JkWorkersFile directive, per Apache? Ideally, I'd like one workers.properties file per VirtualHost just to make app-building easier. The documentation says that certain directives may be repeated in VirtualHost sections - e.g. JkLogFile - but doesn't mention JkWorkersFile. Thanks in advance - Jon