Centos7安装Apache Portable Runtime (APR)1.6.5APR-util-1.6.1,tomcat-native-1.2.23

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Centos7安装Apache Portable Runtime (APR)1.6.5APR-util-1.6.1,tomcat-native-1.2.23相关的知识,希望对你有一定的参考价值。

同类相似文章:Tomcat开启本地库(Apache Tomcat Native Library)支持

服务器环境

uname -a
Linux localhost.localdomain 3.10.0-514.el7.x86_64 #1 SMP Tue Nov 22 16:42:41 UTC 2016
cat /etc/redhat-release
CentOS Linux release 7.3.1611

Centos7安装Apache

 

 

 

下载及编译

1、apr

cd /usr/local/src
curl -X GET https://mirrors.tuna.tsinghua.edu.cn/apache//apr/apr-1.6.5.tar.gz -o apr-1.6.5.tar.gz
tar -zxvf apr-1.6.5.tar.gz

Centos7安装Apache

 

 

 

#安装autoconf、libtool、openssl
yum -y install

Centos7安装Apache

 

 

 

Centos7安装Apache

 

 

2、 下载apr-util

curl -X GET https://mirrors.tuna.tsinghua.edu.cn/apache//apr/apr-util-1.6.1.tar.gz -o apr-util-1.6.1.tar.gz

Centos7安装Apache

 

 

 3、 安装apr和apr-util

/usr/local/src/apr-1.6.5
vim +30993 configure
#然后按下shift + :
#输入 set number
#按两次d删除 $RM "$cfgfile"

不删除/注释该行编译的时候报错

config.status: creating test/Makefile
config.status: creating test/internal/Makefile
config.status: creating include/arch/unix/apr_private.h
config.status: executing libtool commands
rm: cannot remove libtoolT: No such file or directory

Centos7安装Apache

 

 

 编译安装

./configure --prefix=/usr/local/apr

Centos7安装Apache

 

 

 

make
make install

Centos7安装Apache

 

 

 

Centos7安装Apache

 

 

 执行以下命令:

/usr/bin/install -c -m 644 apr.exp /usr/local/apr/lib/apr.exp
/usr/bin/install -c -m 644 apr.pc /usr/local/apr/lib/pkgconfig/apr-1.pc
for f in libtool shlibtool; do \\
if test -f $f; then /usr/bin/install -c -m 755 $f /usr/local/apr/build-1; fi; \\
done
/usr/bin/install -c -m 755 /usr/local/src/apr-1.6.5/build/mkdir.sh /usr/local/apr/build-1
for f in make_exports.awk make_var_export.awk; do \\
/usr/bin/install -c -m 644 /usr/local/src/apr-1.6.5/build/$f /usr/local/apr/build-1; \\
done
/usr/bin/install -c -m 644 build/apr_rules.out /usr/local/apr/build-1/apr_rules.mk
/usr/bin/install -c -m 644 /usr/local/src/apr-1.6.5/build/apr_common.m4 /usr/local/apr/build-1
/usr/bin/install -c -m 644 /usr/local/src/apr-1.6.5/build/find_apr.m4 /usr/local/apr/build-1
/usr/bin/install -c -m 755 apr-config.out /usr/local/apr/bin/apr-1-config

安装apr-util

./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr

Centos7安装Apache

 编译安装tomcat-native

 

cd /script/apache-tomcat-8.5.42/bin/tomcat-native-1.2.21-src/native
sh buildconf --with-apr=/usr/local/src/apr-1.6.5

Centos7安装Apache

 

 

./configure --with-apr=/usr/local/apr --with-java-home=$JAVA_HOME --with-ssl=/usr/include/openssl/ --prefix=/script/apache-tomcat-8.5.42
make
make install

Centos7安装Apache

 

Centos7安装Apache

 

 

 配置环境变量

vim /etc/profile
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/apr/lib
source /etc/profile

ant安装方法参见:Centos7安装Ant

编译jar

/script/apache-tomcat-8.5.42/bin/tomcat-native-1.2.21-src
ant compile
ant jar

Centos7安装Apache

 

 

 

复制tomcat-native-jar

cp dist/tomcat-native-1.2.21.jar  ../../lib/

修改tomcat环境启动时环境变量

vim bin/setclasspath.sh

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$CATALINA_HOME/lib
export CATALINA_HOME=/script/apache-tomcat-8.5.42

 

 

 

 

Centos7安装Apache

 

 

重启tomcat

./shutdown.sh
./startup.sh

Centos7安装Apache

 

 红色的表示APR启动成功

以上是关于Centos7安装Apache Portable Runtime (APR)1.6.5APR-util-1.6.1,tomcat-native-1.2.23的主要内容,如果未能解决你的问题,请参考以下文章

apr(Apache Portable Runtime)编译

Centos7.2下安装与配置apache

centos7安装apache

centos7安装apache

Centos7 Apache 2.4.18编译安装

Centos7 安装 Apache-2.4.38