Tomcat里面的APR配置问题研究

这里,之所以研究这个问题,是因为我们的生产系统Linux环境下的tomcat日志里面,启动信息的地方有这么一个WARNING。

INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib

这个虽然对应有没有什么影响,但是看到这个信息,总是有些不愉快。

关于APR是啥或者有什么好处,请参考这个官方文档介绍Apache Portable Runtime (APR) based Native library for Tomcat

为了将这个警告或者提醒信息去除,其实也很简单,只需要做几步配置就好:

1. 安装apr

2. 安装apr-util

3. 安装tomcat-native

首先,说下,我的环境信息:

1. Linux

[root@localhost bin]# uname -a
Linux localhost.localdomain 3.10.0-229.el7.x86_64 #1 SMP Thu Jan 29 18:37:38 EST 2015 x86_64 x86_64 x86_64 GNU/Linux

2. Tomcat

[root@localhost bin]# pwd
/opt/shihuc/apache-tomcat-7.0.64/bin
[root@localhost bin]# ./version.sh 
Using CATALINA_BASE:   /opt/shihuc/apache-tomcat-7.0.64
Using CATALINA_HOME:   /opt/shihuc/apache-tomcat-7.0.64
Using CATALINA_TMPDIR: /opt/shihuc/apache-tomcat-7.0.64/temp
Using JRE_HOME:        /usr/java/jdk1.8.0_144
Using CLASSPATH:       /opt/shihuc/apache-tomcat-7.0.64/bin/bootstrap.jar:/opt/shihuc/apache-tomcat-7.0.64/bin/tomcat-juli.jar
Server version: Apache Tomcat/7.0.64
Server built:   Aug 19 2015 17:18:06 UTC
Server number:  7.0.64.0
OS Name:        Linux
OS Version:     3.10.0-229.el7.x86_64
Architecture:   amd64
JVM Version:    1.8.0_144-b01
JVM Vendor:     Oracle Corporation

接下来,进行三步走策略,完成APR的环境配置。

1. 安装apr

在官网下载最新的apr,下载地址为http://mirrors.shu.edu.cn/apache//apr/apr-1.6.3.tar.gz

下载后,进行解压,并进入到根目录进行configure,make以及make install

[root@localhost apr-1.6.3]# pwd
/opt/shihuc/apr-1.6.3

这个操作,比较简单,不做过多描述。

2.安装apr-util

在官网下载最新的apr-util,下载地址为http://mirrors.shu.edu.cn/apache//apr/apr-util-1.6.1.tar.gz

下载后,进行解压,并进入到根目录进行configure,make以及make install

[root@localhost apr-util-1.6.1]# pwd
/opt/shihuc/apr-util-1.6.1
[root@localhost apr-util-1.6.1]# ./configure
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking for working mkdir -p... yes
APR-util Version: 1.6.1
checking for chosen layout... apr-util
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
Applying apr-util hints file rules for x86_64-pc-linux-gnu
checking for APR... no
configure: error: APR could not be located. Please use the --with-apr option.

注意,这里报错了,并且提醒了,要加--with-apr选项进行配置。意思是说,告知apr-util配置的时候apr的路径在什么地方

[root@localhost apr-util-1.6.1]# ./configure --with-apr=/usr/local/apr
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking for working mkdir -p... yes
APR-util Version: 1.6.1
checking for chosen layout... apr-util
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
Applying apr-util hints file rules for x86_64-pc-linux-gnu
checking for APR... yes
  setting CPP to "gcc -E"
  adding "-pthread" to CFLAGS
  setting CPPFLAGS to " -DLINUX -D_REENTRANT -D_GNU_SOURCE"
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for ldap support...
checking for default DBM... sdbm (default)
checking for pg_config... /usr/bin/pg_config
  adding "-I/usr/include" to CPPFLAGS
  setting LDFLAGS to "-L/usr/lib64"
checking libpq-fe.h usability... no
checking libpq-fe.h presence... no
checking for libpq-fe.h... no
checking postgresql/libpq-fe.h usability... no
checking postgresql/libpq-fe.h presence... no
checking for postgresql/libpq-fe.h... no
checking sqlite3.h usability... no
checking sqlite3.h presence... no
checking for sqlite3.h... no
checking sqlite.h usability... no
checking sqlite.h presence... no
checking for sqlite.h... no
checking for odbc_config... /home/anaconda2/bin/odbc_config
  adding "-I/home/anaconda2/include" to CPPFLAGS
  setting LDFLAGS to "-L/home/anaconda2/lib"
  setting LIBS to "-L/home/anaconda2/lib -lodbc"
checking sql.h usability... yes
checking sql.h presence... yes
checking for sql.h... yes
checking for SQLAllocHandle in -lodbc... yes
  adding "-I/home/anaconda2/include" to APRUTIL_PRIV_INCLUDES
  setting LDADD_dbd_odbc to "-L/home/anaconda2/lib -lodbc -L/home/anaconda2/lib -lodbc"
checking Expat 1.95.x... yes
  setting APRUTIL_EXPORT_LIBS to "-lexpat"
  setting APRUTIL_LIBS to "-lexpat"
