설치환경
- OS : CentOS 6.4
- Version : tomcat connectors – 1.2.37
- Down URL : http://archive.apache.org/dist/tomcat/tomcat-connectors/jk/tomcat-connectors-1.2.37-src.tar.gz
설치
- 다운로드
# wget http://archive.apache.org/dist/tomcat/tomcat-connectors/jk/tomcat-connectors-1.2.37-src.tar.gz
- 다운로드 받은 파일의 권한 변경
- 다운로드 받은 파일에는 실행권한이 없기 때문에 실행을 할 수 있도록 파일의 권한을 변경
# chmod 755 tomcat-connectors-1.2.37-src.tar.gz
- 다운로드 받은 파일에는 실행권한이 없기 때문에 실행을 할 수 있도록 파일의 권한을 변경
- 설치 파일의 압축을 해제한다.
# tar xvf tomcat-connectors-1.2.37-src.tar.gz
- tomcat-connectors의 native로 이동
# cd tomcat-connectors-1.2.37-src/native/
- 설치 진행
- apxs에 대한 위치 확인
# which apxs
- 설치
# ./configure --with-apxs=/usr/sbin/apxs # make
- apxs에 대한 위치 확인
- 버젼에 맞는 아파치 폴더로 이동
- httpd server 1.x
- apache-1.0
- httpd server 2.x
- apache-2.0
- mod_jk.so 파일을 아파치의 modules에 복사
# cd apache-2.0 # cp mod_jk.so /etc/httpd/modules # chmod 755 /etc/httpd/modules/mod_jk.so
- httpd server 1.x
- workers.properties 파일 생성
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
- httpd-modjk.conf 파일 생성
# 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>
- 원하는 도메인에 설정
- 다음의 설정 부분을 삽입한다.
jkmount /* worker1
- 다음의 설정 부분을 삽입한다.