티스토리 뷰

Study

Tomcat(톰캣) mod_jk 설정 관련

메디츠 2024. 1. 7. 12:01
반응형

16년 10월 기준.

 

wget http://mirror.apache-kr.org/tomcat/tomcat-connectors/jk/tomcat-connectors-1.2.42-src.tar.gz

 

tar -xvzf tomcat-connectors-1.2.41-src.tar.gz

cd native

./configure --with-apxs=/usr/local/httpd/bin/apxs

make

make install

// 아파치 폴더/modules/mod_jk.so 생성

 

/usr/local/httpd/conf/workers.properties

# Define 1 real worker using ajp13

worker.list=worder1,worker2,loadbalancer

 

# Set properties for worker1 (ajp13)

worker.worker1.type=ajp13

worker.worker1.host=localhost

worker.worker1.port=8009

worker.worker1.lbfactor=1

worker.worker1.socket_keepalive=0

 

# Set properties for worker2 (ajp13)

worker.worker2.type=ajp13

worker.worker2.host=localhost

worker.worker2.port=8010

worker.worker2.lbfactor=1

worker.worker2.socket_keepalive=0

 

# Set properties for loadbalancer

worker.loadbalancer.type=lb

worker.loadbalancer.balance_workers=worker1,worker2

worker.loadbalancer.sticky_session=1

 

// lbfactor 작업 할당량 비율

 

/usr/local/httpd/conf/mod_jk.conf

#

# HTTPD Web Server and Apache Tomcat(ajp) Connector

# the configuration of the server

#

# Required modules: mod_jk (for the ajp handler),

#

LoadModule jk_module modules/mod_jk.so

 

JkShmFile logs/mod_jk.shm

JkLogFile logs/mod_jk.log

 

JkLogLevel info

 

JKMount /* loadbalancer

JKWorkersFile conf/workers.properties

 

// JkMountFile conf/uriworkermap.properties 굳이 사용할 필요없음.

로그 관리시 추가

JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "

JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories

JkRequestLogFormat "%w %V %T"

 

http://tomcat.apache.org/tomcat-3.3-doc/mod_jk-howto.html

 

// VirtualHost 관련 추가

conf/httpd.conf

Include conf/extra/httpd-vhosts.conf 주석해제

 

conf/extra/httpd-vhosts.conf

<VirtualHost *:80>

ServerAdmin webmaster@test.com

DocumentRoot "/usr/local/httpd/"

ServerName test

ServerAlias localhost

ErrorLog "logs/test-error_log"

CustomLog "logs/test-access_log" common

JkMount /* loadbalancer

</VirtualHost>

반응형

'Study' 카테고리의 다른 글

HAProxy(에이치에이프록시) SSL 관련  (1) 2024.01.07
Java(자바) send mail(메일 보내기)  (0) 2024.01.07
keepalived(킵얼라이브) 관련  (1) 2024.01.07
Apache(아파치) 설치  (0) 2024.01.07
HAProxy(에이치에이프록시) 관련  (1) 2024.01.07
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
TAG
more
«   2025/01   »
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
글 보관함