checking iconv.h usability... yes
checking iconv.h presence... yes
checking for iconv.h... yes
checking for type of inbuf parameter to iconv... char **
checking for iconv.h... (cached) yes
checking langinfo.h usability... yes
checking langinfo.h presence... yes
checking for langinfo.h... yes
checking for nl_langinfo... yes
checking for CODESET in langinfo.h... yes
checking whether APR has DSO support... yes
checking for library containing crypt... -lcrypt
checking if system crypt() function is threadsafe... no
checking for crypt_r... yes
checking style of crypt_r... struct_crypt_data
checking whether the compiler handles weak symbols... yes
checking for memset_s support... no
checking for explicit_bzero support... no
  adding "/usr/local/apr/lib/libapr-1.la" to APRUTIL_LIBS
  adding "-lrt" to APRUTIL_LIBS
  adding "-lcrypt" to APRUTIL_LIBS
  adding "-lpthread" to APRUTIL_LIBS
  adding "-ldl" to APRUTIL_LIBS
configure: creating ./config.status
config.status: creating Makefile
config.status: creating export_vars.sh
config.status: creating build/pkg/pkginfo
config.status: creating apr-util.pc
config.status: creating apu-1-config
config.status: creating include/private/apu_select_dbm.h
config.status: creating include/apr_ldap.h
config.status: creating include/apu.h
config.status: creating include/apu_want.h
config.status: creating test/Makefile
config.status: creating include/private/apu_config.h
config.status: executing default commands
[root@localhost apr-util-1.6.1]#

这次OK了,没有再报错。

3. 安装tomcat-native

注意,我们的tomcat是tomcat7了,这个版本以及之后的版本,是不需要单独下载tomcat-native的包的,在tomcat的bin目录下,已经带上了,我们只需要在这个目录下进行解压和安装即可。

[root@localhost apache-tomcat-7.0.64]# cd bin/
[root@localhost bin]# ll
总用量 788
-rw-r--r--. 1 root root  28064 8月  20 2015 bootstrap.jar
-rw-r--r--. 1 root root  13007 8月  20 2015 catalina.bat
-rwxr-xr-x. 1 root root  20909 8月  20 2015 catalina.sh
-rw-r--r--. 1 root root   1647 8月  20 2015 catalina-tasks.xml
-rw-r--r--. 1 root root  24283 8月  20 2015 commons-daemon.jar
-rw-r--r--. 1 root root 204944 8月  20 2015 commons-daemon-native.tar.gz
-rw-r--r--. 1 root root   2040 8月  20 2015 configtest.bat
-rwxr-xr-x. 1 root root   1922 8月  20 2015 configtest.sh
-rwxr-xr-x. 1 root root   7888 8月  20 2015 daemon.sh
-rw-r--r--. 1 root root   2091 8月  20 2015 digest.bat
-rwxr-xr-x. 1 root root   1965 8月  20 2015 digest.sh
-rw-r--r--. 1 root root   3430 8月  20 2015 setclasspath.bat
-rwxr-xr-x. 1 root root   3547 8月  20 2015 setclasspath.sh
-rw-r--r--. 1 root root   2020 8月  20 2015 shutdown.bat
-rwxr-xr-x. 1 root root   1902 8月  20 2015 shutdown.sh
-rw-r--r--. 1 root root   2022 8月  20 2015 startup.bat
-rwxr-xr-x. 1 root root   1904 8月  20 2015 startup.sh
-rw-r--r--. 1 root root  38217 8月  20 2015 tomcat-juli.jar
-rw-r--r--. 1 root root 388787 8月  20 2015 tomcat-native.tar.gz
-rw-r--r--. 1 root root   4021 8月  20 2015 tool-wrapper.bat
-rwxr-xr-x. 1 root root   5024 8月  20 2015 tool-wrapper.sh
-rw-r--r--. 1 root root   2026 8月  20 2015 version.bat
-rwxr-xr-x. 1 root root   1908 8月  20 2015 version.sh

将这个tomcat-native.tar.gz解压并进入到native目录下,进行configure,make以及make install。因为,我们的tomcat配置中,涉及apr的地方,启用了SSL,所以,我们的环境里面,必须要有SSL的支持能力。

<?xml version='1.0' encoding='utf-8'?>
<!--
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
  (the "License"); you may not use this file except in compliance with
  the License.  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->
<!-- Note:  A "Server" is not itself a "Container", so you may not
     define subcomponents such as "Valves" at this level.
     Documentation at /docs/config/server.html
 -->
<Server port="8005" shutdown="SHUTDOWN">
  <Listener className="org.apache.catalina.startup.VersionLoggerListener" />
  <!-- Security listener. Documentation at /docs/config/listeners.html
  <Listener className="org.apache.catalina.security.SecurityListener" />
  -->
  <!--APR library loader. Documentation at /docs/apr.html -->
  <Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />
  <!--Initialize Jasper prior to webapps are loaded. Documentation at /docs/jasper-howto.html -->
  <Listener className="org.apache.catalina.core.JasperListener" />
  <!-- Prevent memory leaks due to use of particular java/javax APIs-->
  <Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
  <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
  <Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" />

  <!-- Global JNDI resources
       Documentation at /docs/jndi-resources-howto.html
  -->

