tomcat7,8 centos7 配置apr極好教程
阿新 • • 發佈:2018-12-25
轉自:http://blog.csdn.net/remote_roamer/article/details/51719891
第一次我自己是用的yum安裝apr, apr-utils, tomcat-native,
但是啟動tomcat的時候,提示我tomcat-native版本過低,所以不得不手動安裝,如下:
-
# 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
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
-
# 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
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
-
安裝 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)
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
-
安裝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
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
-
重新安裝 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
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 檢查是否安裝成功
# 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 Ma