Tomcat网站的文档专门有一块是介绍在Tomcat中如何使用APR库的,说白了就是如何在Tomcat中使用JNI的方式来读取文件以及进行网络传输。这个东西可以大大提升Tomcat对静态文件的处理性能,同时如果你使用了HTTPS方式 传输的话,也可以提升SSL的处理性能。 在Linux下,可以直接解压和安装bin目录下的tomcat_native.tar.gz文件,编译之前要确保apr库已经安装。
另外我属于有强迫症的一类人...看不得tomcat启动有这个提示,虽然能够正常运行...
The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path:
参考文档:http://tomcat.apache.org/native-doc/
以下是安装步骤:
[[email protected] ]# yum install apr-devel openssl-devel Loaded plugins: security base | 3.7 kB 00:00 extras | 3.3 kB 00:00 updates | 3.4 kB 00:00 Setting up Install Process Package openssl-devel-1.0.1e-16.el6_5.15.x86_64 already installed and latest version Resolving Dependencies --> Running transaction check ---> Package apr-devel.x86_64 0:1.3.9-5.el6_2 will be installed --> Finished Dependency Resolution Dependencies Resolved =============================================================================================================================================================================================== Package Arch Version Repository Size =============================================================================================================================================================================================== Installing: apr-devel x86_64 1.3.9-5.el6_2 base 176 k Transaction Summary =============================================================================================================================================================================================== Install 1 Package(s) Total download size: 176 k Installed size: 717 k Is this ok [y/N]: y Downloading Packages: apr-devel-1.3.9-5.el6_2.x86_64.rpm | 176 kB 00:00 Running rpm_check_debug Running Transaction Test Transaction Test Succeeded Running Transaction Installing : apr-devel-1.3.9-5.el6_2.x86_64 1/1 Verifying : apr-devel-1.3.9-5.el6_2.x86_64 1/1 Installed: apr-devel.x86_64 0:1.3.9-5.el6_2 Complete! [[email protected] ~]# cd /data/tomcat/bin/ [[email protected] bin]# ll total 760 -rw-r--r-- 1 root root 22833 May 19 18:50 bootstrap.jar -rw-r--r-- 1 root root 11755 May 19 18:50 catalina.bat -rwxr-xr-x 1 root root 17822 Sep 17 16:24 catalina.sh -rw-r--r-- 1 root root 2432 May 19 18:50 catalina-tasks.xml -rw-r--r-- 1 root root 24283 May 19 18:50 commons-daemon.jar -rw-r--r-- 1 root root 204944 May 19 18:50 commons-daemon-native.tar.gz -rw-r--r-- 1 root root 1278 May 19 18:50 cpappend.bat -rwxr-xr-x 1 root root 7742 May 19 18:50 daemon.sh -rw-r--r-- 1 root root 2046 May 19 18:50 digest.bat -rwxr-xr-x 1 root root 1633 May 19 18:50 digest.sh -rw-r--r-- 1 root root 3082 May 19 18:50 setclasspath.bat -rwxr-xr-x 1 root root 4171 May 19 18:50 setclasspath.sh -rw-r--r-- 1 root root 2044 May 19 18:50 shutdown.bat -rwxr-xr-x 1 root root 1570 May 19 18:50 shutdown.sh -rw-r--r-- 1 root root 2046 May 19 18:50 startup.bat -rwxr-xr-x 1 root root 2104 Sep 17 14:30 startup.sh -rw-r--r-- 1 root root 32403 May 19 18:50 tomcat-juli.jar -rw-r--r-- 1 root root 384311 May 19 18:50 tomcat-native.tar.gz -rw-r--r-- 1 root root 3410 May 19 18:50 tool-wrapper.bat -rwxr-xr-x 1 root root 3410 May 19 18:50 tool-wrapper.sh -rw-r--r-- 1 root root 2050 May 19 18:50 version.bat -rwxr-xr-x 1 root root 1575 May 19 18:50 version.sh [[email protected] bin]# tar xf tomcat-native.tar.gz [[email protected] bin]# ll drwxrwxr-x 3 10848 10848 4096 Apr 10 18:37 tomcat-native-1.1.30-src -rw-r--r-- 1 root root 384311 May 19 18:50 tomcat-native.tar.gz [[email protected] bin]# cd tomcat-native-1.1.30-src/jni/native/ [[email protected] native]# ll total 252 drwxrwxr-x 3 10848 10848 4096 Apr 10 18:37 build -rwxrwxr-x 1 10848 10848 2581 Feb 10 2010 buildconf -rw-rw-r-- 1 10848 10848 1098 Aug 5 2007 build.conf -rw-rw-r-- 1 10848 10848 3291 Feb 24 2012 BUILDING -rw-rw-r-- 1 10848 10848 3477 Apr 10 18:37 build-outputs.mk -rw-rw-r-- 1 10848 10848 8739 Aug 5 2007 config.layout -rwxrwxr-x 1 10848 10848 146900 Apr 10 18:37 configure -rw-rw-r-- 1 10848 10848 6965 Feb 14 2013 configure.in drwxrwxr-x 2 10848 10848 4096 Apr 10 18:37 include -rw-rw-r-- 1 10848 10848 6669 Feb 24 2012 libtcnative.dsp -rw-rw-r-- 1 10848 10848 1214 May 13 2005 libtcnative.dsw -rw-rw-r-- 1 10848 10848 2751 Aug 5 2007 Makefile.in -rw-rw-r-- 1 10848 10848 4510 Feb 7 2013 NMAKEmakefile -rw-rw-r-- 1 10848 10848 9610 Feb 25 2012 NMAKEmakefile.inc drwxrwxr-x 5 10848 10848 4096 Apr 10 18:37 os drwxrwxr-x 2 10848 10848 4096 Apr 10 18:37 src drwxrwxr-x 4 10848 10848 4096 Apr 10 18:37 srclib -rw-rw-r-- 1 10848 10848 6657 Feb 24 2012 tcnative.dsp -rw-rw-r-- 1 10848 10848 1206 Aug 5 2007 tcnative.pc.in -rw-rw-r-- 1 10848 10848 2892 Apr 10 18:37 tcnative.spec [[email protected] native]# ll /data/tomcat/lib/ total 5500 -rw-r--r-- 1 root root 15268 May 19 18:50 annotations-api.jar -rw-r--r-- 1 root root 54669 May 19 18:50 catalina-ant.jar -rw-r--r-- 1 root root 132326 May 19 18:50 catalina-ha.jar -rw-r--r-- 1 root root 1248872 May 19 18:50 catalina.jar -rw-r--r-- 1 root root 239242 May 19 18:50 catalina-tribes.jar -rw-r--r-- 1 root root 1830791 May 19 18:50 ecj-4.3.1.jar -rw-r--r-- 1 root root 34141 May 19 18:50 el-api.jar -rw-r--r-- 1 root root 112553 May 19 18:50 jasper-el.jar -rw-r--r-- 1 root root 532459 May 19 18:50 jasper.jar -rw-r--r-- 1 root root 76856 May 19 18:50 jsp-api.jar -rw-r--r-- 1 root root 132931 May 19 18:50 servlet-api.jar -rw-r--r-- 1 root root 797689 May 19 18:50 tomcat-coyote.jar -rw-r--r-- 1 root root 217961 May 19 18:50 tomcat-dbcp.jar -rw-r--r-- 1 root root 70816 May 19 18:50 tomcat-i18n-es.jar -rw-r--r-- 1 root root 51918 May 19 18:50 tomcat-i18n-fr.jar -rw-r--r-- 1 root root 54486 May 19 18:50 tomcat-i18n-ja.jar [[email protected] native]# ./configure --with-apr=/usr/bin/apr-1-config --with-java-home=/data/jdk1.7.0_67/ --with-ssl=yes --prefix=$CATALINA_HOME checking build system type... x86_64-unknown-linux-gnu checking host system type... x86_64-unknown-linux-gnu checking target system type... x86_64-unknown-linux-gnu checking for a BSD-compatible install... /usr/bin/install -c checking for working mkdir -p... yes Tomcat Native Version: 1.1.30 checking for chosen layout... tcnative checking for APR... yes setting CC to "gcc" setting CPP to "gcc -E" checking for a BSD-compatible install... /usr/bin/install -c checking for JDK location (please wait)... /data/jdk1.7.0_67/ checking Java platform... checking Java platform... checking for sablevm... NONE adding "-I/data/jdk1.7.0_67//include" to TCNATIVE_PRIV_INCLUDES checking os_type directory... linux adding "-I/data/jdk1.7.0_67//include/linux" to TCNATIVE_PRIV_INCLUDES checking for gcc... gcc checking for C compiler default output file name... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ANSI C... none needed checking for OpenSSL library... using openssl from /usr/lib and /usr/include checking OpenSSL library version... ok checking for OpenSSL DSA support... yes setting TCNATIVE_LDFLAGS to "-lssl -lcrypto" adding "-DHAVE_OPENSSL" to CFLAGS setting TCNATIVE_LIBS to "" setting TCNATIVE_LIBS to " /usr/lib64/libapr-1.la -lpthread" configure: creating ./config.status config.status: creating tcnative.pc config.status: creating Makefile config.status: executing default commands [[email protected] native]# make && make install make[1]: Entering directory `/data/apache-tomcat-6.0.41/bin/tomcat-native-1.1.30-src/jni/native‘ /bin/sh /usr/lib64/apr-1/build/libtool --silent --mode=compile gcc -pthread -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -DHAVE_CONFIG_H -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -g -O2 -DHAVE_OPENSSL -I/data/tomcat/bin/tomcat-native-1.1.30-src/jni/native/include -I/data/jdk1.7.0_67//include -I/data/jdk1.7.0_67//include/linux -I/usr/include/apr-1 -o src/address.lo -c src/address.c && touch src/address.lo /bin/sh /usr/lib64/apr-1/build/libtool --silent --mode=compile gcc -pthread -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -DHAVE_CONFIG_H -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -g -O2 -DHAVE_OPENSSL -I/data/tomcat/bin/tomcat-native-1.1.30-src/jni/native/include -I/data/jdk1.7.0_67//include -I/data/jdk1.7.0_67//include/linux -I/usr/include/apr-1 -o src/bb.lo -c src/bb.c && touch src/bb.lo /bin/sh /usr/lib64/apr-1/build/libtool --silent --mode=compile gcc -pthread -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -DHAVE_CONFIG_H -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -g -O2 -DHAVE_OPENSSL -I/data/tomcat/bin/tomcat-native-1.1.30-src/jni/native/include -I/data/jdk1.7.0_67//include -I/data/jdk1.7.0_67//include/linux -I/usr/include/apr-1 -o src/dir.lo -c src/dir.c && touch src/dir.lo /bin/sh /usr/lib64/apr-1/build/libtool --silent --mode=compile gcc -pthread -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -DHAVE_CONFIG_H -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -g -O2 -DHAVE_OPENSSL -I/data/tomcat/bin/tomcat-native-1.1.30-src/jni/native/include -I/data/jdk1.7.0_67//include -I/data/jdk1.7.0_67//include/linux -I/usr/include/apr-1 -o src/error.lo -c src/error.c && touch src/error.lo /bin/sh /usr/lib64/apr-1/build/libtool --silent --mode=compile gcc -pthread -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -DHAVE_CONFIG_H -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -g -O2 -DHAVE_OPENSSL -I/data/tomcat/bin/tomcat-native-1.1.30-src/jni/native/include -I/data/jdk1.7.0_67//include -I/data/jdk1.7.0_67//include/linux -I/usr/include/apr-1 -o src/file.lo -c src/file.c && touch src/file.lo /bin/sh /usr/lib64/apr-1/build/libtool --silent --mode=compile gcc -pthread -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -DHAVE_CONFIG_H -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -g -O2 -DHAVE_OPENSSL -I/data/tomcat/bin/tomcat-native-1.1.30-src/jni/native/include -I/data/jdk1.7.0_67//include -I/data/jdk1.7.0_67//include/linux -I/usr/include/apr-1 -o src/info.lo -c src/info.c && touch src/info.lo /bin/sh /usr/lib64/apr-1/build/libtool --silent --mode=compile gcc -pthread -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -DHAVE_CONFIG_H -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -g -O2 -DHAVE_OPENSSL -I/data/tomcat/bin/tomcat-native-1.1.30-src/jni/native/include -I/data/jdk1.7.0_67//include -I/data/jdk1.7.0_67//include/linux -I/usr/include/apr-1 -o src/jnilib.lo -c src/jnilib.c && touch src/jnilib.lo /bin/sh /usr/lib64/apr-1/build/libtool --silent --mode=compile gcc -pthread -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -DHAVE_CONFIG_H -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -g -O2 -DHAVE_OPENSSL -I/data/tomcat/bin/tomcat-native-1.1.30-src/jni/native/include -I/data/jdk1.7.0_67//include -I/data/jdk1.7.0_67//include/linux -I/usr/include/apr-1 -o src/lock.lo -c src/lock.c && touch src/lock.lo /bin/sh /usr/lib64/apr-1/build/libtool --silent --mode=compile gcc -pthread -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -DHAVE_CONFIG_H -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -g -O2 -DHAVE_OPENSSL -I/data/tomcat/bin/tomcat-native-1.1.30-src/jni/native/include -I/data/jdk1.7.0_67//include -I/data/jdk1.7.0_67//include/linux -I/usr/include/apr-1 -o src/misc.lo -c src/misc.c && touch src/misc.lo /bin/sh /usr/lib64/apr-1/build/libtool --silent --mode=compile gcc -pthread -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -DHAVE_CONFIG_H -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -g -O2 -DHAVE_OPENSSL -I/data/tomcat/bin/tomcat-native-1.1.30-src/jni/native/include -I/data/jdk1.7.0_67//include -I/data/jdk1.7.0_67//include/linux -I/usr/include/apr-1 -o src/mmap.lo -c src/mmap.c && touch src/mmap.lo /bin/sh /usr/lib64/apr-1/build/libtool --silent --mode=compile gcc -pthread -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -DHAVE_CONFIG_H -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -g -O2 -DHAVE_OPENSSL -I/data/tomcat/bin/tomcat-native-1.1.30-src/jni/native/include -I/data/jdk1.7.0_67//include -I/data/jdk1.7.0_67//include/linux -I/usr/include/apr-1 -o src/multicast.lo -c src/multicast.c && touch src/multicast.lo /bin/sh /usr/lib64/apr-1/build/libtool --silent --mode=compile gcc -pthread -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -DHAVE_CONFIG_H -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -g -O2 -DHAVE_OPENSSL -I/data/tomcat/bin/tomcat-native-1.1.30-src/jni/native/include -I/data/jdk1.7.0_67//include -I/data/jdk1.7.0_67//include/linux -I/usr/include/apr-1 -o src/network.lo -c src/network.c && touch src/network.lo /bin/sh /usr/lib64/apr-1/build/libtool --silent --mode=compile gcc -pthread -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -DHAVE_CONFIG_H -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -g -O2 -DHAVE_OPENSSL -I/data/tomcat/bin/tomcat-native-1.1.30-src/jni/native/include -I/data/jdk1.7.0_67//include -I/data/jdk1.7.0_67//include/linux -I/usr/include/apr-1 -o src/os.lo -c src/os.c && touch src/os.lo /bin/sh /usr/lib64/apr-1/build/libtool --silent --mode=compile gcc -pthread -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -DHAVE_CONFIG_H -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -g -O2 -DHAVE_OPENSSL -I/data/tomcat/bin/tomcat-native-1.1.30-src/jni/native/include -I/data/jdk1.7.0_67//include -I/data/jdk1.7.0_67//include/linux -I/usr/include/apr-1 -o src/poll.lo -c src/poll.c && touch src/poll.lo /bin/sh /usr/lib64/apr-1/build/libtool --silent --mode=compile gcc -pthread -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -DHAVE_CONFIG_H -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -g -O2 -DHAVE_OPENSSL -I/data/tomcat/bin/tomcat-native-1.1.30-src/jni/native/include -I/data/jdk1.7.0_67//include -I/data/jdk1.7.0_67//include/linux -I/usr/include/apr-1 -o src/pool.lo -c src/pool.c && touch src/pool.lo /bin/sh /usr/lib64/apr-1/build/libtool --silent --mode=compile gcc -pthread -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -DHAVE_CONFIG_H -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -g -O2 -DHAVE_OPENSSL -I/data/tomcat/bin/tomcat-native-1.1.30-src/jni/native/include -I/data/jdk1.7.0_67//include -I/data/jdk1.7.0_67//include/linux -I/usr/include/apr-1 -o src/proc.lo -c src/proc.c && touch src/proc.lo /bin/sh /usr/lib64/apr-1/build/libtool --silent --mode=compile gcc -pthread -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -DHAVE_CONFIG_H -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -g -O2 -DHAVE_OPENSSL -I/data/tomcat/bin/tomcat-native-1.1.30-src/jni/native/include -I/data/jdk1.7.0_67//include -I/data/jdk1.7.0_67//include/linux -I/usr/include/apr-1 -o src/shm.lo -c src/shm.c && touch src/shm.lo /bin/sh /usr/lib64/apr-1/build/libtool --silent --mode=compile gcc -pthread -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -DHAVE_CONFIG_H -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -g -O2 -DHAVE_OPENSSL -I/data/tomcat/bin/tomcat-native-1.1.30-src/jni/native/include -I/data/jdk1.7.0_67//include -I/data/jdk1.7.0_67//include/linux -I/usr/include/apr-1 -o src/ssl.lo -c src/ssl.c && touch src/ssl.lo /bin/sh /usr/lib64/apr-1/build/libtool --silent --mode=compile gcc -pthread -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -DHAVE_CONFIG_H -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -g -O2 -DHAVE_OPENSSL -I/data/tomcat/bin/tomcat-native-1.1.30-src/jni/native/include -I/data/jdk1.7.0_67//include -I/data/jdk1.7.0_67//include/linux -I/usr/include/apr-1 -o src/sslcontext.lo -c src/sslcontext.c && touch src/sslcontext.lo /bin/sh /usr/lib64/apr-1/build/libtool --silent --mode=compile gcc -pthread -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -DHAVE_CONFIG_H -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -g -O2 -DHAVE_OPENSSL -I/data/tomcat/bin/tomcat-native-1.1.30-src/jni/native/include -I/data/jdk1.7.0_67//include -I/data/jdk1.7.0_67//include/linux -I/usr/include/apr-1 -o src/sslinfo.lo -c src/sslinfo.c && touch src/sslinfo.lo /bin/sh /usr/lib64/apr-1/build/libtool --silent --mode=compile gcc -pthread -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -DHAVE_CONFIG_H -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -g -O2 -DHAVE_OPENSSL -I/data/tomcat/bin/tomcat-native-1.1.30-src/jni/native/include -I/data/jdk1.7.0_67//include -I/data/jdk1.7.0_67//include/linux -I/usr/include/apr-1 -o src/sslnetwork.lo -c src/sslnetwork.c && touch src/sslnetwork.lo /bin/sh /usr/lib64/apr-1/build/libtool --silent --mode=compile gcc -pthread -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -DHAVE_CONFIG_H -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -g -O2 -DHAVE_OPENSSL -I/data/tomcat/bin/tomcat-native-1.1.30-src/jni/native/include -I/data/jdk1.7.0_67//include -I/data/jdk1.7.0_67//include/linux -I/usr/include/apr-1 -o src/sslutils.lo -c src/sslutils.c && touch src/sslutils.lo /bin/sh /usr/lib64/apr-1/build/libtool --silent --mode=compile gcc -pthread -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -DHAVE_CONFIG_H -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -g -O2 -DHAVE_OPENSSL -I/data/tomcat/bin/tomcat-native-1.1.30-src/jni/native/include -I/data/jdk1.7.0_67//include -I/data/jdk1.7.0_67//include/linux -I/usr/include/apr-1 -o src/stdlib.lo -c src/stdlib.c && touch src/stdlib.lo /bin/sh /usr/lib64/apr-1/build/libtool --silent --mode=compile gcc -pthread -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -DHAVE_CONFIG_H -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -g -O2 -DHAVE_OPENSSL -I/data/tomcat/bin/tomcat-native-1.1.30-src/jni/native/include -I/data/jdk1.7.0_67//include -I/data/jdk1.7.0_67//include/linux -I/usr/include/apr-1 -o src/thread.lo -c src/thread.c && touch src/thread.lo /bin/sh /usr/lib64/apr-1/build/libtool --silent --mode=compile gcc -pthread -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -DHAVE_CONFIG_H -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -g -O2 -DHAVE_OPENSSL -I/data/tomcat/bin/tomcat-native-1.1.30-src/jni/native/include -I/data/jdk1.7.0_67//include -I/data/jdk1.7.0_67//include/linux -I/usr/include/apr-1 -o src/user.lo -c src/user.c && touch src/user.lo /bin/sh /usr/lib64/apr-1/build/libtool --silent --mode=compile gcc -pthread -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -DHAVE_CONFIG_H -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -g -O2 -DHAVE_OPENSSL -I/data/tomcat/bin/tomcat-native-1.1.30-src/jni/native/include -I/data/jdk1.7.0_67//include -I/data/jdk1.7.0_67//include/linux -I/usr/include/apr-1 -o os/unix/system.lo -c os/unix/system.c && touch os/unix/system.lo /bin/sh /usr/lib64/apr-1/build/libtool --silent --mode=compile gcc -pthread -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -DHAVE_CONFIG_H -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -g -O2 -DHAVE_OPENSSL -I/data/tomcat/bin/tomcat-native-1.1.30-src/jni/native/include -I/data/jdk1.7.0_67//include -I/data/jdk1.7.0_67//include/linux -I/usr/include/apr-1 -o os/unix/uxpipe.lo -c os/unix/uxpipe.c && touch os/unix/uxpipe.lo /bin/sh /usr/lib64/apr-1/build/libtool --silent --mode=link gcc -pthread -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -DHAVE_CONFIG_H -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -g -O2 -DHAVE_OPENSSL -I/data/tomcat/bin/tomcat-native-1.1.30-src/jni/native/include -I/data/jdk1.7.0_67//include -I/data/jdk1.7.0_67//include/linux -I/usr/include/apr-1 -version-info 1:30:1 -o libtcnative-1.la -rpath /data/tomcat/lib src/address.lo src/bb.lo src/dir.lo src/error.lo src/file.lo src/info.lo src/jnilib.lo src/lock.lo src/misc.lo src/mmap.lo src/multicast.lo src/network.lo src/os.lo src/poll.lo src/pool.lo src/proc.lo src/shm.lo src/ssl.lo src/sslcontext.lo src/sslinfo.lo src/sslnetwork.lo src/sslutils.lo src/stdlib.lo src/thread.lo src/user.lo os/unix/system.lo os/unix/uxpipe.lo -lssl -lcrypto /usr/lib64/libapr-1.la -lpthread make[1]: Leaving directory `/data/apache-tomcat-6.0.41/bin/tomcat-native-1.1.30-src/jni/native‘ make[1]: Nothing to be done for `local-all‘. make[1]: Leaving directory `/data/apache-tomcat-6.0.41/bin/tomcat-native-1.1.30-src/jni/native‘ /usr/lib64/apr-1/build/mkdir.sh /data/tomcat/include/apr-1 /data/tomcat/lib/pkgconfig /data/tomcat/lib /data/tomcat/bin mkdir /data/tomcat/include mkdir /data/tomcat/include/apr-1 mkdir /data/tomcat/lib/pkgconfig /usr/bin/install -c -m 644 tcnative.pc /data/tomcat/lib/pkgconfig/tcnative-1.pc list=‘‘; for i in $list; do ( cd $i ; make DESTDIR= install ); done /bin/sh /usr/lib64/apr-1/build/libtool --mode=install /usr/bin/install -c -m 755 libtcnative-1.la /data/tomcat/lib libtool: install: /usr/bin/install -c -m 755 .libs/libtcnative-1.so.0.1.30 /data/tomcat/lib/libtcnative-1.so.0.1.30 libtool: install: (cd /data/tomcat/lib && { ln -s -f libtcnative-1.so.0.1.30 libtcnative-1.so.0 || { rm -f libtcnative-1.so.0 && ln -s libtcnative-1.so.0.1.30 libtcnative-1.so.0; }; }) libtool: install: (cd /data/tomcat/lib && { ln -s -f libtcnative-1.so.0.1.30 libtcnative-1.so || { rm -f libtcnative-1.so && ln -s libtcnative-1.so.0.1.30 libtcnative-1.so; }; }) libtool: install: /usr/bin/install -c -m 755 .libs/libtcnative-1.lai /data/tomcat/lib/libtcnative-1.la libtool: install: /usr/bin/install -c -m 755 .libs/libtcnative-1.a /data/tomcat/lib/libtcnative-1.a libtool: install: chmod 644 /data/tomcat/lib/libtcnative-1.a libtool: install: ranlib /data/tomcat/lib/libtcnative-1.a libtool: finish: PATH="/usr/local/nginx/bin:/usr/local/mysql/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/data/jdk1.7.0_67/bin:/data/jdk1.7.0_67/jre/bin:/sbin" ldconfig -n /data/tomcat/lib ---------------------------------------------------------------------- Libraries have been installed in: /data/tomcat/lib If you ever happen to want to link against installed libraries in a given directory, LIBDIR, you must either use libtool, and specify the full pathname of the library, or use the `-LLIBDIR‘ flag during linking and do at least one of the following: - add LIBDIR to the `LD_LIBRARY_PATH‘ environment variable during execution - add LIBDIR to the `LD_RUN_PATH‘ environment variable during linking - use the `-Wl,-rpath -Wl,LIBDIR‘ linker flag - have your system administrator add LIBDIR to `/etc/ld.so.conf‘ See any operating system documentation about shared libraries for more information, such as the ld(1) and ld.so(8) manual pages. ---------------------------------------------------------------------- [[email protected] native]# ll /data/tomcat/lib/ total 8012 -rw-r--r-- 1 root root 15268 May 19 18:50 annotations-api.jar -rw-r--r-- 1 root root 54669 May 19 18:50 catalina-ant.jar -rw-r--r-- 1 root root 132326 May 19 18:50 catalina-ha.jar -rw-r--r-- 1 root root 1248872 May 19 18:50 catalina.jar -rw-r--r-- 1 root root 239242 May 19 18:50 catalina-tribes.jar -rw-r--r-- 1 root root 1830791 May 19 18:50 ecj-4.3.1.jar -rw-r--r-- 1 root root 34141 May 19 18:50 el-api.jar -rw-r--r-- 1 root root 112553 May 19 18:50 jasper-el.jar -rw-r--r-- 1 root root 532459 May 19 18:50 jasper.jar -rw-r--r-- 1 root root 76856 May 19 18:50 jsp-api.jar -rw-r--r-- 1 root root 1636194 Sep 18 09:27 libtcnative-1.a -rwxr-xr-x 1 root root 1023 Sep 18 09:27 libtcnative-1.la lrwxrwxrwx 1 root root 23 Sep 18 09:27 libtcnative-1.so -> libtcnative-1.so.0.1.30 lrwxrwxrwx 1 root root 23 Sep 18 09:27 libtcnative-1.so.0 -> libtcnative-1.so.0.1.30 -rwxr-xr-x 1 root root 921791 Sep 18 09:27 libtcnative-1.so.0.1.30 drwxr-xr-x 2 root root 4096 Sep 18 09:27 pkgconfig -rw-r--r-- 1 root root 132931 May 19 18:50 servlet-api.jar -rw-r--r-- 1 root root 797689 May 19 18:50 tomcat-coyote.jar -rw-r--r-- 1 root root 217961 May 19 18:50 tomcat-dbcp.jar -rw-r--r-- 1 root root 70816 May 19 18:50 tomcat-i18n-es.jar -rw-r--r-- 1 root root 51918 May 19 18:50 tomcat-i18n-fr.jar -rw-r--r-- 1 root root 54486 May 19 18:50 tomcat-i18n-ja.jar [[email protected] native]# vi /data/tomcat/conf/server.xml [[email protected] native]# cd /data/tomcat/bin/ [[email protected] bin]# ls bootstrap.jar catalina-tasks.xml cpappend.bat digest.sh shutdown.bat startup.sh tomcat-native.tar.gz version.bat catalina.bat commons-daemon.jar daemon.sh setclasspath.bat shutdown.sh tomcat-juli.jar tool-wrapper.bat version.sh catalina.sh commons-daemon-native.tar.gz digest.bat setclasspath.sh startup.bat tomcat-native-1.1.30-src tool-wrapper.sh [[email protected] bin]# vi setenv.sh #新建该文件添加 LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$CATALINA_HOME/lib export LD_LIBRARY_PATH [[email protected] bin]# vi catalina.sh [[email protected] bin]# ./startup.sh Using CATALINA_BASE: /data/tomcat Using CATALINA_HOME: /data/tomcat Using CATALINA_TMPDIR: /data/tomcat/temp Using JRE_HOME: /data/jdk1.7.0_67 Using CLASSPATH: /data/tomcat/bin/bootstrap.jar [[email protected] bin]# cd ../logs/ [[email protected] logs]# ls -lrt total 12 -rw-r--r-- 1 root root 0 Sep 18 09:36 catalina.out -rw-r--r-- 1 root root 0 Sep 18 09:36 manager.2014-09-18.log -rw-r--r-- 1 root root 0 Sep 18 09:36 host-manager.2014-09-18.log -rw-r--r-- 1 root root 232 Sep 18 09:37 localhost.2014-09-18.log -rw-r--r-- 1 root root 1906 Sep 18 09:37 catalina.2014-09-18.out -rw-r--r-- 1 root root 1906 Sep 18 09:37 catalina.2014-09-18.log [[email protected] logs]# cat catalina.2014-09-18.out Sep 18, 2014 9:36:59 AM org.apache.catalina.core.AprLifecycleListener init INFO: Loaded APR based Apache Tomcat Native library 1.1.30 using APR version 1.3.9. Sep 18, 2014 9:36:59 AM org.apache.catalina.core.AprLifecycleListener init INFO: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true]. Sep 18, 2014 9:36:59 AM org.apache.catalina.core.AprLifecycleListener initializeSSL INFO: OpenSSL successfully initialized with version OpenSSL 1.0.1e 11 Feb 2013 Sep 18, 2014 9:37:00 AM org.apache.coyote.http11.Http11AprProtocol init INFO: Initializing Coyote HTTP/1.1 on http-8080 Sep 18, 2014 9:37:00 AM org.apache.coyote.ajp.AjpAprProtocol init INFO: Initializing Coyote AJP/1.3 on ajp-8009 Sep 18, 2014 9:37:00 AM org.apache.catalina.startup.Catalina load INFO: Initialization processed in 821 ms Sep 18, 2014 9:37:00 AM org.apache.catalina.core.StandardService start INFO: Starting service Catalina Sep 18, 2014 9:37:00 AM org.apache.catalina.core.StandardEngine start INFO: Starting Servlet Engine: Apache Tomcat/6.0.41 Sep 18, 2014 9:37:00 AM org.apache.catalina.startup.HostConfig deployDescriptor INFO: Deploying configuration descriptor host-manager.xml Sep 18, 2014 9:37:00 AM org.apache.catalina.startup.HostConfig deployDescriptor INFO: Deploying configuration descriptor manager.xml Sep 18, 2014 9:37:00 AM org.apache.catalina.startup.HostConfig deployDirectory INFO: Deploying web application directory docs Sep 18, 2014 9:37:00 AM org.apache.catalina.startup.HostConfig deployDirectory INFO: Deploying web application directory examples Sep 18, 2014 9:37:01 AM org.apache.coyote.http11.Http11AprProtocol start INFO: Starting Coyote HTTP/1.1 on http-8080 Sep 18, 2014 9:37:01 AM org.apache.coyote.ajp.AjpAprProtocol start INFO: Starting Coyote AJP/1.3 on ajp-8009 Sep 18, 2014 9:37:01 AM org.apache.catalina.startup.Catalina start INFO: Server startup in 1048 ms
时间: 2024-10-06 19:51:20