下面的省略了。。。

所以SSL的环境必须要有,检查后发现,我的Linux系统,因为之前其他项目的需要,已经安装了openssl了,通过rpm查看。

[root@localhost native]# rpm -qa|grep openssl
openssl-devel-1.0.2k-8.el7.x86_64
openssl098e-0.9.8e-29.el7_0.2.x86_64
openssl-1.0.2k-8.el7.x86_64
openssl-libs-1.0.2k-8.el7.x86_64
[root@localhost native]# 

系统当前已经安装有openssl了,版本为openssl-devel-1.0.2k-8.el7.x86_64。

或者通过这种方式,也可以查看是否安装openssl,直接执行openssl,看是否存在。那么openssl的安装路径是啥呢?

[root@localhost native]# which openssl
/home/anaconda2/bin/openssl

下面检查tomcat-native的JDK环境:

[root@localhost native]# echo $JAVA_HOME
/usr/java/jdk1.8.0_144

tomcat-native的依赖都有了,接下来,就是直接安装操作了。

[root@localhost native]# ./configure --with-apr=/usr/local/apr --with-ssl=/home/anaconda2/bin --with-java-home=/usr/java/jdk1.8.0_144 
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking for working mkdir -p... yes
Tomcat Native Version: 1.1.33
checking for chosen layout... tcnative
checking for APR... yes
  setting CC to "gcc"
  setting CPP to "gcc -E"
checking for JDK location (please wait)... /usr/java/jdk1.8.0_144
checking Java platform... checking Java platform... 
checking for sablevm... NONE
  adding "-I/usr/java/jdk1.8.0_144/include" to TCNATIVE_PRIV_INCLUDES
checking os_type directory...  linux
  adding "-I/usr/java/jdk1.8.0_144/include/linux" to TCNATIVE_PRIV_INCLUDES
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for OpenSSL library... using openssl from /home/anaconda2/bin/lib and /home/anaconda2/bin/include
checking OpenSSL library version... ok
checking for OpenSSL DSA support... no
  adding "-I/home/anaconda2/bin/include" to TCNATIVE_PRIV_INCLUDES
  setting TCNATIVE_LDFLAGS to "-L/home/anaconda2/bin/lib -Wl,-rpath,/home/anaconda2/bin/lib -lssl -lcrypto"
  adding "-DHAVE_OPENSSL" to CFLAGS
  setting TCNATIVE_LIBS to ""
  setting TCNATIVE_LIBS to " /usr/local/apr/lib/libapr-1.la -lrt -lcrypt  -lpthread -ldl"
configure: creating ./config.status
config.status: creating tcnative.pc
config.status: creating Makefile
config.status: executing default commands

接下来,就执行make以及make install了。

