본문 바로가기

우분투, 리눅스

우분투9.10 - Tomcat6 와 Apache2연동

1) sudo apt-get install apache2 tomcat6 libapache2-mod-jk
2) sudo vim /etc/apache2/workers.properties
내용추가:
# Define 1 real worker using ajp13
worker.list=worker1
# Set properties for worker1 (ajp13)
worker.worker1.type=ajp13
worker.worker1.host=localhost
worker.worker1.port=8009

3) sudo vim /etc/apache2/apache2.conf
맨 아래줄 내용추가:
# Load mod_jk module
# Update this path to match your modules location
LoadModule jk_module /usr/lib/apache2/modules/mod_jk.so
# Declare the module for (remove this line on Apache 2.x)
#AddModule mod_jk.c
# Where to find workers.properties
# Update this path to match your conf directory location (put workers.properties next to httpd.conf)
JkWorkersFile /etc/apache2/workers.properties
# Where to put jk shared memory
# Update this path to match your local state directory or logs directory
JkShmFile /var/log/apache2/mod_jk.shm
# Where to put jk logs
# Update this path to match your logs directory location (put mod_jk.log next to access_log)
JkLogFile /var/log/apache2/mod_jk.log
# Set the jk log level [debug/error/info]
JkLogLevel info
# Select the timestamp log format
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "


6) sudo vim /etc/apache2/sites-enabled/000-default
주석처리 "DocumentRoot /var/www" 
바로 아래줄에 두줄 추가
JkMount / worker1
JkMount /* worker1

7) 톰캣의 8009번포트 활성화
sudo vim /etc/tomcat6/server.xml
아래 라인의 주석된것을 삭제
<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />

8) 톰캣재시작
sudo /etc/init.d/tomcat6 restart

9) 아파치재시작
sudo /etc/init.d/apache2 restart

10) 웹에서 접속
80포트로 접속했을시에 톰캣페이지가 나오면 성공