mod_jk2 configuration problems
Hi, I am trying to implement load balancing with the Apache + mod_jk2 + Tomcat setup. I configured jsp_examples application for clustering, it worked perfectly. But my webapp is not working. 1. Round robin behavior worked almost perfectly with jsp-examples, but not with my application 2. The session is not sticky though I set stickySession=1 in workers2.properties Here's my workers2.properties, any help is highly appreciated. # Usually commented out [logger.apache2] file=F:\ApacheGroup\Apache\logs\error.log level=ERROR #provide the basic config needed [config] file=F:\ApacheGroup\Apache\logs\error.log debug=1 #provide the lcoation of shm file on the Apache server file=F:\ApacheGroup\Apache\conf\jk2.shm size=100 #Tomcat5A [channel.socket:dmsqmp:8009] host=dmsqmp port=8009 tomcatId=Tomcat5A group=balanced lb_factor=1 route=Tomcat5A #Tomcat5A worker [ajp13:dmsqmp:8009] channel=chanel.socket:Tomcat5A #Tomcat5B [channel.socket:localhost:8009] host=localhost port=8009 tomcatId=Tomcat5B group=balanced lb_factor=1 route=Tomcat5B #Tomcat5B worker [ajp13:localhost:8009] channel=chanel.socket:Tomcat5B #Load balancer worker [lb:balanced] worker=ajp13:localhost:8009 worker=ajp13:dmsqmp:8009 timeout=30 attempts=2 recovery=90 stickySession=1 noWorkersMsg=Server Busy please try after some time. noWorkerCodeMsg=503 #URI Mapping [uri:/qwaf/*] info=Mappings for the Tomcat context jsp-examples context=/qwaf group=balanced #Define a status worker to test the run-time request behaviour to the all workers [status:] #Status URI mapping [uri:/jkstatus/*] group=status Regards, Srinivas
Re: Apache2, Tomcat5 and mod_jk2 configuration problems
At 12:16 PM 24/06/2004 +0800, you wrote: Hi Ryan, I should have asked this earlier, but are you using the RPM version of Apache or compiling the source tarball ? I notice that your directory is /usr/local, which indicates that you are probably using the source tarball (for RH9 rpms, it would be /etc/httpd). If you are using the source tarball, there are a LOT of things that are different. I believe you are missing a package, hence the gdbm error. I cannot recall at the moment what the name of the package is -- can you do a search on rpmfind ? Another thing: apxs is located inside /usr/local/httpd-2.0.49 -- just do a find /usr/local/httpd-2.0.49 -name apxs to locate it. Did you do a Minimal install for Red Hat ? You will need to ensure that you have the necessary packages installed. See this for a short list : http://cymulacrum.net/writings/tomcat5/c875.html#JK2_INTEGRATION_SETUP You probably don't need apr and apr-util because you installed Apache from source. As promised, here are my notes on installing mod_jk2 with Apache 2.0.49 and Tomcat 5.0.25. This is under RedHat 9.0 and the paths and things are a straight cut and paste from my system here, so may not match up for all accounts. Key problem I had was the libraries, once that was figured out it was some minor typos in the configuration files, and then its all up and going now. Cheers, Ryan. Notes -- mod_jk2 (tomcat connector) Download mod_jk2 http://apache.ausgamers.com/jakarta/tomcat-connectors/jk2/source/jakarta-tomcat-connectors-jk2-2.0.4-src.tar.gz Check the http://apache.ausgamers.com/jakarta/tomcat-connectors/jk2/ page for information/status on mod_jk2 Uncompress the archive gzip -dc jakarta-tomcat-connectors-jk2-2.0.4-src.tar.gz | tar -xvf - Compile cd to /usr/local/src/jakarta-tomcat-connectors-jk2-2.0.4-src/jk/native2 ./configure --with-apxs2=/usr/local/httpd/bin/apxs --with-apr-lib=/usr/lib --with-tomcat-41=/usr/local/tomcat --with-java-home=/usr/java/jdk --with-jni edit ./server/apache2/Makefile Find the block -- ifdef APR_LIBDIR_LA JK_LDFLAGS=-L${APACHE2_LIBDIR} -lcrypt else JK_LDFLAGS=-lcrypt ${APR_LIBS} endif And change it to this: ifdef APR_LIBDIR_LA JK_LDFLAGS=-L${APACHE2_LIBDIR} -lcrypt else JK_LDFLAGS=-lcrypt ${APR_LIBS} JK_LDFLAGS=-lcrypt ${APR_LIBS} -L/usr/local/httpd-2.0.49/lib -laprutil-0 -lgdbm -ldb-4.0 -lexpat endif Note the extra LDFLAGS -- JK_LDFLAGS=-lcrypt ${APR_LIBS} -L/usr/local/httpd-2.0.49/lib -laprutil-0 -lgdbm -ldb-4.0 -lexpat To know what flags to add, run apu-config --link-ld --libs That will output something like -L/usr/lib -laprutil-0 -lgdbm -lexpat Then check the version of apu-config. I discovered that I had two versions. One in /usr/bin and another in /usr/local/httpd/bin/ /usr/bin/apu-config --link-ld --libs -L/usr/lib -laprutil-0 -lgdbm -lexpat /usr/local/httpd/bin/apu-config --link-ld --libs -L/usr/local/httpd/bin -laprutil-0 -lgdbm -ldb-4.2 -lexpat When I tried adding the -ldb-4.2 flag it didn't like it, so I did a bit of a search and tried -L/usr/local/httpd/bin -laprutil-0 -lgdbm -ldb-4.0 -lexpat instead which worked. (I think the path for db-4.2 may need to be added to my /etc/ld.so.conf file?) cd ../build/jk2/apache2 Run apxs /usr/local/httpd/bin/apxs -n jk2 -i mod_jk2.so Should see something like: [EMAIL PROTECTED] apache2]# /usr/local/httpd/bin/apxs -n jk2 -i mod_jk2.so /usr/local/httpd-2.0.49/build/instdso.sh SH_LIBTOOL='/usr/local/httpd-2.0.49/build/libtool' mod_jk2.so /usr/local/httpd-2.0.49/modules /usr/local/httpd-2.0.49/build/libtool --mode=install cp mod_jk2.so /usr/local/httpd-2.0.49/modules/ cp mod_jk2.so /usr/local/httpd-2.0.49/modules/mod_jk2.so Warning! dlname not found in /usr/local/httpd-2.0.49/modules/mod_jk2.so. Assuming installing a .so rather than a libtool archive. chmod 755 /usr/local/httpd-2.0.49/modules/mod_jk2.so Copy the created share object modules to the apache module directory cp libjkjni.so
Apache2, Tomcat5 and mod_jk2 configuration problems
Greetings, I have a problem. I am trying to get Tomcat (5.0.25), Apache (2.0.49) and mod_jk2 (2.0.4) all to talk to each other under RedHat 9.0. So far I can get Apache up and working on port 80 and Tomcat works fine on port 8080. However, my users want to be able to use .jsp pages on their virtual hosts. I did have it working fine on the old machine we had (Redhat 7.3, Apache 1.3, Tomcat 4 and mod_jk) but we upgraded and now its not working. One thing I have noticed is when Tomcat starts up there is the message: INFO: APR not loaded, disabling jni components: java.io.IOException: java.lang.UnsatisfiedLinkError: /usr/local/httpd-2.0.49/modules/jkjni.so: /usr/local/httpd-2.0.49/modules/jkjni.so: undefined symbol: apr_md5_final I assumed I was getting this because Apache was not compilied in with apr support, so I recompiled it with --with-apr and --with-apr-util. Apache still works, but when I tried to recompile mod_jk2 it tells me now that my apxs can not be found, even though prior it was finding it ok and its quite clearly in the location specified. I'm not sure if that is a critical error or not or how to overcome it. I have been trying different compile options, but still not getting much luck. When you click on a .jsp page, all that happens is the browser just sits there continually loading. In the tomcat logs you get a line which says INFO: No next and thats it. Can anyone shed some light on my problem, before I do physical harm to the box in question. The configuration files are as follows: Also, can I have .jsp files enabled for some virtual servers and not for others, or is it an all or nothing affair? --worker2.properties # workers2.properties # Shared memory handling. Needs to be set. [shm] info=Scoreboard. Required for reconfiguration and status with multiprocess servers file=/usr/local/tomcat/logs/jk2.shm size=1048576 debug=0 disabled=0 #UNIX domain socket [channel.un:/usr/local/tomcat/work/jk2.socket] tomcatId=localhst:8009 debug=0 # define the worker #[ajp13:/usr/local/tomcat/work/jk2.socket] #chanel=channel.un:/usr/local/tomcat/work/jk2.socket [ajp13:localhost:8009] channel=channel.socket:localhost:8009 # Announce a status worker pstatus:status] info=Status worker. Displays runtime information. [uri:/jkstatus/*] group=status:status # Uri mapping [uri:/examples/*] [uri:projects.csse.uwa.edu.au/*.jsp] worker=ajp13:localhost:8009 [uri:perth-agentcity.csse.uwa.edu.au/*.jsp] worker=ajp13:localhost:8009 ---jk2_mod.conf (included in the apache.conf file)-- # Sample mod_jk2.conf 08-Feb-2004, located at: # http://www.gknw.com/development/apache/docs/win32/mod_jk2/mod_jk2x.conf # # Load the mod_jk2 module # LoadModule jk2_module modules/mod_jk2.so IfModule mod_jk2.c #--- # Set the Apache2 logger level #--- # JkSet2 logger level debug #--- # Set the alternate log file #--- # JkSet2 logger.file:0 file ${serverRoot}/logs/jk2.log JkSet2 logger.file:0 level debug #--- # Set the scoreboard file #--- # JkSet2 shm: file ${serverRoot}/logs/jk2.shm JkSet2 shm: size 1048576 #--- # Where to find the workers2.properties file #--- # #JkSet config.file ${serverRoot}/conf/workers2.properties #--- # Alternatively setup the workers here #--- # JkSet2 channel.socket:localhost:8009 info Ajp13 forwarding over socket JkSet2 status: info Status worker, displays runtime information JkSet2 workerEnv: logger logger.file:0 #--- # Configure the /jkstatus handler #--- # Location /jkstatus JkUriSet group status: JkUriSet info Map the /jkstatus handler to the Web server uri space /Location #--- # Configure Tomcat Example Applications #--- # Location /examples JkUriSet group lb:lb JkUriSet info Map the Tomcat examples to the Web server uri space /Location #--- # Configure Tomcat Documentation #--- # Location /tomcat-docs JkUriSet group lb:lb JkUriSet info Map the Tomcat docs to the Web server uri space
Re: Apache2, Tomcat5 and mod_jk2 configuration problems
Hi Ryan, It sounds like an error similar to one Andrew Clute encountered on Red Hat Enterprise Linux 3 (apr_md5_final). I transcribed some of the steps he took here : http://cymulacrum.net/writings/tomcat5/a1375.html Can you test it first ? If it works, I would like to add a comment to the document that says that the steps apply to Red Hat 9 as well. Regards, pascal chong Ryan McConigley wrote: Greetings, I have a problem. I am trying to get Tomcat (5.0.25), Apache (2.0.49) and mod_jk2 (2.0.4) all to talk to each other under RedHat 9.0. So far I can get Apache up and working on port 80 and Tomcat works fine on port 8080. However, my users want to be able to use .jsp pages on their virtual hosts. I did have it working fine on the old machine we had (Redhat 7.3, Apache 1.3, Tomcat 4 and mod_jk) but we upgraded and now its not working. One thing I have noticed is when Tomcat starts up there is the message: INFO: APR not loaded, disabling jni components: java.io.IOException: java.lang.UnsatisfiedLinkError: /usr/local/httpd-2.0.49/modules/jkjni.so: /usr/local/httpd-2.0.49/modules/jkjni.so: undefined symbol: apr_md5_final I assumed I was getting this because Apache was not compilied in with apr support, so I recompiled it with --with-apr and --with-apr-util. Apache still works, but when I tried to recompile mod_jk2 it tells me now that my apxs can not be found, even though prior it was finding it ok and its quite clearly in the location specified. I'm not sure if that is a critical error or not or how to overcome it. I have been trying different compile options, but still not getting much luck. When you click on a .jsp page, all that happens is the browser just sits there continually loading. In the tomcat logs you get a line which says INFO: No next and thats it. Can anyone shed some light on my problem, before I do physical harm to the box in question. The configuration files are as follows: Also, can I have .jsp files enabled for some virtual servers and not for others, or is it an all or nothing affair? --worker2.properties # workers2.properties # Shared memory handling. Needs to be set. [shm] info=Scoreboard. Required for reconfiguration and status with multiprocess servers file=/usr/local/tomcat/logs/jk2.shm size=1048576 debug=0 disabled=0 #UNIX domain socket [channel.un:/usr/local/tomcat/work/jk2.socket] tomcatId=localhst:8009 debug=0 # define the worker #[ajp13:/usr/local/tomcat/work/jk2.socket] #chanel=channel.un:/usr/local/tomcat/work/jk2.socket [ajp13:localhost:8009] channel=channel.socket:localhost:8009 # Announce a status worker pstatus:status] info=Status worker. Displays runtime information. [uri:/jkstatus/*] group=status:status # Uri mapping [uri:/examples/*] [uri:projects.csse.uwa.edu.au/*.jsp] worker=ajp13:localhost:8009 [uri:perth-agentcity.csse.uwa.edu.au/*.jsp] worker=ajp13:localhost:8009 ---jk2_mod.conf (included in the apache.conf file)-- # Sample mod_jk2.conf 08-Feb-2004, located at: # http://www.gknw.com/development/apache/docs/win32/mod_jk2/mod_jk2x.conf # # Load the mod_jk2 module # LoadModule jk2_module modules/mod_jk2.so IfModule mod_jk2.c #--- # Set the Apache2 logger level #--- # JkSet2 logger level debug #--- # Set the alternate log file #--- # JkSet2 logger.file:0 file ${serverRoot}/logs/jk2.log JkSet2 logger.file:0 level debug #--- # Set the scoreboard file #--- # JkSet2 shm: file ${serverRoot}/logs/jk2.shm JkSet2 shm: size 1048576 #--- # Where to find the workers2.properties file #--- # #JkSet config.file ${serverRoot}/conf/workers2.properties #--- # Alternatively setup the workers here #--- # JkSet2 channel.socket:localhost:8009 info Ajp13 forwarding over socket JkSet2 status: info Status worker, displays runtime information JkSet2 workerEnv: logger logger.file:0 #--- # Configure the /jkstatus handler #--- # Location /jkstatus JkUriSet group status: JkUriSet info Map the /jkstatus handler to the Web server uri space /Location #--- # Configure Tomcat Example Applications
Re: Apache2, Tomcat5 and mod_jk2 configuration problems
At 10:09 PM 23/06/2004 +0800, you wrote: Hi Ryan, It sounds like an error similar to one Andrew Clute encountered on Red Hat Enterprise Linux 3 (apr_md5_final). I transcribed some of the steps he took here : http://cymulacrum.net/writings/tomcat5/a1375.html Can you test it first ? If it works, I would like to add a comment to the document that says that the steps apply to Red Hat 9 as well. Regards, pascal chong Thanks for that. I gave that a whirl, putting in the extra library and that solved the problem of the undefined symbol apr_md5_final error, but now I'm getting the following error instead: INFO: APR not loaded, disabling jni components: java.io.IOException: java.lang.UnsatisfiedLinkError: /usr/local/httpd-2.0.49/modules/jkjni.so: /usr/local/httpd-2.0.49/lib/libaprutil-0.so.0: undefined symbol: gdbm_errno Which would appear that that linked library isn't correct. Any hints? Ryan McConigley wrote: Greetings, I have a problem. I am trying to get Tomcat (5.0.25), Apache (2.0.49) and mod_jk2 (2.0.4) all to talk to each other under RedHat 9.0. So far I can get Apache up and working on port 80 and Tomcat works fine on port 8080. However, my users want to be able to use .jsp pages on their virtual hosts. I did have it working fine on the old machine we had (Redhat 7.3, Apache 1.3, Tomcat 4 and mod_jk) but we upgraded and now its not working. One thing I have noticed is when Tomcat starts up there is the message: INFO: APR not loaded, disabling jni components: java.io.IOException: java.lang.UnsatisfiedLinkError: /usr/local/httpd-2.0.49/modules/jkjni.so: /usr/local/httpd-2.0.49/modules/jkjni.so: undefined symbol: apr_md5_final I assumed I was getting this because Apache was not compilied in with apr support, so I recompiled it with --with-apr and --with-apr-util. Apache still works, but when I tried to recompile mod_jk2 it tells me now that my apxs can not be found, even though prior it was finding it ok and its quite clearly in the location specified. I'm not sure if that is a critical error or not or how to overcome it. I have been trying different compile options, but still not getting much luck. When you click on a .jsp page, all that happens is the browser just sits there continually loading. In the tomcat logs you get a line which says INFO: No next and thats it. Can anyone shed some light on my problem, before I do physical harm to the box in question. The configuration files are as follows: Also, can I have .jsp files enabled for some virtual servers and not for others, or is it an all or nothing affair? *snip* -- Ryan McConigley - Systems Administrator _.-, Computer Science University of Western Australia.--' '-._ Tel: (+61 8) 6488 7082 - Fax: (+61 8) 6488 1089 _/`- _ '. [EMAIL PROTECTED] - http://www.csse.uwa.edu.au/~ryan ''._`.. \ ` \; You're just jealous because the voices are talking to me;_\ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Apache2, Tomcat5 and mod_jk2 configuration problems
Hi Ryan, I should have asked this earlier, but are you using the RPM version of Apache or compiling the source tarball ? I notice that your directory is /usr/local, which indicates that you are probably using the source tarball (for RH9 rpms, it would be /etc/httpd). If you are using the source tarball, there are a LOT of things that are different. I believe you are missing a package, hence the gdbm error. I cannot recall at the moment what the name of the package is -- can you do a search on rpmfind ? Another thing: apxs is located inside /usr/local/httpd-2.0.49 -- just do a find /usr/local/httpd-2.0.49 -name apxs to locate it. Did you do a Minimal install for Red Hat ? You will need to ensure that you have the necessary packages installed. See this for a short list : http://cymulacrum.net/writings/tomcat5/c875.html#JK2_INTEGRATION_SETUP You probably don't need apr and apr-util because you installed Apache from source. Regards, pascal chong Ryan McConigley wrote: At 10:09 PM 23/06/2004 +0800, you wrote: Hi Ryan, It sounds like an error similar to one Andrew Clute encountered on Red Hat Enterprise Linux 3 (apr_md5_final). I transcribed some of the steps he took here : http://cymulacrum.net/writings/tomcat5/a1375.html Can you test it first ? If it works, I would like to add a comment to the document that says that the steps apply to Red Hat 9 as well. Regards, pascal chong Thanks for that. I gave that a whirl, putting in the extra library and that solved the problem of the undefined symbol apr_md5_final error, but now I'm getting the following error instead: INFO: APR not loaded, disabling jni components: java.io.IOException: java.lang.UnsatisfiedLinkError: /usr/local/httpd-2.0.49/modules/jkjni.so: /usr/local/httpd-2.0.49/lib/libaprutil-0.so.0: undefined symbol: gdbm_errno Which would appear that that linked library isn't correct. Any hints? Ryan McConigley wrote: Greetings, I have a problem. I am trying to get Tomcat (5.0.25), Apache (2.0.49) and mod_jk2 (2.0.4) all to talk to each other under RedHat 9.0. So far I can get Apache up and working on port 80 and Tomcat works fine on port 8080. However, my users want to be able to use .jsp pages on their virtual hosts. I did have it working fine on the old machine we had (Redhat 7.3, Apache 1.3, Tomcat 4 and mod_jk) but we upgraded and now its not working. One thing I have noticed is when Tomcat starts up there is the message: INFO: APR not loaded, disabling jni components: java.io.IOException: java.lang.UnsatisfiedLinkError: /usr/local/httpd-2.0.49/modules/jkjni.so: /usr/local/httpd-2.0.49/modules/jkjni.so: undefined symbol: apr_md5_final I assumed I was getting this because Apache was not compilied in with apr support, so I recompiled it with --with-apr and --with-apr-util. Apache still works, but when I tried to recompile mod_jk2 it tells me now that my apxs can not be found, even though prior it was finding it ok and its quite clearly in the location specified. I'm not sure if that is a critical error or not or how to overcome it. I have been trying different compile options, but still not getting much luck. When you click on a .jsp page, all that happens is the browser just sits there continually loading. In the tomcat logs you get a line which says INFO: No next and thats it. Can anyone shed some light on my problem, before I do physical harm to the box in question. The configuration files are as follows: Also, can I have .jsp files enabled for some virtual servers and not for others, or is it an all or nothing affair? *snip* -- Ryan McConigley - Systems Administrator _.-, Computer Science University of Western Australia.--' '-._ Tel: (+61 8) 6488 7082 - Fax: (+61 8) 6488 1089 _/`- _ '. [EMAIL PROTECTED] - http://www.csse.uwa.edu.au/~ryan ''._`.. \ ` \; You're just jealous because the voices are talking to me;_\ - 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: Apache2, Tomcat5 and mod_jk2 configuration problems
At 12:16 PM 24/06/2004 +0800, you wrote: Hi Ryan, I should have asked this earlier, but are you using the RPM version of Apache or compiling the source tarball ? I notice that your directory is /usr/local, which indicates that you are probably using the source tarball (for RH9 rpms, it would be /etc/httpd). If you are using the source tarball, there are a LOT of things that are different. I believe you are missing a package, hence the gdbm error. I cannot recall at the moment what the name of the package is -- can you do a search on rpmfind ? Another thing: apxs is located inside /usr/local/httpd-2.0.49 -- just do a find /usr/local/httpd-2.0.49 -name apxs to locate it. Did you do a Minimal install for Red Hat ? You will need to ensure that you have the necessary packages installed. See this for a short list : http://cymulacrum.net/writings/tomcat5/c875.html#JK2_INTEGRATION_SETUP You probably don't need apr and apr-util because you installed Apache from source. I just got it working. I had installed it from source, was a library problem. Just writing up my documentation at the moment. I'll send you a copy of that when I'm done. Cheers, Ryan. -- Ryan McConigley - Systems Administrator _.-, Computer Science University of Western Australia.--' '-._ Tel: (+61 8) 6488 7082 - Fax: (+61 8) 6488 1089 _/`- _ '. [EMAIL PROTECTED] - http://www.csse.uwa.edu.au/~ryan ''._`.. \ ` \; You're just jealous because the voices are talking to me;_\ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]