ubuntu에서 tomcat설치 및 apache2에 연동
Linux/Linux 일반 :
2007. 5. 25. 22:36
반응형
1. tomcat을 다운 받아 압축을 푼후, 다음과 같이 설치한다.
(경우에 따라 버전이 다른 tomcat을 설치하는 경우가 있어, 이 방법을 선호한다.)
$ tar xvf tomcat.tar.gz
$ ln -s untardTomcatDir tomcat
설치완료를 태스트해본다. (http://localhost:8080)
2. /etc/bash.bashrc 혹은 ~/.bashrc 의 마지막에 다음 두 줄 추가.
(Java가 미리 설치된 것으로 가정)
export JAVA_HOME=~/jdk 링크위치
export TOMCAT_HOME=~/tomcat 링크위치
3. mod-jk를 사용해서 연동
a. sudo apt-get install libapache2-mod-jk (universe 저장소)
b. /etc/apache2/mods-available/jk.load
LoadModule jk_module /usr/lib/apache2/modules/mod_jk.so
c. /etc/apache2/mods-available/jk.conf
JkWorkersFile /etc/apache2/jk/workers.properties
# Where to put jk logs
#JkLogFile /home/dong100/var/log/mod_jk.log
JkLogFile /dev/null
# Set the jk log level [debug/error/info]
JkLogLevel info
# Select the log format
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
# JkOptions indicate to send SSL KEY SIZE,
JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
JkShmFile /home/dong100/var/log/jk-runtime-status
# JkRequestLogFormat set the request format
JkRequestLogFormat "%w %V %T"
# Load mount points
JkMountFile /etc/apache2/jk/uriworkermap.properties
4. sudo a2enmod jk
5. workers.properties
workers.tomcat_home=tomcat 링크위치
workers.java_home=jdk 링크위치
ps=/
worker.list=ajp13
worker.ajp13.port=8009
worker.ajp13.host=127.0.0.1
worker.ajp13.type=ajp13
아래내용은 분산서버의 경우임.
# 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
6. uriworkermap.properties
/*.jsp=ajp13
/*.do=ajp13
/servlet/*=ajp13
7. sudo /etc/init.d/apache2 reload
출처 : http://blog.naver.com/no1ordie?Redirect=Log&logNo=50009874421dfgfg
(경우에 따라 버전이 다른 tomcat을 설치하는 경우가 있어, 이 방법을 선호한다.)
$ tar xvf tomcat.tar.gz
$ ln -s untardTomcatDir tomcat
설치완료를 태스트해본다. (http://localhost:8080)
2. /etc/bash.bashrc 혹은 ~/.bashrc 의 마지막에 다음 두 줄 추가.
(Java가 미리 설치된 것으로 가정)
export JAVA_HOME=~/jdk 링크위치
export TOMCAT_HOME=~/tomcat 링크위치
3. mod-jk를 사용해서 연동
a. sudo apt-get install libapache2-mod-jk (universe 저장소)
b. /etc/apache2/mods-available/jk.load
LoadModule jk_module /usr/lib/apache2/modules/mod_jk.so
c. /etc/apache2/mods-available/jk.conf
JkWorkersFile /etc/apache2/jk/workers.properties
# Where to put jk logs
#JkLogFile /home/dong100/var/log/mod_jk.log
JkLogFile /dev/null
# Set the jk log level [debug/error/info]
JkLogLevel info
# Select the log format
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
# JkOptions indicate to send SSL KEY SIZE,
JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
JkShmFile /home/dong100/var/log/jk-runtime-status
# JkRequestLogFormat set the request format
JkRequestLogFormat "%w %V %T"
# Load mount points
JkMountFile /etc/apache2/jk/uriworkermap.properties
4. sudo a2enmod jk
5. workers.properties
workers.tomcat_home=tomcat 링크위치
workers.java_home=jdk 링크위치
ps=/
worker.list=ajp13
worker.ajp13.port=8009
worker.ajp13.host=127.0.0.1
worker.ajp13.type=ajp13
아래내용은 분산서버의 경우임.
# 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
6. uriworkermap.properties
/*.jsp=ajp13
/*.do=ajp13
/servlet/*=ajp13
7. sudo /etc/init.d/apache2 reload
출처 : http://blog.naver.com/no1ordie?Redirect=Log&logNo=50009874421dfgfg
반응형
'Linux > Linux 일반' 카테고리의 다른 글
Ubuntu apt를 이용한 JDK,Tomcat,Apache,JK설치 (0) | 2007.05.25 |
---|---|
BSD (0) | 2007.04.24 |
Samba Server(삼바? 쌈바?) (0) | 2007.04.13 |