RE: Configuring Tomcat5/Apache2/JK2 for load balancing??
Hi, JkWorkersFile or JkMount are mod_jk directives, you need to use the equivalent mod_jk2 directives, something like : (jkmount equiv) [uri:/*.jsp] worker=lb:LB (jkworkersfile equiv) JkSet config:file /{path}/workers2.properties Kwong. -Original Message- From: Kevin Hartig [mailto:[EMAIL PROTECTED] Sent: Friday, 28 March 2003 8:45 To: Tomcat Users List Subject: Re: Configuring Tomcat5/Apache2/JK2 for load balancing?? OK. Thx. But Apache 2 still doesn't recognize the JkWorkersFile or JkMount parameters. Have these changed? John Turner wrote: If you're using JK2, you don't want mod_jk.conf file. ApacheConfig and mod_jk.conf are only for JK, not JK2. John On Thu, 27 Mar 2003 14:02:23 -0700, Kevin Hartig [EMAIL PROTECTED] wrote: I would like to configure multiple instances of Tomcat for load balancing. Most of the documentation I have found on this refers to older versions of Tomcat and Apache which are only partially correct. I am running on Windows 2000, using Tomcat 5, Apache 2.0.44, and JK2 2.0.43. First, is there current documentation that describes setting up a load balanced configuration? The first problem I have run into so far is that the JK options defined in the Apache http.conf are not recognized even though the module appears to be loaded successfully. Also I haven't been able to get Tomcat to auto-generate the mod_jk.conf file. The classes that generated them in Tomcat 4 are not in Tomcat ?? Anyone else have this working with the latest versions of Tomcat and Apache? --- Kevin Hartig[EMAIL PROTECTED] Technical Architect Mobile: 303.378.0579 Sun Microsystems, Inc. AIM: kwhartig - 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] Powered by telstra.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Infuriating port problem 80 - 8443 and 8008 - 8443
Perhaps some other process is already listening to port 80.. stop tomcat and try something like netstat -an | grep LISTEN and see if anything shows up as listening on port 80 Kwong. -Original Message- From: John Turner [mailto:[EMAIL PROTECTED] Sent: Wednesday, 26 March 2003 0:40 To: Tomcat Users List Subject: Re: Infuriating port problem 80 - 8443 and 8008 - 8443 If it was a root restriction issue, Tomcat wouldn't even start. John On Tue, 25 Mar 2003 13:26:35 -, James Lewis [EMAIL PROTECTED] wrote: Obviously I meant Linux, although root access on Linus sounds interesting... -Original Message- From: James Lewis [mailto:[EMAIL PROTECTED] Sent: 25 March 2003 13:24 To: Tomcat Users List Subject: RE: Infuriating port problem 80 - 8443 and 8008 - 8443 is the User who is running the server root? Some ports are privileged and you need root access on Linus to use them (someone can correct me on the exact ones no doubt :p) james -Original Message- From: Jamesey [mailto:[EMAIL PROTECTED] Sent: 25 March 2003 13:16 To: [EMAIL PROTECTED] Subject: Infuriating port problem 80 - 8443 and 8008 - 8443 My web app has been working fine for weeks switching from 8080 to 8443.. however.. i've now reconfigured it to port 80 and it after submitting to my struts action servlet.. i get page not found.. if i switch it back to 8080 its fine.. anyone know if im doing sometihng wrong? DETAILS: - Server.xml !-- Define a non-SSL Coyote HTTP/1.1 Connector on port 8080 -- Connector className=org.apache.coyote.tomcat4.CoyoteConnector port=80 minProcessors=5 maxProcessors=75 enableLookups=false redirectPort=8443 acceptCount=100 debug=0 connectionTimeout=2 useURIValidationHack=false disableUploadTimeout=true / !-- Note : To disable connection timeouts, set connectionTimeout value to -1 -- !-- Define a SSL Coyote HTTP/1.1 Connector on port 8443 -- Connector className=org.apache.coyote.tomcat4.CoyoteConnector port=8443 minProcessors=5 maxProcessors=75 enableLookups=false acceptCount=100 debug=0 scheme=https secure=true useURIValidationHack=false disableUploadTimeout=true Factory className=org.apache.coyote.tomcat4.CoyoteServerSocketFactory clientAuth=false protocol=TLS / /Connector -- snip Host name=james_laptop debug=0 appBase=webapps unpackWARs=true Logger className=org.apache.catalina.logger.FileLogger directory=logs prefix=localhost_log. suffix=.txt timestamp=true/ Context path= docBase=MyApp debug=0 reloadable=true Logger className=org.apache.catalina.logger.FileLogger prefix=james_laptop_log. suffix=.txt timestamp=true/ Manager className=org.apache.catalina.session.PersistentManager debug=0 saveOnRestart=true maxActiveSessions=-1 minIdleSwap=-1 maxIdleSwap=-1 maxIdleBackup=-1 Store className=org.apache.catalina.session.FileStore/ /Manager /Context /Host - 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] -- Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Powered by telstra.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: RE : Lb_factor didn't work as expected
Hi there, Instead of worker.tomcat1.lbfactor=1 try worker.tomcat1.lb_factor=1 in any event, observer the jk2status page while your app is under load - it will help you understand what is happening. Kwong. -Original Message- From: LAGALISSE Eric [mailto:[EMAIL PROTECTED] Sent: Sunday, 23 March 2003 0:14 To: Tomcat Users List Subject: RE : Lb_factor didn't work as expected Yes, we are using the worker MPM and the behavior mentionned in my initial mail if we use the same lb_factor value 1. Eric LAGALISSE -Message d'origine- De : Bill Barker [mailto:[EMAIL PROTECTED] Envoyé : samedi 22 mars 2003 09:59 À : [EMAIL PROTECTED] Objet : Re: Lb_factor didn't work as expected Which MPM are you using? AFAIK, the load balancing only works currently with the 'worker' MPM. LAGALISSE Eric [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] After several test using mod_jk 2.0.43 on Linux with apache 2.0.43 we noticed that if we define workers.properties as follow the load balancing send to both tomcat server but not in the same ratio. For example if we stress with 100 users, 80 are routed to the first tomcat server declared in workers.properties and 20 are routed to the second. So if soemone on this small planet already configured and tested SUCCESSFULLY the load balancing we'll very interested in his experience on this subject. # Workers.properties ps=/ worker.list=infonetworker # # First tomcat server # worker.tomcat1.port=8112 worker.tomcat1.host=clos1030.casden.fr worker.tomcat1.type=ajp13 worker.tomcat1.cachesize=10 worker.tomcat1.cache_timeout=600 worker.tomcat1.socket_keepalive=0 worker.tomcat1.socket_timeout=300 # # Specifies the load balance factor when used with # a load balancing worker. # Note: # lbfactor must be 0 # Low lbfactor means less work done by the worker. worker.tomcat1.lbfactor=1 # # Second tomcat server # worker.tomcat2.port=8112 worker.tomcat2.host=clos1032.casden.fr worker.tomcat2.type=ajp13 worker.tomcat2.cachesize=10 worker.tomcat2.cache_timeout=600 worker.tomcat2.socket_keepalive=0 worker.tomcat2.socket_timeout=300 # # Specifies the load balance factor when used with # a load balancing worker. # Note: # lbfactor must be 0 # Low lbfactor means less work done by the worker. worker.tomcat2.lbfactor=1 # # Load Balancer worker # # # The loadbalancer (type lb) worker performs weighted round-robin # load balancing with sticky sessions. # Note: # If a worker dies, the load balancer will check its state #once in a while. Until then all work is redirected to peer #worker. worker.infonetworker.type=lb worker.infonetworker.balanced_workers=tomcat1, tomcat2 # # END workers.properties # Eric LAGALISSE - 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] Powered by telstra.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Convenience on using apache+tomcat vs tomcat alone
Hi there, I guess it's fine if you are using one tomcat instance; You will need webserver(s) with mod jk/jk2 for loadbalancing and failover when using multiple instances Kwong. -Original Message- From: Simone Chiaretta [mailto:[EMAIL PROTECTED] Sent: Thursday, 13 March 2003 20:32 To: Tomcat User List Subject: Convenience on using apache+tomcat vs tomcat alone Hello All, I'm in the process of setting up a real-production server to serve a dynamic jsp driven website. And I'm facing the decision if using tomcat alone or apache+jk+tomcat. From what I've read on the ML I think that is best to use tomcat alone because I've got a completely dynamic web site, with just a few graphical images and not static html pages... so I think that the double step of apache that ask tomcat to give me a response is just a performance degradation... Are my thoughts right? or am I missing something? or maybe using JK2 instead of JK will give me benefetis even if the site is fully jsp driven? Thank you all Simone - Simone Chiaretta www.piyosailing.com/S Any sufficiently advanced technology is indistinguishable from magic - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Powered by telstra.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: three tiers on three machines: Apache, Tomcat, DB
There is hope! I have been able to run up : multiple apache instances on one tier, talking to multiple tomcat instances on another tier, with a load balancer sitting in front of the websevers. using solaris 8, apache 2.0.43, tomcat 4.1.18 After you define your channels and workers, eg # Define channels [channel.socket:channel1] port=2111 host=apphost1 tomcatId=tc1 [channel.socket:channel2] port=2112 host=apphost2 tomcatId=tc2 # Define workers [ajp13:worker1] channel=channel.socket:channel1 [ajp13:worker2] channel=channel.socket:channel2 you can then define a loadbalancer worker : [lb:LBworker] attempts=1 recovery=30 timeout=0 worker=ajp13:worker1 worker=ajp13:worker2 after that, configure your URI directives to send dynamic traffic to the LBworker : # Uri mapping [uri:/*.jsp] worker=lb:LBworker [uri:/*.do] worker=lb:LBworker Of course if you have any firewalls between your webserver and your app servers, they will need to be configured to let traffic through.. in this example, tcp/ip on ports 2111 , 2112. Good luck! Kwong. -Original Message- From: Mark Eggers [mailto:[EMAIL PROTECTED] Sent: Friday, 14 March 2003 6:56 To: Tomcat Users List Subject: Re: three tiers on three machines: Apache, Tomcat, DB Terence, I've never done this, and I don't have three machines to test this on. However, this is how I would approach things: # # workers2.properties # replace hostname with your host name for Tomcat # replace ip_address with your host ip address for # Tomcat # [channel.socket:hostname:8009] port = 8009 host = ip_address # define the worker [ajp13:hostname:8009] channel=channel.socket:hostname:8009 # map a URI [uri:/examples/*.jsp] worker=ajp13:hostname:8009 # # jk2.properties # # Socket configuration # handler.list=request,container,channelSocket # # socket configuration # channelSocket.port=8009 channelSocket.address=ip_address channelSocket.maxPort=port+10 !-- JNDI stuff see the following in the documentation and replace localhost with the name or ip address of your database server. This should get remote database connections up and running http://localhost:8080/tomcat-docs/jndi-datasource-examples-howto.html -- There are a few issues that I'm not sure about. One is how to get the URIs correct when a request is forwarded from your Apache host to the Tomcat host. Does this happen automatically, or do you need to do some URI rewriting? Also, lacing static and dynamic pages together might get interesting. I would imagine that you would need to create the same site structure on both machines so that html, images, css files, jsp files, and servlets can 'find' each other. Just some thoughts - hope this gets you started. /mde/ just my two cents . . . . __ Do you Yahoo!? Yahoo! Web Hosting - establish your business online http://webhosting.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Powered by telstra.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Play the key ctr + c in any directions, the server(Tomcat4.x) will be shutdow
Try ./catalina.sh start Kwong. -Original Message- From: deep blue [mailto:[EMAIL PROTECTED] Sent: Wednesday, 12 March 2003 13:58 To: [EMAIL PROTECTED] Subject: Play the key ctr + c in any directions, the server(Tomcat 4.x) will be shutdow I'm using Tomcat 4.x for soloris sparc. When tomcat is running(using command:nohup catalina.sh run ), if I play the key ctr + c in any directions or close the telnet terminal, the server will be shut down. I don't know what causes it? Please help me. _ ÏíÓÃÊÀ½çÉÏ×î´óµÄµç×ÓÓʼþϵͳ¡ª MSN Hotmail¡£ http://www.hotmail.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Powered by telstra.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Problems configuring Tomcat with Apache using mod_jk2
Looks like you need (assuming you don't already have) a [uri:/examples] worker=worker in your workers2.properties file to tell apache to forward such requests to tomcat.. hope this helps Kwong. -Original Message- From: David Godfrey [mailto:[EMAIL PROTECTED] Sent: Wednesday, 5 March 2003 3:36 To: '[EMAIL PROTECTED]' Subject: Problems configuring Tomcat with Apache using mod_jk2 Hi, I'm having problems when trying to use Tomcat and Apache HTTP server together, with mod_jk2. I have built Apache from the source, installed Tomcat 4.1.18, and tested each individually (they seem to function correctly). When I add in mod_jk2, both Apache and Tomcat still start and function correctly, but there does not appear to be any redirection taking place, (I can access http://localhost:8080/examples for, but not http://localhost/examples). When I examine error_log in APACHE_HOME/logs, there are the following 2 entries, but nothing that (to me) indicates an error: Apache/2.0.43 (Unix) mod_jk/1.2.1 configured -- resuming normal operations File does not exist: /opt/apache/htdocs/examples The error/log file I have defined in httpd.conf for mod_jk2 is created when I start Apache / Tomcat, but is empty. I am running Solaris 2.8, Apache 2.0.43, Tomcat 4.1.18, and Java 1.4.1. I would really appreciate some ideas on how I could solve this problem. Many thanks, D Powered by telstra.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: how can I disable directory listing at client side
Hmmm should have thought to check this out earlier.. it looks like tomcat is indeed processing the request. But given that there is no uri directive governing the forwarding of /images/ would it be a bug then that it is forwarded to tomcat? -Original Message- From: Tam, Michael [mailto:[EMAIL PROTECTED] Sent: Thursday, 27 February 2003 9:50 To: 'Tomcat Users List' Subject: RE: how can I disable directory listing at client side The listing maybe coming from tomcat itself. Make sure you disable tomcat directory listing as well. -Original Message- From: Kwong Chong [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 26, 2003 2:31 PM To: [EMAIL PROTECTED] Subject: RE: how can I disable directory listing at client side Hmm I have a similar problem that's been bugging me - The way I normally disable directory listing is to remove the Options Indexes option from the Directory directive, ending up with Directory / Options FollowSymLinks AllowOverride None /Directory With apache running alone, this all works fine, if you try to get a directory listing, you get a forbidden message - everything a ok! When I then configure apache to use modjk2, and to auto forward dynamic pages to the application server, ie adding DirectoryIndex index.jsp index.html in httpd.conf, and [uri:/*.jsp] worker=lb:workerLB in workers2.properties, Everything seems to work fine; dynamic pages work etc, but I can now get directory listings! When I change DirectoryIndex to just DirectoryIndex index.html directory listing is disabled again, or when I remove the [uri:/*.jsp] worker=lb:workerLB from workers2.properties, directory listing is disabled too! Any ideas? Kwong. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, 26 February 2003 8:22 To: [EMAIL PROTECTED] Subject: RE: how can I disable directory listing at client side Do it in your apache httpd.conf Regards, PQ This Guy Thinks He Knows Everything This Guy Thinks He Knows What He Is Doing -Original Message- From: runu rathi [mailto:[EMAIL PROTECTED] Sent: February 25, 2003 3:33 PM To: [EMAIL PROTECTED] Subject: how can I disable directory listing at client side Hi all, How can I disable the directory listing to be shown when someone tries to load my application remotely through a browser? I shall appreciate any help. Thanks, Runu __ Do you Yahoo!? Yahoo! Tax Center - forms, calculators, tips, more http://taxes.yahoo.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Powered by telstra.com - 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] Powered by telstra.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Load Balanced Tomcat freezing under high load
Hi, this problem will probably be due partly to the round robin load balancing in the modjk2 connector, as well as the application trying to process too many requests at one time (context switching), if you are using the sun jdk1.4, that might cause problems as well. With round robin load balancing, as soon as you start receiving load faster than you can process them, you will start seeing problems where the slower workers tend to receive more and more requests in their queue; the more requests they try to process at once, the slower they become (due to context switching etc), and the slower they become the longer their queue gets, etc etc. One way to get around this might be to set limits on tomcat (tomcat experts help me out here) lower the setting on maxprocessors and the accept count so that the worker will reject new settings before it gets more than it can handle. I have also experienced a problem using the sun jdk1.4 where occasionally a worker will go into a state where it just about uses up as much cpu as the system will allow it and stop responding - checking out the process shows it makes a HUGE number of system calls; truss would show a lot of lwp_suspend lwp_continue lwp_kill lwp_mutex_wakeup lwp_mutex_lock lwp_cond_wait lwp_cond_signal lwp_cond_broadcast I've yet to get to the bottom of this ... but when this happens nothing short of a restart of the process seems to help. Hope this helps, Kwong -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, 27 February 2003 7:35 To: [EMAIL PROTECTED] Subject: Load Balanced Tomcat freezing under high load Hi all.. we're running Apache 2.0.44, mod_jk2 2.0.2 and Tomcat 4.0.6 (all compiled from source) load-balanced across 4 machines. Occasionally (usually at peak times) one of the systems (usually the first one listed in the workers2.properties) will freeze up and the CPU will go through the roof. 'top' shows that its one particular java process consuming 99% of the CPU. (I think it's one of the first ones spawned when tomcat is started). At this point the Apache hits it's MaxClients (512) and the site goes down, despite the other Tomcat workers being alive and well. I'm pretty sure it's not an Apache problem as I just upgraded from 1.3.27/mod_jk-1.2 last night and the problem has happened again twice today. I'm getting a lot of these in the Apache error log: --- error_log [Wed Feb 26 01:22:47 2003] [error] jk2_init() Can't find child 26949 in scoreboard [Wed Feb 26 01:22:47 2003] [error] mod_jk child workerEnv in error state 3 [Wed Feb 26 01:22:47 2003] [error] mod_jk child init 1 -2 [Wed Feb 26 01:22:49 2003] [error] mod_jk child workerEnv in error state 3 [Wed Feb 26 01:22:50 2003] [error] mod_jk child workerEnv in error state 3 --- etc..etc and a few of these when the site got busier: --- [Wed Feb 26 10:30:04 2003] [error] Error ajp_process_callback - write failed [Wed Feb 26 10:30:04 2003] [error] ajp13.service() ajpGetReply recoverable error 3 [Wed Feb 26 10:30:04 2003] [error] Error ajp_process_callback - write failed [Wed Feb 26 10:30:04 2003] [error] ajp13.service() ajpGetReply recoverable error 3 [Wed Feb 26 10:30:04 2003] [error] ajp13.service() Error forwarding ajp13:jvm1:8009 1 0 [Wed Feb 26 10:30:04 2003] [error] mod_jk.handler() Error connecting to tomcat 3 [Wed Feb 26 10:30:13 2003] [error] mod_jk child init 1 0 -- etc etc.. I'm also seeing a lot of these in the catalina_log on the Tomcat workers: -- 2003-02-26 09:50:51 Ajp13Processor[8009][133] process: invoke java.net.SocketException: Socket closed at java.net.SocketOutputStream.socketWrite0(Native Method) at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92) at java.net.SocketOutputStream.write(SocketOutputStream.java:126) at org.apache.ajp.Ajp13.send(Ajp13.java:525) at org.apache.ajp.RequestHandler.finish(RequestHandler.java:501) at org.apache.ajp.Ajp13.finish(Ajp13.java:395) at org.apache.ajp.tomcat4.Ajp13Response.finishResponse(Ajp13Response.java:196) at org.apache.ajp.tomcat4.Ajp13Processor.process(Ajp13Processor.java:464) at org.apache.ajp.tomcat4.Ajp13Processor.run(Ajp13Processor.java:551) at java.lang.Thread.run(Thread.java:536) - Beyond that, the logs don't tell me much. Anyway, sorry for the huge length of this e-mail; if anyone has any suggestions it would be a huge help. Thanks! -Mike netguru at ipudev dot com workers2.properties [shm] file=/usr/local/apache/logs/shm.file size=4194304 [channel.socket:jvm2:8009] port=8009 host=192.168.0.31 group=lb lb_factor=1 disabled=0 route=jvm2 [channel.socket:jvm1:8009] port=8009 host=192.168.0.30 group=lb lb_factor=1 disabled=0 route=jvm1 [channel.socket:jvm3:8009] port=8009 host=192.168.0.32 group=lb lb_factor=1 disabled=0 route=jvm3 [channel.socket:jvm4:8009] port=8009 host=192.168.0.33