廢話不多說直接來~
安裝依賴:
yum install apr-devel
yum install openssl-devel
yum install gcc
yum install make
下載安裝包:
wget http://apache.fayea.com/apr/apr-1.6.5.tar.gz
wget http://apache.fayea.com/apr/apr-util-1.6.1.tar.gz
解壓軟件包:
tar -zxvf apr-1.6.5.tar.gz
tar -zxvf apr-util-1.6.1.tar.gz
開啟安裝配置:
cd apr-1.6.5/
./configure --prefix=/usr/local/apr
make &&make install
cd apr-util-1.6.1/
./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr
make
--------------------------------------------------------------------
make過程報錯:
xml/apr_xml.c:35:19: fatal error: expat.h: No such file or directory
--------------------------------------------------------------------
需要安裝:
yum install expat-devel
make install
安裝解壓 native:
cd /usr/local/tomcat_mzxz_01/bin/
tar -zxvf tomcat-native.tar.gz
cd tomcat-native-1.2.17-src/native/
./configure --with-apr=/usr/local/apr --with-java-home=/usr/java/jdk1.8.0_151
make
make install
設(shè)置環(huán)境變量:
vi /etc/profile
#在文本的最后面添加以下內(nèi)容
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/apr/lib
export LD_RUN_PATH=$LD_RUN_PATH:/usr/local/apr/lib
#使profile生效噪伊,
source /etc/profile
修改tomcat
vim catalina.sh
JAVA_OPTS="$JAVA_OPTS -Djava.library.path=/usr/local/apr/lib"
完事兵睛,回家吃飯~