Linux Installing APR and Tomcat Native Library on Tomcat 7.0

Key notes:

  1. The objective: install APR and Tomcat Native Library on Tomcat 7.0.41.  I am using Icetea java 1.6 open JDK as when I download JAVA from Oracle, it has rt.jar missing on 1.6 and 1.7
  2. The linux platform is RHEL 6.3
  3. I download and compile tar source of APR (1.5) and APR util (1.5.3).  I found that when I use yum install, the apr library is incompleted.
  4. Need to yum install java openjdk.  I am using 1.6.
  5. Untar APR and follow readme to configure and compile.  make && make install
  6. Follow this (Eng) and this (S.Chi) to configure, compile and install Tomcat Native Library
  7. The command I use is: ./configure --with-apr=/usr/local/apr --with-java-home=/usr/lib/jvm/java-openjdk/
  8. In setenv.sh (under <tomcat_dir>/bin, if not exists, create one), I set the following: 
    1. export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/apr/lib
    2. JAVA_HOME=/usr/lib/jvm/java-openjdk
    3. CLASSPATH=$CLASSPATH:/usr/local/tomcat7/webapps/
    4. CATALINA_OPTS="-server -Xms6G -Xmx6G $CATALINA_OPTS -XX:+UseConcMarkSweepGC -XX:+UseParNewGC"
  9. Notice in LD_LIBRARY_PATH, you need to "define the path of APR", but this sentence is misleading.  What you really need is to "define the lib path of APR", so it is /usr/local/apr/lib, not /usr/local/apr
  10. Restart tomcat and you should be fine.

Comments

Popular posts from this blog

TCPDF How to show/display Chinese Character?

How to fix fancy box/Easy Fancybox scroll not work in mobile

Wordpress Load balancing: 2 web servers 1 MySQL without any Cloud services