'2009/04'에 해당되는 글 1건

  1. 2009.04.02 Apache2 + Tomcat 5.5 + Hudson

Apache2 + Tomcat 5.5 + Hudson

|
1. Server 설치
1.1 Apache2 설치
$> sudo apt-get install apache2
동작 확인 : http://localhost

1.2 Tomcat 5.5 설치
$> sudo apt-get install tomcat5.5 tomcat5.5-webapps tomcat5.5-admin
동작 확인 : http://localhost:8180

1.3 JK Connection
$> sudo apt-get install libapache2-mod-jk

2. Configuration
2.1 Apache
apache2.conf 화일 맨 밑에 ServerName 추가
$> sudo vi /etc/apache2/apache2.conf
ServerName localhost

2.2 JK Connection
Apache Server에서 JK Connection을 이용하기 위하여 아래와 같이 Configuration 화일을 생성
$> sudo vi /etc/apache2/mods-available/jk.conf
<IfModule jk_module>
    JkWorkersFile /etc/apache2/jk/workers.properties
    JkShmFile /var/log/apache2/jk.shm
    JkLogFile /var/log/apache2/jk.log
    JkLogLevel info
    JkLogStampFormat "[%a %b %d %H:%M:%S %Y]"
    JkRequestLogFormat "%w %V %T"
</IfModule>

Tomcat Server와 통신하기 위한 worker.properties 설정
$> sudo mkdir /etc/apache2/jk
$> sudo vi /etc/apache2/jk/workers.properties
worker.list=worker1, status

worker.worker1.type=ajp13
worker.worker1.host=localhost
worker.worker1.port=8009
worker.worker1.lbfactor=50
worker.worker1.socket_keepalive=1
worker.worker1.socket_timeout=300

# Set properties for jkstatus
worker.status.type=status

Apache Server에서 JK Connection Module을 활성화 시킴
$> sudo a2enmod jk

만약 활성화가 되어 있다면, 비활성화 / 활성화 과정을 거침
$> sudo a2dismod jk
$> sudo a2enmod jk

Apache Server에서 Tomcat Server로 전달할 Content 설정
연결할 Hudson을 처리 ( ※여기서는 http://localhost/hudson 로 설정 )
$> sudo vi /etc/apache2/jk/uriworkermap.properties
/*.jsp=worker1
/*.do=worker1
/hudson/*=worker1
/jkstatus*=status

Apache Server의 Default VirtualHost에 연결 정보 설정
$> sudo vi /etc/apache2/sites-available/default
....
JkMountFile /etc/apache2/jk/uriworkermap.properties
</VirtualHost>


3. Hudson 설치
$> cd /var/lib/tomcat5.5/webapps
$> sudo wget http://hudson.gotdns.com/latest/hudson.war

Tomcat에 Hudson War Deploy
$> cd /var/lib/tomcat5.5
$> sudo mkdir hudson
$> sudo chown tomcat55 hudson

Tomcat에 Hudson Home 설정 및 TOMCAT5_SECURITY 변경
$> sudo vi /etc/init.d/tomcat5.5
# Set java.awt.headless=true if JAVA_OPTS is not set so the
# Xalan XSL transformer can work without X11 display on JDK 1.4+
# It also looks like the default heap size of 64M is not enough for most cases
# se the maximum heap size is set to 128M
if [ -z "$JAVA_OPTS" ]; then
JAVA_OPTS="-Djava.awt.headless=true -Xmx128M"
JAVA_OPTS="$JAVA_OPTS -DHUDSON_HOME=/var/lib/tomcat5.5/hudson"
fi

....

# Use the Java security manager? (yes/no)
TOMCAT5_SECURITY=no

4. Server Restart ( Tomcat -> Apache 순)
$> sudo /etc/init.d/tomcat5.5 restart
$> sudo /etc/init.d/apache2 restart

5. 동작 확인
Apache-Tomcat 연동 : http://localhost/jkstatus
Hudson 구동 : http://localhost/hudson

참고 http://suereth.blogspot.com/2008/08/ubuntu-dev-server-hudson.html
Trackback 0 And Comment 0
prev | 1 | next

티스토리 툴바