标签:
详情参考: http://tomcat.apache.org/tomcat-7.0-doc/apr.html http://www.365mini.com/page/tomcat-connector-mode.htm
操作环境:rhel6.3 x86_x64、 tomcat7.0.42
tomcat connector三种运行模式分别为:bio、nio和apr。你可以简单地理解成,性能上:bio<nio<=apr
其中bio为默认运行方式,即(server.xml):
<Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" />
nio,只需修改protocol为:
<Connector port="8080" protocol="org.apache.coyote.http11.Http11NioProtocol" connectionTimeout="20000" redirectPort="8443" />
如果要进入apr运行模式,就稍稍麻烦些。除了修改protocol:
<Connector port="8080" protocol="org.apache.coyote.http11.Http11AprProtocol" connectionTimeout="20000" redirectPort="8443" />
还需要安装部分组件来构建apr运行环境(openssl一般系统默认安装),方法如下:
#install apr & tcnative cd apr-1.5.1/ ./configure --prefix=/tomcat/lib/apr make make install cd apr-iconv-1.2.1/ ./configure --prefix=/tomcat/lib/apr-iconv --with-apr=/tomcat/lib/apr make make install cd apr-util-1.5.4/ ./configure --prefix=/tomcat/lib/apr-util --with-apr=/tomcat/lib/apr --with-apr-iconv=/tomcat/lib/apr-iconv make make install cd tomcat-native-1.1.27-src/jni/native/ ./configure --prefix=/tomcat/lib/apr --with-apr=/tomcat/lib/apr --with-java-home=$JAVA_HOME make make install export LD_LIBRARY_PATH=/tomcat/lib/apr/lib:$LD_LIBRARY_PATH #startup the tomcat bin/startup.sh #访问 http://localhost:8080/manager/status/all 查看运行模式 或者 查看启动日志
所有文件已打包:http://pan.baidu.com/s/1qW9IPQk
标签:
原文地址:http://www.cnblogs.com/lichmama/p/4225530.html