[root@localhost native]# make && make install
make[1]: 进入目录“/opt/shihuc/apache-tomcat-7.0.64/bin/tomcat-native-1.1.33-src/jni/native”
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -g -O2 -DHAVE_OPENSSL   -I/opt/shihuc/apache-tomcat-7.0.64/bin/tomcat-native-1.1.33-src/jni/native/include -I/usr/java/jdk1.8.0_144/include -I/usr/java/jdk1.8.0_144/include/linux -I/home/anaconda2/bin/include  -I/usr/local/apr/include/apr-1   -o src/address.lo -c src/address.c && touch src/address.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -g -O2 -DHAVE_OPENSSL   -I/opt/shihuc/apache-tomcat-7.0.64/bin/tomcat-native-1.1.33-src/jni/native/include -I/usr/java/jdk1.8.0_144/include -I/usr/java/jdk1.8.0_144/include/linux -I/home/anaconda2/bin/include  -I/usr/local/apr/include/apr-1   -o src/bb.lo -c src/bb.c && touch src/bb.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -g -O2 -DHAVE_OPENSSL   -I/opt/shihuc/apache-tomcat-7.0.64/bin/tomcat-native-1.1.33-src/jni/native/include -I/usr/java/jdk1.8.0_144/include -I/usr/java/jdk1.8.0_144/include/linux -I/home/anaconda2/bin/include  -I/usr/local/apr/include/apr-1   -o src/dir.lo -c src/dir.c && touch src/dir.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -g -O2 -DHAVE_OPENSSL   -I/opt/shihuc/apache-tomcat-7.0.64/bin/tomcat-native-1.1.33-src/jni/native/include -I/usr/java/jdk1.8.0_144/include -I/usr/java/jdk1.8.0_144/include/linux -I/home/anaconda2/bin/include  -I/usr/local/apr/include/apr-1   -o src/error.lo -c src/error.c && touch src/error.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -g -O2 -DHAVE_OPENSSL   -I/opt/shihuc/apache-tomcat-7.0.64/bin/tomcat-native-1.1.33-src/jni/native/include -I/usr/java/jdk1.8.0_144/include -I/usr/java/jdk1.8.0_144/include/linux -I/home/anaconda2/bin/include  -I/usr/local/apr/include/apr-1   -o src/file.lo -c src/file.c && touch src/file.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -g -O2 -DHAVE_OPENSSL   -I/opt/shihuc/apache-tomcat-7.0.64/bin/tomcat-native-1.1.33-src/jni/native/include -I/usr/java/jdk1.8.0_144/include -I/usr/java/jdk1.8.0_144/include/linux -I/home/anaconda2/bin/include  -I/usr/local/apr/include/apr-1   -o src/info.lo -c src/info.c && touch src/info.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -g -O2 -DHAVE_OPENSSL   -I/opt/shihuc/apache-tomcat-7.0.64/bin/tomcat-native-1.1.33-src/jni/native/include -I/usr/java/jdk1.8.0_144/include -I/usr/java/jdk1.8.0_144/include/linux -I/home/anaconda2/bin/include  -I/usr/local/apr/include/apr-1   -o src/jnilib.lo -c src/jnilib.c && touch src/jnilib.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -g -O2 -DHAVE_OPENSSL   -I/opt/shihuc/apache-tomcat-7.0.64/bin/tomcat-native-1.1.33-src/jni/native/include -I/usr/java/jdk1.8.0_144/include -I/usr/java/jdk1.8.0_144/include/linux -I/home/anaconda2/bin/include  -I/usr/local/apr/include/apr-1   -o src/lock.lo -c src/lock.c && touch src/lock.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -g -O2 -DHAVE_OPENSSL   -I/opt/shihuc/apache-tomcat-7.0.64/bin/tomcat-native-1.1.33-src/jni/native/include -I/usr/java/jdk1.8.0_144/include -I/usr/java/jdk1.8.0_144/include/linux -I/home/anaconda2/bin/include  -I/usr/local/apr/include/apr-1   -o src/misc.lo -c src/misc.c && touch src/misc.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -g -O2 -DHAVE_OPENSSL   -I/opt/shihuc/apache-tomcat-7.0.64/bin/tomcat-native-1.1.33-src/jni/native/include -I/usr/java/jdk1.8.0_144/include -I/usr/java/jdk1.8.0_144/include/linux -I/home/anaconda2/bin/include  -I/usr/local/apr/include/apr-1   -o src/mmap.lo -c src/mmap.c && touch src/mmap.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -g -O2 -DHAVE_OPENSSL   -I/opt/shihuc/apache-tomcat-7.0.64/bin/tomcat-native-1.1.33-src/jni/native/include -I/usr/java/jdk1.8.0_144/include -I/usr/java/jdk1.8.0_144/include/linux -I/home/anaconda2/bin/include  -I/usr/local/apr/include/apr-1   -o src/multicast.lo -c src/multicast.c && touch src/multicast.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -g -O2 -DHAVE_OPENSSL   -I/opt/shihuc/apache-tomcat-7.0.64/bin/tomcat-native-1.1.33-src/jni/native/include -I/usr/java/jdk1.8.0_144/include -I/usr/java/jdk1.8.0_144/include/linux -I/home/anaconda2/bin/include  -I/usr/local/apr/include/apr-1   -o src/network.lo -c src/network.c && touch src/network.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -g -O2 -DHAVE_OPENSSL   -I/opt/shihuc/apache-tomcat-7.0.64/bin/tomcat-native-1.1.33-src/jni/native/include -I/usr/java/jdk1.8.0_144/include -I/usr/java/jdk1.8.0_144/include/linux -I/home/anaconda2/bin/include  -I/usr/local/apr/include/apr-1   -o src/os.lo -c src/os.c && touch src/os.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -g -O2 -DHAVE_OPENSSL   -I/opt/shihuc/apache-tomcat-7.0.64/bin/tomcat-native-1.1.33-src/jni/native/include -I/usr/java/jdk1.8.0_144/include -I/usr/java/jdk1.8.0_144/include/linux -I/home/anaconda2/bin/include  -I/usr/local/apr/include/apr-1   -o src/poll.lo -c src/poll.c && touch src/poll.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -g -O2 -DHAVE_OPENSSL   -I/opt/shihuc/apache-tomcat-7.0.64/bin/tomcat-native-1.1.33-src/jni/native/include -I/usr/java/jdk1.8.0_144/include -I/usr/java/jdk1.8.0_144/include/linux -I/home/anaconda2/bin/include  -I/usr/local/apr/include/apr-1   -o src/pool.lo -c src/pool.c && touch src/pool.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -g -O2 -DHAVE_OPENSSL   -I/opt/shihuc/apache-tomcat-7.0.64/bin/tomcat-native-1.1.33-src/jni/native/include -I/usr/java/jdk1.8.0_144/include -I/usr/java/jdk1.8.0_144/include/linux -I/home/anaconda2/bin/include  -I/usr/local/apr/include/apr-1   -o src/proc.lo -c src/proc.c && touch src/proc.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -g -O2 -DHAVE_OPENSSL   -I/opt/shihuc/apache-tomcat-7.0.64/bin/tomcat-native-1.1.33-src/jni/native/include -I/usr/java/jdk1.8.0_144/include -I/usr/java/jdk1.8.0_144/include/linux -I/home/anaconda2/bin/include  -I/usr/local/apr/include/apr-1   -o src/shm.lo -c src/shm.c && touch src/shm.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -g -O2 -DHAVE_OPENSSL   -I/opt/shihuc/apache-tomcat-7.0.64/bin/tomcat-native-1.1.33-src/jni/native/include -I/usr/java/jdk1.8.0_144/include -I/usr/java/jdk1.8.0_144/include/linux -I/home/anaconda2/bin/include  -I/usr/local/apr/include/apr-1   -o src/ssl.lo -c src/ssl.c && touch src/ssl.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -g -O2 -DHAVE_OPENSSL   -I/opt/shihuc/apache-tomcat-7.0.64/bin/tomcat-native-1.1.33-src/jni/native/include -I/usr/java/jdk1.8.0_144/include -I/usr/java/jdk1.8.0_144/include/linux -I/home/anaconda2/bin/include  -I/usr/local/apr/include/apr-1   -o src/sslcontext.lo -c src/sslcontext.c && touch src/sslcontext.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -g -O2 -DHAVE_OPENSSL   -I/opt/shihuc/apache-tomcat-7.0.64/bin/tomcat-native-1.1.33-src/jni/native/include -I/usr/java/jdk1.8.0_144/include -I/usr/java/jdk1.8.0_144/include/linux -I/home/anaconda2/bin/include  -I/usr/local/apr/include/apr-1   -o src/sslinfo.lo -c src/sslinfo.c && touch src/sslinfo.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -g -O2 -DHAVE_OPENSSL   -I/opt/shihuc/apache-tomcat-7.0.64/bin/tomcat-native-1.1.33-src/jni/native/include -I/usr/java/jdk1.8.0_144/include -I/usr/java/jdk1.8.0_144/include/linux -I/home/anaconda2/bin/include  -I/usr/local/apr/include/apr-1   -o src/sslnetwork.lo -c src/sslnetwork.c && touch src/sslnetwork.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -g -O2 -DHAVE_OPENSSL   -I/opt/shihuc/apache-tomcat-7.0.64/bin/tomcat-native-1.1.33-src/jni/native/include -I/usr/java/jdk1.8.0_144/include -I/usr/java/jdk1.8.0_144/include/linux -I/home/anaconda2/bin/include  -I/usr/local/apr/include/apr-1   -o src/sslutils.lo -c src/sslutils.c && touch src/sslutils.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -g -O2 -DHAVE_OPENSSL   -I/opt/shihuc/apache-tomcat-7.0.64/bin/tomcat-native-1.1.33-src/jni/native/include -I/usr/java/jdk1.8.0_144/include -I/usr/java/jdk1.8.0_144/include/linux -I/home/anaconda2/bin/include  -I/usr/local/apr/include/apr-1   -o src/stdlib.lo -c src/stdlib.c && touch src/stdlib.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -g -O2 -DHAVE_OPENSSL   -I/opt/shihuc/apache-tomcat-7.0.64/bin/tomcat-native-1.1.33-src/jni/native/include -I/usr/java/jdk1.8.0_144/include -I/usr/java/jdk1.8.0_144/include/linux -I/home/anaconda2/bin/include  -I/usr/local/apr/include/apr-1   -o src/thread.lo -c src/thread.c && touch src/thread.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -g -O2 -DHAVE_OPENSSL   -I/opt/shihuc/apache-tomcat-7.0.64/bin/tomcat-native-1.1.33-src/jni/native/include -I/usr/java/jdk1.8.0_144/include -I/usr/java/jdk1.8.0_144/include/linux -I/home/anaconda2/bin/include  -I/usr/local/apr/include/apr-1   -o src/user.lo -c src/user.c && touch src/user.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -g -O2 -DHAVE_OPENSSL   -I/opt/shihuc/apache-tomcat-7.0.64/bin/tomcat-native-1.1.33-src/jni/native/include -I/usr/java/jdk1.8.0_144/include -I/usr/java/jdk1.8.0_144/include/linux -I/home/anaconda2/bin/include  -I/usr/local/apr/include/apr-1   -o os/unix/system.lo -c os/unix/system.c && touch os/unix/system.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -g -O2 -DHAVE_OPENSSL   -I/opt/shihuc/apache-tomcat-7.0.64/bin/tomcat-native-1.1.33-src/jni/native/include -I/usr/java/jdk1.8.0_144/include -I/usr/java/jdk1.8.0_144/include/linux -I/home/anaconda2/bin/include  -I/usr/local/apr/include/apr-1   -o os/unix/uxpipe.lo -c os/unix/uxpipe.c && touch os/unix/uxpipe.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=link  gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -g -O2 -DHAVE_OPENSSL   -I/opt/shihuc/apache-tomcat-7.0.64/bin/tomcat-native-1.1.33-src/jni/native/include -I/usr/java/jdk1.8.0_144/include -I/usr/java/jdk1.8.0_144/include/linux -I/home/anaconda2/bin/include  -I/usr/local/apr/include/apr-1   -version-info 1:33:1    -o libtcnative-1.la -rpath /usr/local/apr/lib src/address.lo src/bb.lo src/dir.lo src/error.lo src/file.lo src/info.lo src/jnilib.lo src/lock.lo src/misc.lo src/mmap.lo src/multicast.lo src/network.lo src/os.lo src/poll.lo src/pool.lo src/proc.lo src/shm.lo src/ssl.lo src/sslcontext.lo src/sslinfo.lo src/sslnetwork.lo src/sslutils.lo src/stdlib.lo src/thread.lo src/user.lo os/unix/system.lo os/unix/uxpipe.lo -L/home/anaconda2/bin/lib -Wl,-rpath,/home/anaconda2/bin/lib -lssl -lcrypto  /usr/local/apr/lib/libapr-1.la -lrt -lcrypt  -lpthread -ldl
make[1]: 离开目录“/opt/shihuc/apache-tomcat-7.0.64/bin/tomcat-native-1.1.33-src/jni/native”
make[1]: 进入目录“/opt/shihuc/apache-tomcat-7.0.64/bin/tomcat-native-1.1.33-src/jni/native”
make[1]: 对“local-all”无需做任何事。
make[1]: 离开目录“/opt/shihuc/apache-tomcat-7.0.64/bin/tomcat-native-1.1.33-src/jni/native”
/usr/local/apr/build-1/mkdir.sh /usr/local/apr/include/apr-1 /usr/local/apr/lib/pkgconfig \
             /usr/local/apr/lib /usr/local/apr/bin
