tomcat6 native安装
Apache Tomcat Native library 是 Apache 为了提升 Tomcat 的性能搞的一套本地化 Socket, Thread, IO 组件也就是说它有高级 IO 功能, 操作系统级别的功能调用, 以及本地进程处理等等, 这些都能使 Tomcat 更像一个 Web Server(像Apache那样), 而不是只能用来解释JSP, 大大增加了Tomcat作为服务器的吞吐性能,尤其是处理静态文件能力。
在安装nactive lib之前必须安装以下linux lib
1.APR library
2.OpenSSL libraries
3.Java SE Development Kit (JDK)
在支持rpm的linux中,可以通过yum超级方便的进行更新:
yum install apr-devel openssl-devel
[root@localhost ~] mv apache-tomcat-6.0.29.tar.gz /opt/[root@localhost ~] cd /opt[root@localhost opt]tar zxvf apache-tomcat-6.0.29.tar.gz
cd apache-tomcat-6.0.29/bintar zxvf tomcat-native.tar.gz
[root@localhost bin]# yum search gcc*已加载插件:fastestmirror, presto, refresh-packagekitLoading mirror speeds from cached hostfile * fedora: ftp.cuhk.edu.hk * updates: ftp.cuhk.edu.hk警告:没有匹配 gcc* 的软件包没有找到匹配的软件包[root@localhost bin]# yum search gcc已加载插件:fastestmirror, presto, refresh-packagekitLoading mirror speeds from cached hostfile * fedora: ftp.cuhk.edu.hk * updates: ftp.cuhk.edu.hk=========================================================== Matched: gcc ===========================================================arm-gp2x-linux-gcc.i686 : Cross Compiling GNU GCC targeted at arm-gp2x-linuxavr-gcc.i686 : Cross Compiling GNU GCC targeted at avrcompat-libgcc-296.i686 : Compatibility 2.96-RH libgcc librarygcc-gnat.i686 : Ada 95 support for GCCgcc-objc.i686 : Objective-C support for GCCgcc-objc++.i686 : Objective-C++ support for GCCgccxml.i686 : XML output extension to GCClibgcc.i686 : GCC version 4.4 shared support librarymingw32-gcc.i686 : MinGW Windows cross-compiler (GCC) for Cmsp430-gcc.i686 : Cross Compiling GNU GCC targeted at msp430avr-gcc-c++.i686 : Cross Compiling GNU GCC targeted at avrcompat-gcc-34.i686 : Compatibility GNU Compiler Collectioncompat-gcc-34-c++.i686 : C++ support for compatibility compilercompat-gcc-34-g77.i686 : Fortran 77 support for compatibility compilergcc.i686 : Various compilers (C, C++, Objective-C, Java, ...)gcc-c++.i686 : C++ support for GCCgcc-gfortran.i686 : Fortran support.....这里省略了,搜出来好多这里只用C编译器就可以了,其他的都可以不要[root@localhost bin] yum install gcc.i686
[root@localhost bin]# cd tomcat-native-1.1.20-src/[root@localhost tomcat-native-1.1.20-src]# cd jni/native[root@localhost native]# ./configure --with-apr=/usr/bin/apr-1-config \ --with-java-home=/usr/share/java-1.6.0/jdk1.6.0_21 \ --with-ssl=yes \ --prefix=/opt/tomcat
[root@localhost native]# make && make install
[root@localhost native]# cd /opt/tomcat/lib[root@localhost native]# ls annotations-api.jar el-api.jar libtcnative-1.a pkgconfig tomcat-i18n-fr.jarcatalina-ant.jar jasper-el.jar libtcnative-1.la servlet-api.jar tomcat-i18n-ja.jarcatalina-ha.jar jasper.jar libtcnative-1.so tomcat-coyote.jar tomcat-native-1.1.17-dev.jarcatalina.jar jasper-jdt.jar libtcnative-1.so.0 tomcat-dbcp.jarcatalina-tribes.jar jsp-api.jar libtcnative-1.so.0.1.20 tomcat-i18n-es.jar[root@localhost native]# cp libtcnative-1* /usr/lib/
[root@localhost native]# cd /opt/tomcat/bin[root@localhost bin]# ./catalina.sh runUsing CATALINA_BASE: /opt/tomcatUsing CATALINA_HOME: /opt/tomcatUsing CATALINA_TMPDIR: /opt/tomcat/tempUsing JRE_HOME: /usr/share/java-1.6.0/jdk1.6.0_21Using CLASSPATH: /opt/tomcat/bin/bootstrap.jar2010-8-22 1:44:50 org.apache.catalina.core.AprLifecycleListener init信息: Loaded APR based Apache Tomcat Native library 1.1.20.2010-8-22 1:44:50 org.apache.catalina.core.AprLifecycleListener init信息: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].2010-8-22 1:44:50 org.apache.coyote.http11.Http11AprProtocol init信息: Initializing Coyote HTTP/1.1 on http-80802010-8-22 1:44:50 org.apache.coyote.ajp.AjpAprProtocol init信息: Initializing Coyote AJP/1.3 on ajp-80092010-8-22 1:44:50 org.apache.catalina.startup.Catalina load信息: Initialization processed in 628 ms2010-8-22 1:44:50 org.apache.catalina.core.StandardService start信息: Starting service Catalina2010-8-22 1:44:50 org.apache.catalina.core.StandardEngine start信息: Starting Servlet Engine: Apache Tomcat/6.0.292010-8-22 1:44:50 org.apache.catalina.startup.HostConfig deployDescriptor信息: Deploying configuration descriptor manager.xml2010-8-22 1:44:50 org.apache.catalina.startup.HostConfig deployDescriptor信息: Deploying configuration descriptor host-manager.xml2010-8-22 1:44:50 org.apache.catalina.startup.HostConfig deployDirectory信息: Deploying web application directory docs2010-8-22 1:44:50 org.apache.catalina.startup.HostConfig deployDirectory信息: Deploying web application directory ROOT2010-8-22 1:44:50 org.apache.catalina.startup.HostConfig deployDirectory信息: Deploying web application directory examples2010-8-22 1:44:51 org.apache.coyote.http11.Http11AprProtocol start信息: Starting Coyote HTTP/1.1 on http-80802010-8-22 1:44:51 org.apache.coyote.ajp.AjpAprProtocol start信息: Starting Coyote AJP/1.3 on ajp-80092010-8-22 1:44:51 org.apache.catalina.startup.Catalina start信息: Server startup in 605 ms