JK2#
- Apache 설치
- Tomcat 설치
- mod_jk2 컴파일
wget http://mirror.apache.or.kr/jakarta/tomcat-connectors/jk2/jakarta-tomcat-connectors-jk2-src-current.tar.gz tar zxf jakarta-tomcat-connectors-jk2-src-current.tar.gz cd jakarta-tomcat-connectors-jk2-2.0.2-src/jk/native2 chmod +x buildconf.sh ./buildconf.sh ./configure --with-apxs2=/usr/local/apache2/bin/apxs make libtool --finish /usr/local/apache2/modules cp ~/jakarta-tomcat-connectors-jk2-2.0.2-src/jk/build/jk2/apache2/mod_jk2.so /usr/local/apache2/modules cp ~/jakarta-tomcat-connectors-jk2-2.0.2-src/jk/build/jk2/apache2/jkjni.so /usr/local/apache2/modules
- httpd.conf에 mod_jk2 등록
LoadModule jk2_module modules/mod_jk2.so
- workers2.properties 설정. 이 파일은 아파치의 mod_jk2 모듈에서 사용하는 파일입니다. 여기서 연결할 톰캣에 대한 정보를 설정합니다.
[logger.apache2] level=DEBUG [shm] file=/usr/local/apache2/logs/shm.file size=1048576 # Announce a "status" worker [status:status] # define the socket [channel.socket:tomcat1:8009] port=8009 host=192.168.1.11 [channel.socket:tomcat1:8010] port=8010 host=192.168.1.11 [channel.socket:tomcat2:8009] port=8009 host=192.168.1.12 [channel.socket:tomcat2:8010] port=8010 host=192.168.1.12 # define the worker associated to socket [ajp13:tomcat1:8009] channel=channel.socket:tomcat1:8009 lb_factor=10 group=lb:0 [ajp13:tomcat1:8010] channel=channel.socket:tomcat1:8010 lb_factor=10 group=lb:0 [ajp13:tomcat2:8009] channel=channel.socket:tomcat2:8009 lb_factor=10 group=lb:0 [ajp13:tomcat2:8010] channel=channel.socket:tomcat2:8010 lb_factor=10 group=lb:0 # Uri mapping [uri:/*.jsp] group=lb:0 [uri:/*.nhn] group=lb:0 [uri:/servlet/*] group=lb:0 [uri:/status/*] worker=status:status [logger.file] file=/usr/local/apache2/logs/jk2.log
- Tomcat server.xml
- jk2.properties
- 아무 것도 안해도 잘 동작합니다.
JK#
자바분류