/usr/bin/install -c -m 644 tcnative.pc /usr/local/apr/lib/pkgconfig/tcnative-1.pc
list=''; for i in $list; do \
        ( cd $i ; make DESTDIR= install ); \
done
/bin/sh /usr/local/apr/build-1/libtool --mode=install /usr/bin/install -c -m 755 libtcnative-1.la /usr/local/apr/lib
libtool: install: /usr/bin/install -c -m 755 .libs/libtcnative-1.so.0.1.33 /usr/local/apr/lib/libtcnative-1.so.0.1.33
libtool: install: (cd /usr/local/apr/lib && { ln -s -f libtcnative-1.so.0.1.33 libtcnative-1.so.0 || { rm -f libtcnative-1.so.0 && ln -s libtcnative-1.so.0.1.33 libtcnative-1.so.0; }; })
libtool: install: (cd /usr/local/apr/lib && { ln -s -f libtcnative-1.so.0.1.33 libtcnative-1.so || { rm -f libtcnative-1.so && ln -s libtcnative-1.so.0.1.33 libtcnative-1.so; }; })
libtool: install: /usr/bin/install -c -m 755 .libs/libtcnative-1.lai /usr/local/apr/lib/libtcnative-1.la
libtool: install: /usr/bin/install -c -m 755 .libs/libtcnative-1.a /usr/local/apr/lib/libtcnative-1.a
libtool: install: chmod 644 /usr/local/apr/lib/libtcnative-1.a
libtool: install: ranlib /usr/local/apr/lib/libtcnative-1.a
libtool: finish: PATH="/usr/local/cuda-7.5/bin:/home/mongo/mongodb-linux-x86_64-rhel70-3.4.4/bin:/usr/local/cuda-7.5/bin:/home/mongo/mongodb-linux-x86_64-rhel70-3.4.4/bin:/usr/local/cuda-7.5/bin:/home/mongo/mongodb-linux-x86_64-rhel70-3.4.4/bin:/usr/local/cuda-7.5/bin:/home/mongo/mongodb-linux-x86_64-rhel70-3.4.4/bin:/usr/local/cuda-7.5/bin:/home/mongo/mongodb-linux-x86_64-rhel70-3.4.4/bin:/home/cuda-8.0/bin:/home/anaconda2/bin:/usr/local/cuda-7.5/bin:/home/mongo/mongodb-linux-x86_64-rhel70-3.4.4/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/opt/apache-maven-3.3.9/bin:/home/mwwPro/tools/R2017a/bin/:/root/bin:/opt/shihuc/QANLP/idea-IC-172.4574.11/bin:/opt/apache-maven-3.3.9/bin:/opt/apache-maven-3.3.9/bin:/opt/apache-maven-3.3.9/bin:/opt/apache-maven-3.3.9/bin:/opt/apache-maven-3.3.9/bin:/sbin" ldconfig -n /usr/local/apr/lib
----------------------------------------------------------------------
Libraries have been installed in:
   /usr/local/apr/lib

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the '-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the 'LD_LIBRARY_PATH' environment variable
     during execution
   - add LIBDIR to the 'LD_RUN_PATH' environment variable
     during linking
   - use the '-Wl,-rpath -Wl,LIBDIR' linker flag
   - have your system administrator add LIBDIR to '/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
