为tomcat8安装Native library

安装依赖包

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"

 

posted @ 2018-10-24 16:27  缤纷世界  阅读(1004)  评论(0编辑  收藏  举报