• Tomcat 配置支持APR


    对ARP支持,需要安装以下库:

    • APR library
    • JNI wrappers for APR used by Tomcat (libtcnative)
    • OpenSSL libraries

    其中JNI wrappers(libtcnative)安装依赖另外两项,以及Java headers.(It depends on APR, OpenSSL, and the Java headers),也就是:

    • APR 1.2+ development headers (libapr1-dev package)
    • OpenSSL 0.9.7+ development headers (libssl-dev package)
    • JNI headers from Java compatible JDK 1.4+
    • GNU development environment (gcc, make)

    首先安装APR和OpenSSL:

    $ sudo apt-get install libapr1-dev libssl-dev

     但是,这样安装APR总是找不着lib,还是手动安装一下:

    1. 下载:

    wget  http://apache.fayea.com/apache-mirror//apr/apr-1.5.2.tar.gz 
    wget  http://apache.fayea.com/apache-mirror//apr/apr-util-1.5.4.tar.gz

    或者去网页下载最新版本:

    http://apr.apache.org/download.cgi

    2. 解压:

    tar -zxvf apr-1.5.2.tar.gz 
    tar -zxvf aor-util-1.5.4.tar.gz

    3. 安装(使用root账号,或者每条命令前加sudo):

    cd apr-1.5.2
    ./configure --prefix=/usr/local/apr 
    make 
    make install 
    cd .. 
    cd apr-util-1.5.4
    ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr 
    make 
    make insatll

    apr默认安装到/usr/local/apr,所以不加--prefix也可以。apt-util必须加--with-apr,否则找不到apr。

    最后安装JNI wrappers,The wrapper library sources are located in the Tomcat binary bundle, in the bin/tomcat-native.tar.gz archive. 

    cd /xxxx/apache-tomcat-xxx/bin
    tar -zxvf tomcat-native.tar.gz
    cd tomcat-native-xxx-src/jni/native
    ./configure --with-apr=/usr/local/apr --with-java-home=/usr/lib/jvm/jdk1.8.0_91
    make
    make install

    最后的最后,需要配置环境变量:

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

    重启电脑生效。

    启动tomcat,有以下信息,说明APR配置生效:

    INFO: Loaded APR based Apache Tomcat Native library 1.1.33 using APR version 1.5.2.
    ......
    
    INFO: Initializing ProtocolHandler ["http-apr-8080"]
    ......
    
    INFO: Initializing ProtocolHandler ["ajp-apr-8009"]
  • 相关阅读:
    124. Binary Tree Maximum Path Sum
    99. Recover Binary Search Tree
    255. Verify Preorder Sequence in Binary Search Tree
    [LeetCode] 79. Word Search Java
    [LeetCode] 78. Subsets Java
    [LeetCode] 77. Combinations Java
    [LeetCode] 52. N-Queens II Java
    [LeetCode] 51. N-Queens Java
    [LeetCode] 47. Permutations II Java
    [LeetCode] 46. Permutations Java
  • 原文地址:https://www.cnblogs.com/drizzlewithwind/p/5922462.html
Copyright © 2020-2023  润新知