mod-jk를 사용하여 Apache2와 연동이 안되서 고수님께 부탁 드립니다.
버전:우분투 6.10 서버 아파치 연동중인데 잘 안되네요 고수님들 한수 부탁 드려요
위키 문서에 나온데로 했는데 머가 잘못됐는지 봐주세요
* http://www.apache.org/dist/jakarta/tomcat-connectors/jk/binaries/linux/ 에서 최신의 jk-1.2 버전을 다운 받습니다.
다음은 jk-1.2.10 의 예 입니다.
* sudo cp jakarta-tomcat-connectors-jk-1.2.10-linux-sles9-i386-prefork.so /usr/lib/apache2/modules/mod_jk.so
/etc/apache2/mods-available/mod_jk.conf 편집
# Load mod_jk module
# Specify the filename of the mod_jk lib
LoadModule jk_module /usr/lib/apache2/modules/mod_jk.so
# Where to find workers.properties
JkWorkersFile /usr/tomcat/conf/myWorkers.properties
# Where to put jk logs
JkLogFile /usr/tomcat/logs/mod_jk.log
# Set the jk log level [debug/error/info]
JkLogLevel info
# Select the log format
JkLogStampFormat "[%a %b %d %H:%M:%S %Y]"
# JkOptions indicates to send SSK KEY SIZE
JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
# JkRequestLogFormat
JkRequestLogFormat "%w %V %T"
# Mount your applications
#JkMount /application/* loadbalancer
# You can use external file for mount points.
# It will be checked for updates each 60 seconds.
# The format of the file is: /url=worker
# /examples/*=loadbalancer
jkMountFile /usr/tomcat/conf/myUriWorkerMap.properties
# Add shared memory.
# This directive is present with 1.2.10 and
# later versions of mod_jk, and is needed for
# for load balancing to work properly
JkShmFile /usr/tomcat/logs/jk.shm
# Add jkstatus for managing runtime data
JkMount status
Order deny,allow
Deny from all
Allow from 127.0.0.1
# Allow from 999.999.999.999, your IP if you want
sudo ln -s /etc/apache2/mods-available/mod_jk.conf /etc/apache2/mods-enabled/mod_jk.conf
다음의 예는 loadbalancer worker와 status worker를 정의해서 전자는 example들을 보는데 사용하고, 후자는 jkstatus를 보는데 사용하는 것입니다.
/usr/tomcat/conf/myWorkers.properties 편집
# Define list of workers that will be used
# for mapping requests
worker.list=loadbalancer,status
# (1) local_worker should be commented out
# to enable load-balancing. Otherwise, only fail-over is available.
# Define Node1
worker.node1.port=8009
worker.node1.host=your IP or apache2 URL
worker.node1.type=ajp13
worker.node1.lbfactor=1
#worker.node1.local_worker=1 (1)
worker.node1.cachesize=10
# Define Node2
worker.node2.port=8009
worker.node2.host= your IP or apache2 URL
worker.node2.type=ajp13
worker.node2.lbfactor=1
#worker.node2.local_worker=1 (1)
worker.node2.cachesize=10
# Load-balancing behaviour
worker.loadbalancer.type=lb
worker.loadbalancer.balanced_workers=node1, node2
worker.loadbalancer.sticky_session=1
worker.loadbalancer.local_worker_only=1
# Status worker for managing load balancer
worker.status.type=status
/usr/tomcat/conf/myUriWorkerMap.properties 편집
# uriworkermap.properties - IIS
#
# This file provides sample mappings for example ajp13w
# worker defined in workermap.properties.minimal
# The general sytax for this file is:
# [URL]=[Worker name]
/jkstatus*=status
/servlets-examples/*=loadbalancer
/jsp-examples/*=loadbalancer
# 내 어플을 정의하려면, 여기에...
#/myApp/*=loadbalancer
# Optionally filter out all .jpeg files inside that context
# For no mapping the url has to start with exclamation (!)
#!/servlets-examples/*.jpeg=loadbalancer
톰캣 먼저 키고 그다음 아파치 켰습니다.
이것대로 하고 나서도 http://localhost를 해도 아파치 화면 그대로입니다.
부탁드령요


댓글 달기