为tomcat8安装Native library

本文详细介绍如何在Linux环境下安装并配置Tomcat Native模块及SSL,包括安装必要的依赖包如APR、APR-Iconv、APR-Util和OpenSSL,以及配置Tomcat以使用这些库实现更高效的HTTP处理和安全的HTTPS连接。

安装依赖包

yum install -y cmake gcc expat-devel perl wget

安装apr

wget http://mirrors.hust.edu.cn/apache//apr/apr-1.6.5.tar.gz
tar zxvf apr-1.6.5.tar.gz
cd apr-1.6.5
vi configure (找到$RM “$cfgfile”这行删掉)
./configure --prefix=/usr/local/apr
make -j
make install

安装apr-iconv

wget http://mirrors.hust.edu.cn/apache//apr/apr-iconv-1.2.2.tar.gz
tar zxvf apr-iconv-1.2.2.tar.gz
cd apr-iconv-1.2.2
./configure --prefix=/usr/local/apr-iconv --with-apr=/usr/local/apr
make -j
make install

安装apr-util

wget http://mirrors.hust.edu.cn/apache//apr/apr-util-1.6.1.tar.gz
tar zxvf apr-util-1.6.1.tar.gz
cd apr-util-1.6.1
./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr --with-apr-iconv=/usr/local/apr-iconv/bin/apriconv
make -j
make install

安装openssl1.0.2

wget https://www.openssl.org/source/openssl-1.0.2p.tar.gz
tar zxvf openssl-1.0.2p.tar.gz
cd openssl-1.0.2p
./config --prefix=/usr/local/openssl -fPIC
make -j
make install
mv /usr/bin/openssl /usr/bin/openssl_old
ln -s /usr/local/openssl/bin/openssl /usr/bin/openssl

安装Native

cd /usr/local/tomcat8/bin/
tar zxvf tomcat-native.tar.gz
cd /usr/local/tomcat8/bin/tomcat-native-1.2.17-src/native
./configure --prefix=/usr/local/tomcat8/ --with-java-home=/usr/local/jdk --with-apr=/usr/local/apr/bin/apr-1-config --with-ssl=/usr/local/openssl
make -j
make install
cd /usr/local/tomcat8/lib/
cp libtcnative* /usr/lib64/
vi /usr/local/tomcat8/conf/server.xml
修改protocol="HTTP/1.1" 为 protocol="org.apache.coyote.http11.Http11AprProtocol"

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值