티스토리 뷰
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 |