Post

Tomcat JK Connector 설치 연동

Tomcat JK Connector 설치 연동

설치환경

  1. OS : CentOS 6.4
  2. Version : tomcat connectors – 1.2.37
  3. Down URL : http://archive.apache.org/dist/tomcat/tomcat-connectors/jk/tomcat-connectors-1.2.37-src.tar.gz

설치

  1. 다운로드

    1
    
    # wget http://archive.apache.org/dist/tomcat/tomcat-connectors/jk/tomcat-connectors-1.2.37-src.tar.gz
    
  2. 다운로드 받은 파일의 권한 변경

    • 다운로드 받은 파일에는 실행권한이 없기 때문에 실행을 할 수 있도록 파일의 권한을 변경

      1
      
      # chmod 755 tomcat-connectors-1.2.37-src.tar.gz
      
  3. 설치 파일의 압축을 해제한다.

    1
    
    # tar xvf tomcat-connectors-1.2.37-src.tar.gz
    
  4. tomcat-connectors의 native로 이동

    1
    
    # cd tomcat-connectors-1.2.37-src/native/
    
  5. 설치 진행

    • apxs에 대한 위치 확인

      1
      
      # which apxs
      
    • 설치

      1
      2
      
      # ./configure --with-apxs=/usr/sbin/apxs
      # make
      
  6. 버젼에 맞는 아파치 폴더로 이동

    • httpd server 1.x

      • apache-1.0
    • httpd server 2.x

      • apache-2.0
    • mod_jk.so 파일을 아파치의 modules에 복사

      1
      2
      3
      
      # cd apache-2.0
      # cp mod_jk.so /etc/httpd/modules
      # chmod 755 /etc/httpd/modules/mod_jk.so
      
  7. workers.properties 파일 생성

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    
    worker.list=worker1
       
    worker.template.type=ajp13
    worker.template.lbfactor=1
    worker.template.socket_timeout=30
    worker.template.socket_keepalive=true
    worker.template.recovery_options=4
    worker.template.ping_mode=A
    worker.template.ping_timeout=10000
       
    #worker.template.connection_pool_size=150
    #worker.template.connection_pool_minsize=25
    #worker.template.connection_pool_timeout=30
    #worker.template.max_packet_size=65536
       
    worker.worker1.reference=worker.template
    worker.worker1.host=localhost
    worker.worker1.port=9009
    
  8. httpd-modjk.conf 파일 생성

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    
    # 1. Load Module jk_module
    <IfModule !mod_jk.c>
        LoadModule jk_module modules/mod_jk.so
    </IfModule>
    # 2. jk_module Global configuration of the server
    <IfModule mod_jk.c>
        JkWorkersFile conf/extra/workers.properties
        JkLogFile "/usr/sbin/rotatelogs /service/httpd/logs/modjk-log/mod-jk.log.%Y%m%d 86400"
        JkLogLevel debug
        JkLogStampFormat "[%Y %a %b %d %H:%M:%S]"
        JkRequestLogFormat "%w %R %V %T"
        JkOptions +ForwardKeySize +ForwardURICompatUnparsed -ForwardDirectories
        #JkMountFile conf/extra/uriworkermap.properties
        JkShmFile /service/httpd/logs/modjk-log/mod-jk.shm
    </IfModule>
    
  9. 원하는 도메인에 설정

    • 다음의 설정 부분을 삽입한다.

      1
      
      jkmount /* worker1
      
This post is licensed under CC BY 4.0 by the author.