Tomcat 7 에서 Tomcat 9 로 WAS 업데이트 하는 이유? APR 라이브러리!!
▣ APR 이란?
Apache Portable Runtime의 약자로 아파치 HTTP 2.x의 핵심인 라이브러리
▣ Tomcat Native Library란?
Apache 웹 서버의 APR 라이브러리를 Tomcat에서 사용할 수 있게 하는 라이브러리
- 톰캣 버전별 HTTP Connector
BIO Connector |
Tomcat 7의 기본 Connector org.apache.coyote.http11.Http11Protocol Java Blocking API를 사용하여 구현(pure java) |
NIO Connector |
Tomcat 8 이후 기본 Connector Class org.apache.coyote.http11.Http11NioProtocol Java Non-blocking API를 사용하여 구현(pure java) |
APR Connector | APR 라이브러리를 사용해 더 나은 성능의 Connector Class
org.apache.coyote.http11.Http11AprProtocol JNI(Java Native Interface) 라이브러리를 사용하여 구현 |
▣ Tomcat Native Library 설치
- Tomcat Native Library 설치 없이 Tomcat 9를 기동시켰을 경우 기동로그에 아래와 같은 메세지 출력 됨
이 메시지의 의미는 APR library를 찾지 못해서 HTTP NIO Connector를 실행 했다는 의미이다.
기능 상에는 문제가 없으나 더 좋은 성능을 내기 위해서 HTTP APR Connector 사용을 검토해야 한다.
1) 패키지 설치(APR 컴파일 시 필요)
yum –y install openssl-devel
yum –y groupinstall “Development Tools”
yum –y install expat-devel
2) APR 다운로드 및 설치
2-1) cd /opt
2-2) wget http://mirror.navercorp.com/apache//apr/apr-1.7.0.tar.gz
2-3) gzip –d apr-1.7.0.tar.gz
2-4) tar –xvf apr-1.7.0.tar
2-5) cd apr-1.7.0
2-6) ./configure
2-7) make
2-8) make install
3) APR-util 다운로드 및 설치
3-1) cd /opt
3-2) wget http://mirror.navercorp.com/apache//apr/apr-util-1.6.1.tar.gz
3-3) gzip –d apr-util-1.6.1.tar.gz
3-4) tar –xvf apr-util-1.6.1.tar
3-5) cd apr-util-1.6.1
3-6) ./configure –-with-apr=/usr/local/apr
3-7) make
3-8) make install
4) Tomcat-Native 설치
4-1) cd /opt/tomcat9.0.24/bin
4-2) gzip –d tomcat-native.tar.gz
4-3) tar –xvf tomcat-native.tar
4-4) cd tomcat-native-1.2.23-src/native
4-5) ./configure --with-apr=/usr/local/apr --with-java-home=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.191.b12-0.el6_10.x86_64
※ 해당 오류 발생 시 openssl 최신버전 설치
4-5-1) openssl version 확인
4-5-2) cd /usr/local/src (다운로드 받을 폴더로 이동)
4-5-3) wget https://www.openssl.org/source/openssl-1.1.1c.tar.gz
4-5-4) gzip -d openssl-1.1.1c.tar.gz
4-5-5) tar xvf openssl-1.1.1c.tar
4-5-6) cd openssl-1.1.1c
4-5-7) ./config
4-5-8) make
4-5-9) make install
4-5-10) /usr/local/ssl 생성 확인
4-5-11) openssl version 확인(여전히 이전 버전으로 출력 됨)
4-5-12) which openssl (현재 openssl 경로 확인. 대부분 /usr/bin/openssl 에 있음)
4-5-12) 기존 파일 백업 (mv openssl /root/openssl_1.0.1_bakup )
4-5-13) ln –s /usr/local/src/bin/openssl /usr/bin/openssl (새로 설치된 openssl로 링크 걸기)
4-5-14) openssl 버전 확인(업데이트 되었음)
4-5-15) 4-5번 재실행
5) Tomcat catalina.sh에 apr 라이브러리 경로 추가
CATALINA_OPTS="-Djava.library.path=/usr/local/apr/lib"
※ 참고 URL
https://toma0912.tistory.com/61
APR 및 Tomcat Native Library (was 성능 향상)
안녕하세요. 오늘은 APR 및 tomcat native library를 설정하는 방법에 대해서 포스팅 하겠습니다. APR이란 Apache Portable Runtime의 약자이며 자세한 내용은 아래 링크를 참조하면 됩니다. 참조 : https://tomca..
toma0912.tistory.com
tomcat 8.5 tomcat-native 설치 및 설정
Caused by: org.apache.catalina.LifecycleException: The configured protocol requires the APR/native library which is not availabletomcat 8.5 버전에서 HTTP/2 를 사용하려면 tomcat native를 이용하면 HTTP/2를 이용할 수 있다CEN...
xinet.kr
http://mirror.navercorp.com/apache/apr/
Index of /apache/apr
This downloads page includes only the sources to compile and build APR projects, using the proper tools. All of the release distribution packages have been digitally signed (using PGP or GPG) by the ASF committers that constructed them. There will be an ac
mirror.navercorp.com
https://www.openssl.org/source/
/source/index.html
The master sources are maintained in our git repository, which is accessible over the network and cloned on GitHub, at https://github.com/openssl/openssl. Bugs and pull patches (issues and pull requests) should be filed on the GitHub repo. Please familiari
www.openssl.org
'Linux' 카테고리의 다른 글
Tomcat 7 에서 Tomcat 9 로 WAS버전 업데이트 (0) | 2019.09.17 |
---|---|
Apache(웹서버) & Tomcat(WAS) 설치 및 연동 (0) | 2019.07.07 |
Cent OS 7 설치 및 기본세팅 (0) | 2019.07.07 |
포트번호로 프로세스 찾기(WAS 포트 겹칠 때) (0) | 2019.02.22 |
crontab 설정 (0) | 2019.02.22 |