Tomcat 安装APR的问题
APR、APR-util、APR-iconv安装都正常
apr安装命令:
./configure
make
make install
apr-util
./configure --with-apr=/usr/local/apr/bin/apr-1-config
make
make install
apr-iconv(可选)
./configure --with-apr=/usr/local/apr/bin/apr-1-config
make
make install
然后到$Tomcat_home/bin
解压tomcat-native.tar.gz
进入tomcat-native-1.1.x/jni/native/
执行命令
./configure --with-apr=/usr/local/apr/bin/apr-1-config
出错:
configure:error:can't locate a valid JDK location
但是我机器上有安装JDK并且配置了JAVA_HOME,网上搜资料后发现此程序只会到以下默认的目录寻找JDK:
02.configure: [/ usr/local/1.6.1]
03.configure: [/ usr/local/IBMJava2-1.6.0]
04.configure: [/ usr/local/java1.6.0]
05.configure: [/ usr/local/java-1.6.0]
06.configure: [/ usr/local/jdk1.6.0]
07.configure: [/ usr/local/jdk-1.6.0]
08.configure: [/ usr/local/1.6.0]
09.configure: [/ usr/local/IBMJava2-1.6]
10.configure: [/ usr/local/java1.6]
11.configure: [/ usr/local/java-1.6]
12.configure: [/ usr/local/jdk1.6]
13.configure: [/ usr/local/jdk-1.6]
于是乎,建个链接到我的jdk目录
ln -s /usr/java/jdk1.7.0_25 /usr/local/jdk-1.6
继续安装
./configure --with-apr=/usr/local/apr/bin/apr-1-config
make
make install
到此安装成功。
设置环境变量
set LD_LIBRARY_PATH=/usr/local/apr/lib
export LD_LIBRARY_PATH
最后将链接库加入JRE中
ln -s /usr/local/apr/lib/libtcnative-1.so /usr/java/jdk1.7.0_25/jre/lib/libtcnative-1.so
重启Tomcat后APR安装完成