Tomcat7 APR 安装和配置

1. 什么是APR,APR (Apache Portable Runtime) is an open source project, which is supported by the
Apache Foundation software. The main goal of this project is to provide the
developer with an API, through which they can code and predict the identical
behavior, regardless of different platforms. It eliminates the requirement of
additional code dependency for different operating systems. For more information
on this project, please visit http://apr.apache.org/. (extract from apache tomcat 7 essentials)

 

Tomcat can use the Apache Portable Runtime to provide superior scalability, performance, and better integration with native server technologies. The Apache Portable Runtime is a highly portable library that is at the heart of Apache HTTP Server 2.x. APR has many uses, including access to advanced IO functionality (such as sendfile, epoll and OpenSSL), OS level functionality (random number generation, system status, etc), and native process handling (shared memory, NT pipes and Unix sockets).

 

These features allows making Tomcat a general purpose webserver, will enable much better integration with other native web technologies, and overall make Java much more viable as a full fledged webserver platform rather than simply a backend focused technology.

 

2. 安装APR

APR项目有APR, APR-util和APR-iconv,其中APR-iconv是可选安装的。

下载最新的APR和APR-util源码包

2.1安装APR

1)解压apr-1.4.6: tar -zxf apr-1.4.6

2) cd apr-1.4.6

3)依次执行./configure

make   

sudo make install

在apr被安装到了/usr/local/apr目录下面

 

2.2 安装APR-util

1) 解压apr-util-1.4.1: tar -zxf apr-util-1.4.1

2) cd apr-util-1.4.1

3) 依次执行 ./configure --with-apr=/usr/local/apr/bin/apr-1-config  (如果不加后面的可能会报APR找不到的错误"checking for APR... no
    configure: error: APR could not be located. Please use the --with-apr option."

make

sudo make install

apr-util也被安装找/usr/local/apr下面

 

3. 进入tomcat主目录下,在bin/tomcat-native-1.1.23-src/jni/native下面依次执行:

./configure --with-apr=/usr/local/apr/bin/apr-1-config  (如果不加后面的可能会报APR找不到的错误"checking for APR... no
    configure: error: APR could not be located. Please use the --with-apr option."

make

sudo make install

 

4. 设置启动参数:

在catalina.sh 加入启动参数: CATALINA_OPTS="$CATALINA_OPTS -Djava.library.path=/usr/local/apr/lib"

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值