标签:conf shel evel core lifecycle cat apr-util gcc connector
安装依赖
yum install apr-devel
yum install openssl-devel
yum install gcc
yum install make
yum install expat-devel
安装apr
下载最新的apr与apr-util
地址:http://apr.apache.org/download.cgi
cd /usr/local/
将两个tar包拷贝到该目录,tar xzvf 解压
cd apr-{version}
#./configure
#make
#make install
cd /usr/local/apr-util-{version}
#./configure --with-apr=/usr/local/apr //配置指向apr的安装目录
#make
#make install
安装 tomcat-native
进入Tomcat安装目录/bin
#tar xzvf tomcat-native.tar.gz
#cd tomcat-native-{version}-src/jni/native
# ./configure --with-apr=/usr/local/apr --with-java-home=/usr/java/jdk{version}
#make
#make install
修改 tomcat 的启动 shell ( catalina.sh ),在该文件中加入启动参数: CATALINA_OPTS="-Djava.library.path=/usr/local/apr/lib"
Tomcat8以下版本,需要指定运行模式,将server.xml中节点:protocol从HTTP/1.1改成org.apache.coyote.http11.Http11AprProtocol
<Connector port="8080" protocol="org.apache.coyote.http11.Http11AprProtocol" connectionTimeout="20000" redirectPort="8443" />
启动Tomcat,查看catalina.out,包含["http-apr-8080"] 表示用apr模式启动成功。
如果不需要ssl,将server.xml中节点做如下修改
<Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="off" />
Tomcat 7.x版本从7.0.30开始就默认支持apr
标签:conf shel evel core lifecycle cat apr-util gcc connector
原文地址:http://www.cnblogs.com/jefferycao/p/7281280.html