[root@localhost native]# 
View Code

所有的安装操作都OK了,接下来,还有一点,注意,不要遗忘了配置环境变量,就是APR的环境变量。

修改/etc/profile,然后做下面的红色内容的新增,写上apr的安装路径:

export LD_LIBRARY_PATH=/usr/local/apr/lib:/usr/local/cuda-7.5/lib64:$LD_LIBRARY_PATH

然后,source一下/etc/profile.启用这个新的环境配置。

所有的操作都结束了,最后就是验证是否APR生效。很简单,只需要将tomcat重启一下,查看catalina.out的日志,看看是否存在开篇提到的APR的那个提醒信息即可。我的环境配置,安装上述步骤,这个APR的提醒信息已经解除,的确不存在了。

下面对比一下,没有做上述APR配置和做了这个配置的启动日志有什么不同:

没有配置APR的日志:

五月 02, 2018 2:38:11 下午 org.apache.catalina.startup.SetAllPropertiesRule begin
警告: [SetAllPropertiesRule]{Server/Service/Connector} Setting property 'maxSpareThreads' to '200' did not find a matching property.
五月 02, 2018 2:38:11 下午 org.apache.catalina.startup.SetAllPropertiesRule begin
警告: [SetAllPropertiesRule]{Server/Service/Connector} Setting property 'maxProcessors' to '1000' did not find a matching property.
五月 02, 2018 2:38:11 下午 org.apache.catalina.startup.SetAllPropertiesRule begin
警告: [SetAllPropertiesRule]{Server/Service/Connector} Setting property 'minProcessors' to '5' did not find a matching property.
五月 02, 2018 2:38:11 下午 org.apache.catalina.startup.SetAllPropertiesRule begin
警告: [SetAllPropertiesRule]{Server/Service/Connector} Setting property 'useURIValidationHack' to 'false' did not find a matching property.
五月 02, 2018 2:38:11 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Server version:        Apache Tomcat/7.0.64
五月 02, 2018 2:38:11 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Server built:          Aug 19 2015 17:18:06 UTC
五月 02, 2018 2:38:11 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Server number:         7.0.64.0
五月 02, 2018 2:38:11 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: OS Name:               Linux
五月 02, 2018 2:38:11 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: OS Version:            3.10.0-229.el7.x86_64
五月 02, 2018 2:38:11 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Architecture:          amd64
五月 02, 2018 2:38:11 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Java Home:             /usr/java/jdk1.8.0_144/jre
五月 02, 2018 2:38:11 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: JVM Version:           1.8.0_144-b01
五月 02, 2018 2:38:11 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: JVM Vendor:            Oracle Corporation
五月 02, 2018 2:38:11 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: CATALINA_BASE:         /opt/shihuc/apache-tomcat-7.0.64
五月 02, 2018 2:38:11 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: CATALINA_HOME:         /opt/shihuc/apache-tomcat-7.0.64
五月 02, 2018 2:38:11 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Djava.util.logging.config.file=/opt/shihuc/apache-tomcat-7.0.64/conf/logging.properties
五月 02, 2018 2:38:11 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
五月 02, 2018 2:38:11 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Djava.endorsed.dirs=/opt/shihuc/apache-tomcat-7.0.64/endorsed
五月 02, 2018 2:38:11 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Dcatalina.base=/opt/shihuc/apache-tomcat-7.0.64
五月 02, 2018 2:38:11 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Dcatalina.home=/opt/shihuc/apache-tomcat-7.0.64
五月 02, 2018 2:38:11 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Djava.io.tmpdir=/opt/shihuc/apache-tomcat-7.0.64/temp
五月 02, 2018 2:38:11 下午 org.apache.catalina.core.AprLifecycleListener lifecycleEvent
信息: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /home/cuda-8.0/lib64:/home/cuda-8.0/extras/CUPTI/lib64:/home/cudnn/lib64:/usr/local/cuda-7.5/lib64::/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
五月 02, 2018 2:38:11 下午 org.apache.coyote.AbstractProtocol init
信息: Initializing ProtocolHandler ["http-bio-8080"]
五月 02, 2018 2:38:11 下午 org.apache.coyote.AbstractProtocol init
信息: Initializing ProtocolHandler ["ajp-bio-8009"]
五月 02, 2018 2:38:11 下午 org.apache.catalina.startup.Catalina load
信息: Initialization processed in 471 ms
五月 02, 2018 2:38:11 下午 org.apache.catalina.core.StandardService startInternal
信息: Starting service Catalina
五月 02, 2018 2:38:11 下午 org.apache.catalina.core.StandardEngine startInternal
信息: Starting Servlet Engine: Apache Tomcat/7.0.64

