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.

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM