生成环境下的Tomcat 8.0.36 在CentOS7下安装和配置apr

  1. 安装apr 1.5.2
    下载 http://apache.fayea.com//apr/apr-1.5.2.tar.gz

    
    # cd /usr/local/src
    
    
    # wget http://apache.fayea.com//apr/apr-1.5.2.tar.gz
    
    
    # tar -xzvf apr-1.5.2.tar.gz
    
    
    # cd  apr-1.5.2
    
    
    # ./configure --prefix=/usr/local/apr
    
    
    # make 
    
    
    # make install
    
  2. 安装apr-util-1.5.4
    下载 http://mirrors.hust.edu.cn/apache//apr/apr-util-1.5.4.tar.gz

    
    # cd /usr/local/src
    
    
    # wget http://mirrors.hust.edu.cn/apache//apr/apr-util-1.5.4.tar.gz
    
    
    # tar -xzvf apr-util-1.5.4.tar.gz
    
    
    # cd apr-util-1.5.4
    
    
    # ./configure --with-apr=/usr/local/apr
    
    
    # make 
    
    
    # make install
    
  3. 安装 tomcat-native组件

    /usr/local/tomcat/bin
    tar -xzvf tomcat-native.tar.gz
    cd tomcat-native-1.2.7-src/native
    ./configure --with-apr=/usr/local/apr 
    //出现如下错误
    //Found   OPENSSL_VERSION_NUMBER 0x1000105f (OpenSSL 1.0.1e 11 Feb 2013)
    //Require OPENSSL_VERSION_NUMBER 0x1000200f or greater (1.0.2)
    //configure: error: Your version of OpenSSL is not compatible with this version of tcnative
  4. 安装OpenSSL 1.0.2
    由于centos 7 当前的yum 库只有1.0.1 的OpenSSL,所以我们需要手工安装1.0.2

    
    # cd /usr/local/src
    
    
    # wget https://www.openssl.org/source/openssl-1.0.2-latest.tar.gz
    
    
    # tar -xzxf openssl-1.0.2-latest.tar.gz
    
    
    # cd openssl-1.0.2g
    
    
    # ./config --prefix=/usr/local/openssl -fPIC
    
    // 注意这里需要加入 -fPIC参数,否则后面在安装tomcat native 组件会出错
    // 注意:不要按照提示去运行 make depend
    
    # make
    
    
    # make install
    
    
    # mv /usr/bin/openssl ~
    
    
    # ln -s /usr/local/openssl/bin/openssl /usr/bin/openssl
    
    
    # openssl version
    
    // 确认版本信息是1.0.2 
  5. 重新安装 tomcat-native组件

    
    # cd $CATALINA_HOME/bin
    
    
    # tar -xzvf tomcat-native.tar.gz
    
    
    # cd tomcat-native-1.2.7-src/native
    
    
    # ./configure --with-apr=/usr/local/apr --with-ssl=/usr/local/openssl
    
    
    # make 
    
    
    # make install
    
    
  6. 检查是否安装成功
# cd $CATALINA_HOME
# cd bin
# ./catalina.sh run
//查看输入信息,如果有以下内容,说明安装成功
//20-Jun-2016 12:28:32.859 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent Loaded APR based Apache Tomcat Native library 1.2.7 using APR version 1.5.2.
//20-Jun-2016 12:28:32.859 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].
//20-Jun-2016 12:28:32.862 INFO [main] org.apache.catalina.core.AprLifecycleListener.initializeSSL OpenSSL successfully initialized (OpenSSL 1.0.2g  1 Mar 2016)
  • 2
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值