Under The Sea

apache - tomcat 연동 mod_jk 본문

IT

apache - tomcat 연동 mod_jk

브로콜리's 2017.10.03 14:21
1. mod_jk 다운 및 압축해제
[ec2-user@ip-172-31-16-251 ~]$ cd /tmp/
[ec2-user@ip-172-31-16-251 tmp]$ wget http://apache.tt.co.kr/tomcat/tomcat-connectors/jk/tomcat-connectors-1.2.42-src.tar.gz
[ec2-user@ip-172-31-16-251 tmp]$ tar xvf tomcat-connectors-1.2.42-src
2. mod_jk 설치
// apxs 경로 확인
[ec2-user@ip-172-31-16-251 conf]$ which apxs
/usr/local/apache2/bin/apxs

[ec2-user@ip-172-31-16-251 tmp]$ cd tomcat-connectors-1.2.42-src/native/
[ec2-user@ip-172-31-16-251 native]$ ./configure --with-apxs=/usr/local/apache2/bin/apxs
[ec2-user@ip-172-31-16-251 native]$ sudo make
[ec2-user@ip-172-31-16-251 native]$ sudo make install
3. 환경변수 설정
[ec2-user@ip-172-31-16-251 native]$ cd /usr/local/apache2/conf/
- workers.properties 파일 생성
// 자바 경로 확인
[ec2-user@ip-172-31-16-251 conf]$ which java
/usr/bin/java

[ec2-user@ip-172-31-16-251 conf]$ sudo vim workers.properties

workers.tomcat_home="/usr/local/tomcat8/"
workers.java_home="/usr/bin/java"
ps=/
worker.list=ajp13
worker.ajp13.port=8009
worker.ajp13.host=localhost
worker.ajp13.type=ajp13
- mod_jk.conf 파일 생성
[ec2-user@ip-172-31-16-251 conf]$ sudo vim mod_jk.conf
 <ifmodule mod_jk.c="">
        JkWorkersFile "/usr/local/apache2/conf/workers.properties"
        JkLogFile "/usr/local/tomcat8/logs/mod_jk.log"
        JkLogLevel info
        JkAutoAlias "/usr/local/tomcat8/webapps"
        JkMount /* ajp13
        JkMount /*.jsp ajp13
        JkMount /servlet/* ajp13
        JkMount /examples/*.jsp ajp13
        JkLogStampFormat "[%a %b %d %H:%M:%S %Y]"
        JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
        JkRequestLogFormat "%w %V %T"
</ifmodule>

- httpd.conf 환경 설정

[ec2-user@ip-172-31-16-251 native]$ sudo vim httpd.conf

LoadModule jk_module modules/mod_jk.so

<ifmodule dir_module="">
    DirectoryIndex index.html indes.jsp
</ifmodule>

include conf/mod_jk.conf
4. 아파치 재시작
[ec2-user@ip-172-31-16-251 conf]$ sudo /usr/local/apache2/bin/httpd -k stop
[ec2-user@ip-172-31-16-251 conf]$ sudo /usr/local/apache2/bin/httpd -k start


'IT' 카테고리의 다른 글

Centos7 & APM 구버전 설치  (0) 2018.04.14
apache ssl 인증서 설치  (0) 2017.10.03
apache - tomcat 연동 mod_jk  (0) 2017.10.03
리눅스 아파치 설치  (0) 2017.10.03
정규식  (0) 2017.07.11
Oracle 11g Express Edition 설치하기  (0) 2017.07.07
0 Comments
댓글쓰기 폼