下面是做了这个APR配置后的启动日志:

五月 02, 2018 5:09:09 下午 org.apache.catalina.startup.SetAllPropertiesRule begin
警告: [SetAllPropertiesRule]{Server/Service/Connector} Setting property 'maxSpareThreads' to '200' did not find a matching property.
五月 02, 2018 5:09:09 下午 org.apache.catalina.startup.SetAllPropertiesRule begin
警告: [SetAllPropertiesRule]{Server/Service/Connector} Setting property 'maxProcessors' to '1000' did not find a matching property.
五月 02, 2018 5:09:09 下午 org.apache.catalina.startup.SetAllPropertiesRule begin
警告: [SetAllPropertiesRule]{Server/Service/Connector} Setting property 'minProcessors' to '5' did not find a matching property.
五月 02, 2018 5:09:09 下午 org.apache.catalina.startup.SetAllPropertiesRule begin
警告: [SetAllPropertiesRule]{Server/Service/Connector} Setting property 'useURIValidationHack' to 'false' did not find a matching property.
五月 02, 2018 5:09:09 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Server version:        Apache Tomcat/7.0.64
五月 02, 2018 5:09:09 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Server built:          Aug 19 2015 17:18:06 UTC
五月 02, 2018 5:09:09 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Server number:         7.0.64.0
五月 02, 2018 5:09:09 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: OS Name:               Linux
五月 02, 2018 5:09:09 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: OS Version:            3.10.0-229.el7.x86_64
五月 02, 2018 5:09:09 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Architecture:          amd64
五月 02, 2018 5:09:09 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Java Home:             /usr/java/jdk1.8.0_144/jre
五月 02, 2018 5:09:09 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: JVM Version:           1.8.0_144-b01
五月 02, 2018 5:09:09 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: JVM Vendor:            Oracle Corporation
五月 02, 2018 5:09:09 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: CATALINA_BASE:         /opt/shihuc/apache-tomcat-7.0.64
五月 02, 2018 5:09:09 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: CATALINA_HOME:         /opt/shihuc/apache-tomcat-7.0.64
五月 02, 2018 5:09:09 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Djava.util.logging.config.file=/opt/shihuc/apache-tomcat-7.0.64/conf/logging.properties
五月 02, 2018 5:09:09 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
五月 02, 2018 5:09:09 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Djava.endorsed.dirs=/opt/shihuc/apache-tomcat-7.0.64/endorsed
五月 02, 2018 5:09:09 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Dcatalina.base=/opt/shihuc/apache-tomcat-7.0.64
五月 02, 2018 5:09:09 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Dcatalina.home=/opt/shihuc/apache-tomcat-7.0.64
五月 02, 2018 5:09:09 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Djava.io.tmpdir=/opt/shihuc/apache-tomcat-7.0.64/temp
五月 02, 2018 5:09:09 下午 org.apache.catalina.core.AprLifecycleListener lifecycleEvent
信息: Loaded APR based Apache Tomcat Native library 1.1.33 using APR version 1.6.3.
五月 02, 2018 5:09:09 下午 org.apache.catalina.core.AprLifecycleListener lifecycleEvent
信息: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].
五月 02, 2018 5:09:09 下午 org.apache.catalina.core.AprLifecycleListener initializeSSL
信息: OpenSSL successfully initialized (OpenSSL 1.0.2k  26 Jan 2017)
五月 02, 2018 5:09:09 下午 org.apache.coyote.AbstractProtocol init
信息: Initializing ProtocolHandler ["http-apr-8080"]
五月 02, 2018 5:09:09 下午 org.apache.coyote.AbstractProtocol init
信息: Initializing ProtocolHandler ["ajp-apr-8009"]
五月 02, 2018 5:09:09 下午 org.apache.catalina.startup.Catalina load
信息: Initialization processed in 464 ms
五月 02, 2018 5:09:09 下午 org.apache.catalina.core.StandardService startInternal
信息: Starting service Catalina
五月 02, 2018 5:09:09 下午 org.apache.catalina.core.StandardEngine startInternal
信息: Starting Servlet Engine: Apache Tomcat/7.0.64

