  | Mailing List | | Home | | Forum Home | | JBoss - Java Application Server | | Struts - A MVC web framework | | Tomcat - JSP/Servlet container | | iText - An open source PDF Java Library | | JDOM - JDOM XML Parser | | J2EE - A mailing list for Java(tm) 2 Platform, Enterprise Edition | | J2EE Pattern - An interest list for Sun Java Center J2EE Pattern Catalog | | Servlet - A mailing list for discussion about Sun Microsystem's Java Servlet API Technology | | JSP - A mailing list about Java Server Pages specification and reference | |
Struts & Hibernate
|
|
|
  | | | Apache2 + Tomcat4 + mod_jk2 success | Apache2 + Tomcat4 + mod_jk2 success 2004-01-04 - By Ian Harwood
Back Hi Having succeeded in getting jk2_mod to work thought I would document what I did My setup Linux RH9 basic setup, httpd-2 (See http://tpd-2.ora-code.com).0.48 installed from source NOT RPM, tomcat-4 (See http://cat-4.ora-code.com).1.29, ant-1 (See http://ant-1.ora-code.com).5.4 The following was setup in /etc/profile JAVA_HOME="/usr/java/java" CATALINA_HOME="/usr/local/tomcat" PATH="$JAVA_HOME/bin:$PATH:$HOME/bin:/sbin:/usr/sbin" CLASSPATH="$CATALINA_HOME/bin/bootstrap.jar:$JAVA_HOME/lib/tools.jar:$CATALI NA_HOME/common/lib/servlet.jar" Add the following to the EXPORT line JAVA_HOME CATALINA_HOME CLASSPATH You will need to logout/login or restart to set the environment
Install Apache2 from source make sure you enable dynamic loading by adding --enable-so I also like to add --enable-mods-shared=most Ie ./configure --enable-so --enable-mods-shared=most I installed into the default directory (/usr/local/apache2)
Install tomcat nothing unusual here I placed mine in "/usr/local/jakarta-tomcat-4 (See http://cat-4.ora-code.com).1.29" and made a symbolic link from /usr/local/tomcat
Test both are working OK then stop both
Now for the JK2 connector Download the connector source from CVS this was the only way I could get all the files needed "cvs -d :pserver:anoncvs@(protected):home/cvspublic checkout jakarta-tomcat-connectors" This will download all files into a director "jakata-tomcat-connectors" below the current directory This brings down all connectors the one we need is in "jakata-tomcat-connectors/jk/native2" Have a read of the "readme.txt" file from this we can see we need to download 2 more files (APR, APR-UTILS) the locations are given I placed mine in "/jakata-tomcat-connectors/jk/native2/apr"
Run buildconf ./buildconf
Before we can go further we have to modify two of the source files "jk_channel_socket.c" and "jk_pool.c" Both the files are in "jk/native2/common" Jk_channel_socket.c find "#error "jk_channel_socket is deprecated" line74 just after copyright notice Remove this line Jk_pool.c find "#error "jk_pool is deprecated" line64 just after copyright notice Remove this line
Run configure We need to add some parameters to configure: ./configure --with-apxs2=/usr/local/apache2/bin/apes --with-tomcat41=/usr/local/tomcat --with-java-home=/usr/java/java --with-jni Change all paths to suit your system Hopefully all will go well
Run Make ./make
At the end of make you will see a message about running libtools for me it was Libtool --finish /usr/local/apache2/modules This did not work for me I just copied mod_jk2.so from "/jk/build/jk2/apache2" to /usr/local/apache2/modules And libjkjni.so to "/usr/local/tomcat/server/lib"
Make sure apache and tomcat are not running File jk2.properties /usr/local/tomcat/conf/jk2.properties handler.list=channelSocket,request channelSocket.port=8009 channelSocket.address=127.0.0.1
File httpd.conf /usr/local/apache2/conf/httpd.conf Add LoadModule jk2_module modules/mod_jk2.so
File workers2.properties /usr/local/apache2/conf/workers2.properties [shm] file=/usr/local/apache2/logs/jk2.shm size=1048576 debug=0 Disabled=0
[channel.socket:localhost:8009]
[status:status] [uri:/jkstatus/*] group=status:status
[uri:/examples/*] Info=map the entire "examples" webapp Debug=0
[uri:/tomcat-docs/*]
You will need to add uri for all the webapps you use
OK time to test all this Start tomcat first can be a bit slow to start give a little time Start apache2 Goto http://localhost you should get default apache2 goto http://localhost:8080 you should get default tomcat page Goto http://localhost/examples you should get tomcat directory listing if so all done
I hope this works for you I have not tested this greatly so may still be thinks missing Ian
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------ To unsubscribe, e-mail: tomcat-user-unsubscribe@(protected) For additional commands, e-mail: tomcat-user-help@(protected)
|
|
 |