Tomcat uses apr optimization

A windows installation

 

Copy tcnative-1.dll directly to the TOMCAT_HOME/bin directory and start it

 

Download addresshttp://archive.apache.org/dist/tomcat/tomcat-connectors/native/

 

Two linux centos4.8 or ubuntu10.10 server installation

 

1. Download the package

 

Go to http://apr.apache.org/ to download the following 3 packages

 

http://apache.fayea.com/apr/apr-1.5.2.tar.gz

 

http://apache.fayea.com/apr/apr-util-1.5.4.tar.gz

 

http://apache.fayea.com/apr/apr-iconv-1.2.1.tar.gz

 

java version jdk-7u71-linux-x64-rpm.bin

 

tomcat version apache-tomcat-7.0.57.tar.gz

 

Three install JDK, tomcat

 

Install JDK and set environment variables

 

vi /etc/profile #Add the following variables at the end of his file

 

# java

 

JAVA_HOME=/usr/lib/jdk1.7.0_71

 

PATH=$JAVA_HOME/bin:$PATH

 

CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar

 

export JAVA_HOME

 

export PATH

 

export CLASSPATH

 

implement

 

source /etc/profile

 

At this point, the environment variable takes effect

 

apache-tomcat-7.0.57.tar.gz decompress to /data/setup/ below

 

Four install apr plugin

 

1) Install apr

 

tar zxvf apr-1.5.2.tar

 

cd apr-1.5.2

 

./configure –prefix=/data/setup/apr

 

make

 

make install

 

2) Install apr-iconv

 

code

 

tar -zxvf apr-iconv-1.2.1.tar.gz

 

cd apr-iconv-1.2.1

 

./configure -prefix=/data/setup/apr-iconv -with-apr=/data/setup/apr

 

make

 

make install

 

3) Install apr-util

 

code

 

tar zxvf apr-util-1.5.4.tar.gz

 

cd apr-util-1.5.4

 

./configure -prefix=/data/setup/apr-util -with-apr=/data/setup/apr -with-apr-iconv=/data/setup/apr-iconv/bin/apriconv

 

make

 

make install

 

4) Install tomcat-native

 

http://archive.apache.org/dist/tomcat/tomcat-connectors/native/1.1.33/source/

 

code

 

tar zxvf tomcat-native-1.1.33-src.tar.gz

 

cd tomcat-native-1.1.33-src/jni/native  

 

./configure -with-apr=/data/setup/apr -with-java-home=/usr/share/java -prefix=/usr/local/tomcat/

 

make

 

make install

 

5) Add environment variables

 

vi /etc/profile #Add the following variables at the end of his file

 

# apr

 

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/data/setup/apr/lib:/usr/local/tomcat/lib

 

implement

 

source /etc/profile

 

At this point, the environment variable takes effect

 

6) Modify the tomcat configuration file server.xml, protocol=org.apache.coyote.http11.Http11AprProtocol

 

<Connector port="8081" executor="tomcatThreadPool" protocol="org.apache.coyote.http11.Http11AprProtocol" connectionTimeout="20000" URIEncoding="UTF-8" useBodyEncodingForURI="true" enableLookups="false" redirectPort="8444"/>

 

 

 

 

       start tomcat

 

TOMCAT_HOME/bin/start.sh

 

more TOMCAT_HOME/logs/catalina.out

 

to see

 

Aug 29, 2010 3:47:32 PM org.apache.catalina.core.AprLifecycleListener init

 

INFO: Loaded APR based Apache Tomcat Native library 1.5.2.

 

Optimization is complete

 

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326834364&siteId=291194637