메뉴 건너뛰기

infra

[우분투] java + tomcat 5.5 설치

박영식2010.01.12 20:50조회 수 4104댓글 1

  • 3
    • 글자 크기
1. sun-java6-jdk를 선택해 설치하면 필요한 패키지(bin, jre 등)이 설치된다.



2. tomcat 5.5 를 설치한다.(tomcat 6 를 다운받아 설치해도 무방하다)

 

3. libapache2-mod-jk (apache, tomcat 연동 모듈)을 설치한다.




/etc/apache2/jk 디렉터리를 만들고 아래와 같이 추가 파일을 만든다.
/var/lib/tomcat5.5/webapps/ROOT 디렉터리를 만들고, 하위에 index.jsp 파일을 만들어

<%@ page contentType="text/html;charset=utf-8" %>
 
<HTML>
<HEAD><TITLE>JSP Hello World !!! </TITLE></HEAD>
<BODY>
 
<H2> Hello World : 헬로 월드 </H2>
 
오늘 날짜와 시간 : <%= new java.util.Date() %>
 
</BODY></HTML>

위의 코드를 test 해본다. (tomcat 5.5에서는 port가 8180이므로 http://호스트:8180/ 으로 한다. (tomcat6 는 8080)

mod_jk 설정

  • /etc/apache2/jk/uriworkermap.properties 파일 생성
  1. /jkstatus*=status
  2. /*.jsp=worker1
    /*.do=worker1
  • /etc/apache2/jk/worker.properties 파일 생성
  1. worker.list=worker1, status
  2. # Set properties for worker1 (ajp13)
    worker.worker1.type=ajp13
    worker.worker1.host=localhost
    worker.worker1.port=8009
    worker.worker1.lbfactor=50
    worker.worker1.cachesize=10
    worker.worker1.cache_timeout=600
    worker.worker1.socket_keepalive=1
    worker.worker1.socket_timeout=300
  3. # Set properties for jkstatus
  4. worker.status.type=status
  • /etc/apache2/mods-available/jk.conf 생성
  1. # Where to find workers.properties
    JkWorkersFile /etc/apache2/jk/workers.properties

    # Where to put jk logs
    JkLogFile /var/log/apache2/jk.log
    # Set the jk log level [debug/error/info]
    JkLogLevel info
    # Select the log format
    JkLogStampFormat "[%a %b %d %H:%M:%S %Y]"
    # JkRequestLogFormat
    JkRequestLogFormat "%w %V %T"

    # JkOptions indicates to send SSK KEY SIZE
    JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories

    # 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 /etc/apache2/jk/uriworkermap.properties
  • jk module 사용
  1. $ sudo a2enmod jk


설정이 끝나면, tomcat과 apache를 재실행한다.
# sudo /etc/init.d/tomcat 5.5 restart
# sudo /etc/init.d/apache2 restart

박영식 (비회원)
  • 3
    • 글자 크기
[에러] eclipse에서 저장 안됨(PHP 등) (by 박영식) [storm] 이벤트 스트림 프로세싱(처리)을 위한 분산형 컴퓨팅 프레임워크 (by lispro06)

댓글 달기

댓글 1
박영식
2011.04.29 조회 6045
박영식
2009.08.01 조회 5409
lispro06
2016.03.30 조회 4588
첨부 (3)
1.PNG
15.2KB / Download 68
2.PNG
5.9KB / Download 64
3.PNG
11.2KB / Download 67
위로