总结:

1. APR这个就算没有配置,也不影响tomcat的正常使用,无非就是性能稍微差点。

2. 在tomcat-native的configure操作中,若不正确配置--with-ssl这个选项的话,其他的就算都配置好了,依然会出现开篇提到的APR提醒信息。也就是说APR功能不启用。

3.关于tomcat启动日志中,下面的这些警告信息,我没有找到最终的解释,但是个人基于http://tomcat.apache.org/tomcat-7.0-doc/config/http.html#Standard_Implementation的介绍,认为是这些警告的信息涉及到的配置在tomcat7里面已经过期了,也就是说找不到相关的配置,即使有这个警告,也没什么问题。若有高人对这个有确切的了解,还请分享下。

五月 02, 2018 5:09:09 下午 org.apache.catalina.startup.SetAllPropertiesRule begin
警告: [SetAllPropertiesRule]{Server/Service/Connector} Setting property 'maxSpareThreads' to '200' did not find a matching property.
五月 02, 2018 5:09:09 下午 org.apache.catalina.startup.SetAllPropertiesRule begin
警告: [SetAllPropertiesRule]{Server/Service/Connector} Setting property 'maxProcessors' to '1000' did not find a matching property.
五月 02, 2018 5:09:09 下午 org.apache.catalina.startup.SetAllPropertiesRule begin
警告: [SetAllPropertiesRule]{Server/Service/Connector} Setting property 'minProcessors' to '5' did not find a matching property.
五月 02, 2018 5:09:09 下午 org.apache.catalina.startup.SetAllPropertiesRule begin
警告: [SetAllPropertiesRule]{Server/Service/Connector} Setting property 'useURIValidationHack' to 'false' did not find a matching property.

猜你喜欢

转载自www.cnblogs.com/shihuc/p/8981858.html