|
Apache recommends apr support for Tomcat installation, but apache-tomcat- < version> .tar.gz is not installed and needs to be compiled and installed separately. This article describes how to install apr support.
table of Contents
0, the premise
1, ready to download
2, the installation of apr
3, the installation apr-util
4, the installation of tomcat-native
5, the overall inspection installation
6, after the installation configuration
7, the results of testing
8, Postscript
In the installation and configuration of JDK and tomcat, you can provide web access support, but the information in the boot which will be related to the tips that you are required to install apr support, and install the apr support the need to use the source code step by step.
Please follow me, use the source code to install apr support.
0, the premise
1. Please install and configure the JDK and tomcat, and create a link file, so
/ Usr / java / jdk
Equivalent to the root directory of the JDK
/ Usr / local / tomcat
The equivalent of tomcat root directory.
2. Has been installed openssl development kit, whether it is installed by source code or using the package manager installation, use the package manager can be installed
Yum install openssl-devel
1, ready to download
In order to install apr support, you need to download apr- < version> .tar.gz and apr-util- < version> .tar.gz, the current latest versions are apr-1.5.2.tar.gz and apr-util-1.5. 4.tar.gz, this is my second time to install the version.
Download, use Ali cloud image, access speed very fast, or you can use other images
Http: // http: //mirrors.aliyun.com/apache/apr/apr-1.5.2.tar.gz
Http://mirrors.aliyun.com/apache/apr/apr-util-1.5.4.tar.gz
Or can visit the official Apache download site, but not recommended, because it will increase the burden on the server, Apache also repeatedly stressed that they do not directly download from (in fact, download from the mirror site is the same, but also faster)
Http://archive.apache.org/dist/apr/apr-1.5.2.tar.gz
Http://archive.apache.org/dist/apr/apr-util-1.5.4.tar.gz
After downloading these two documents, upload to the system
/ Usr / local / src
Directory, in preparation for the next compiler to install.
2, the installation of apr
Extract apr-1.5.2.tar.gz, get the folder apr-1.5.2, into the folder, the implementation of the following command
./configure
Make
Make install
Originally, we can specify the location of the installation, but I am here to acquiescence to, if you want to develop the installation location, please refer to the folder "README" file, which is described. At the same time, if re-designated the installation location, then the location will be followed by the change.
The default installation location is / usr / local / apr, you can check to see if there is this file system directory, as well as files in the directory modify date, etc., to confirm the success of the installation.
Can also be based on the output of each step to determine the success of the command to determine if there is any problem, to be resolved in time for follow-up operation.
3, the installation apr-util
Decompress apr-util-1.5.4.tar.gz, get the folder apr-util-1.5.4, into the folder, followed by execution
./configure --with-apr = / usr / local / apr
Make
Make install
Here is the time to configure the directory specified before the installation of the apr directory, if you modify the default path, there should be corresponding to modify.
This installation or installation path to the lib directory under the apr, that is
/ Usr / local / apr / lib
You can enter the directory to view the file information to confirm the success. Can also be based on the output of each step to determine the success of the command to determine if there is any problem, to be resolved in time for follow-up operation.
4, the installation of tomcat-native
Tomcat-native? What is it? In front of no download ah?
Indeed, I just started when the Internet search is also very confusing, but one person said, "just download the tomcat bin directory below", I went to see a bit, and sure enough there! .
We will install the tomcat tomcat-native.tar.gz bin directory to copy the file
/ Usr / local / src
, And unzip it to get the directory tomcat-native- < version> -src. There is a description in this directory that tells us how to build it.
Into the directory
Jni / native
Directory, this directory is the file we need the file, followed by the implementation of the following command
./configure --with-apr = / usr / local / apr --with-java-home = / usr / java / jdk
Make
Make install
Here, apr directory to use when installing apr in front of the directory, if modified, please also modify the corresponding, java directory to use jdk root directory, if not this also modify.
After the above command is executed, it will be in the directory
/ Usr / local / apr / lib
To generate the corresponding file, you can view the file to confirm the installation is successful. Can also be based on the output of each step to determine the success of the command to determine if there is any problem, to be resolved in time for follow-up operation.
5, the overall inspection installation
Installation success or not, depends on the installation directory on the line, the following command output should be similar to the greater the country out of the case, please double-check
[Root @ CooVox-U100 apr] # pwd
/ Usr / local / apr
[Root @ CooVox-U100 apr] # ls -l
Total 16
Drwxr-xr-x 2 root root 4096 May 22 10:51 bin
Drwxr-xr-x 2 root root 4096 May 22 10:47 build-1
Drwxr-xr-x 3 root root 4096 May 22 10:47 include
Drwxr-xr-x 3 root root 4096 May 22 11:44 lib
[Root @ CooVox-U100 apr] # cd lib /
[Root @ CooVox-U100 lib] # ls -l
Total 5164
-rw-r - r-- 1 root root 9278 May 22 10:47 apr.exp
-rw-r - r-- 1 root root 5272 May 22 10:51 aprutil.exp
-rw-r - r-- 1 root root 933930 May 22 10:47 libapr-1.a
-rwxr-xr-x 1 root root 972 May 22 10:47 libapr-1.la
Lrwxrwxrwx 1 root root 17 May 22 10:47 libapr-1.so -> libapr-1.so.0.5.2
Lrwxrwxrwx 1 root root 17 May 22 10:47 libapr-1.so.0 -> libapr-1.so.0.5.2
-rwxr-xr-x 1 root root 639267 May 22 10:47 libapr-1.so.0.5.2
-rw-r - r-- 1 root root 565304 May 22 10:51 libaprutil-1.a
-rwxr-xr-x 1 root root 1070 May 22 10:51 libaprutil-1.la
Lrwxrwxrwx 1 root root 21 May 22 10:51 libaprutil-1.so -> libaprutil-1.so.0.5.4
Lrwxrwxrwx 1 root root 21 May 22 10:51 libaprutil-1.so.0 -> libaprutil-1.so.0.5.4
-rwxr-xr-x 1 root root 416002 May 22 10:51 libaprutil-1.so.0.5.4
-rw-r - r-- 1 root root 372902 May 22 10:51 libexpat.a
-rwxr-xr-x 1 root root 928 May 22 10:51 libexpat.la
Lrwxrwxrwx 1 root root 17 May 22 10:51 libexpat.so -> libexpat.so.0.5.0
Lrwxrwxrwx 1 root root 17 May 22 10:51 libexpat.so.0 -> libexpat.so.0.5.0
-rwxr-xr-x 1 root root 329742 May 22 10:51 libexpat.so.0.5.0
-rw-r - r-- 1 root root 1136746 May 22 11:44 libtcnative-1.a
-rwxr-xr-x 1 root root 1055 May 22 11:44 libtcnative-1.la
Lrwxrwxrwx 1 root root 23 May 22 11:44 libtcnative-1.so -> libtcnative-1.so.0.1.33
Lrwxrwxrwx 1 root root 23 May 22 11:44 libtcnative-1.so.0 -> libtcnative-1.so.0.1.33
-rwxr-xr-x 1 root root 794996 May 22 11:44 libtcnative-1.so.0.1.33
Drwxr-xr-x 2 root root 4096 May 22 11:44 pkgconfig
6, after the installation configuration
After installation also need to be configured to enable apr.
Modify the file
/ Etc / profile
Find the end of the file in
Export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE INPUTRC JAVA_HOME
& Lt; / RTI & gt;
# Tomcat-apr
Export LD_LIBRARY_PATH = $ LD_LIBRARY_PATH: / usr / local / apr / lib
Then you can save the file.
Finally, do not forget to make this configuration effective, use the following command (restart the machine can also be)
Source / etc / profile
7, the results of testing
After the implementation of the above steps, even if the installation is complete, but in the end there is no success, the following to verify.
First delete the tomcat all running records, and then start tomcat, view the file
Catalina.out
Carefully look for this file in the middle section if there is something like this output
22-May-2015 11: 46: 11.393 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent
Loaded APR based Apache Tomcat Native library 1.1.33 using APR version 1.5.2.
22-May-2015 11: 46: 11.393 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent
APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].
22-May-2015 11: 46: 11.851 INFO [main] org.apache.catalina.core.AprLifecycleListener.initializeSSL
OpenSSL successfully initialized (OpenSSL 0.9.8e-rhel5 01 Jul 2008)
It means that the installation and configuration are successful; but if it is similar to this, (in fact, when not installed is the case)
22-May-2015 14: 05: 57.427 INFO [main] 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:: / usr / java / packages / lib / i386: / lib: / usr / lib
It shows no success.
8, Postscript
The entire installation process is not complicated, step by step in accordance with the steps, very law-abiding, the need is a bold attempt to heart! .
It is said that the apr installed tomcat can improve performance, I do not know if it is true, but it seems to be able to support the OpenSSL The eh, after the time to try!
|
|
|
|