Tomcat 开启Apr模式

1、安装依赖库

安装其他依赖库

yum -y install apr-devel

yum -y install gcc

yum -y install make

升级openssl

yum -y install openssl-devel

yum makecache fast

yum -y install gcc gcc-c++ autoconf automake zlib zlib-devel pcre-devel

mkdir /usr/local/openssl

cd /usr/local/openssl

wget https://www.openssl.org/source/openssl-1.0.2-latest.tar.gz

tar -xzvf openssl-1.0.2-latest.tar.gz

cd openssl-1.0.2*

./config

make  && make install

mv /usr/bin/openssl /usr/bin/openssl.old

mv /usr/include/openssl /usr/include/openssl.old

ln -s /usr/local/ssl/bin/openssl /usr/bin/openssl

ln -s /usr/local/ssl/include/openssl /usr/include/openssl

更新动态链接库数据

echo "/usr/local/ssl/lib" >> /etc/ld.so.conf

ldconfig -v

openssl version

2、安装apr动态库

进入tomcat的bin目录,解压tomcat-native.tar.gz文件,并进入tomcat-native-1.2.7-src/native目录,执行

./configure

make

make install 命令,动态库默认安装

在/usr/local/apr/lib目录下

/usr/local/tomcat/conf/server.xml 中的8443端口 connector标签添加

SSLCertificateFile="/usr/local/nginx/sslkey/1_szhq000062.com_bundle.crt"

SSLCertificateKeyFile="/usr/local/nginx/sslkey/2_szhq000062.com.key"

修改protocol 为protocol="org.apache.coyote.http11.Http11AprProtocol"

在/usr/local/tomcat/bin/catalina.sh 文件中

JAVA_OPTS="-Xms3072m -Xmx3072m"行后添加

JAVA_OPTS="$JAVA_OPTS -Djava.library.path=/usr/local/apr/lib"

重启tomcat

你可能感兴趣的:(Tomcat 开启Apr模式)