본문 바로가기

Java & Html

JEUS&WEBTOB 가이드

336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.
[JEUS]JEUS&WEBTOB 가이드 | WAS 2006/06/08 09:20
http://blog.naver.com/neolithe/20024796209
이 문서는 ww.tmax.co.kr 에서 개발/배포하는

웹서버(WebToB)와 웹어플리케이션서버(JEUS)의 설치 및 시동, 연동, 경로설정에 관한 자료입니다.

(버젼 : JEUS4.2, WEBTOB3.1.6(build3), j2sdk1.4.1_07) 

  ### 설치/시동/테스팅/종료 ###

----------------------------------------------------------------------------------------

1. 필요 프로그램

- j2sdk1.4.1_07 (http://java.sun.com)       # j2sdk1.4.1_07 이하 버젼 권장 (1.4.2버젼대에서는 문제발생할 수 있음)

- jeus42.exe (http://www.tmax.co.kr)

- webtob_3.1.6(build3).exe (http://www.tmax.co.kr)

----------------------------------------------------------------------------------------

2. j2sdk1.4.1_07 설치

- path 맨 앞에 C:/jdk1.4.1_07/bin 설정

- classpath에 . 설정

----------------------------------------------------------------------------------------

3. JEUS42 설치

- JEUS42.exe를 실행 

  (windows2003 서버의 경우 installing... uninstall부분에서 정지시는 windows2000호환성모드로 다시 실행)

- http://www.tmax.co.kr의 download링크를 클릭 (회원가입필요)

  JEUS license를 신청 -> 이메일을 통해 license부여받음 (90일 사용가능)

  부여받은 license파일을 제우스홈\license에 복사 (덮어쓰기)

- 설치 후 다음 세개의 파일을 자신의 환경에 맞게 편집

  1) 제우스홈\config\노드명\JEUSMain.xml 

  2) 제우스홈\webhome\servlet_home\webapps\examples\web-inf\web.xml
  3) 제우스홈\config\노드명\노드명_servlet_engine1\WEBMain.xml

-------------------------------------------------------------------------------------

4. webtob3.1.6 설치

- webtob_3.1.6(build3).exe 실행하여 설치 

  (windows2003에서 installing... uninstall부분에서 정지시는 windows2000호환성모드로 다시 실행)

- http://www.tmax.co.kr의 download링크를 클릭 (회원가입필요)

  WEBTOB license를 신청 -> 이메일을 통해 license.dat부여 (90일 사용가능)

  부여받은 license.dat파일을 c:\webtob\license에 복사 (덮어쓰기)

-------------------------------------------------------------------------------------

5. PATH 설정 후 리부팅 : 자신의 환경에 맞게 설정하고 시스템을 리부팅

  (Program Files처럼 공백을 포함한 디렉토리를 가진 경로는 맨뒤로...)

ex) PATH=C:\J2SDK1.4.1_07\bin;C:\webtob\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOW
S\System32\Wbem;C:\webtob\bin;C:\Jeus42\lib\etc\ant\bin;C:\Jeus42\bin;C:\Jeus42\lib\system

-------------------------------------------------------------------------------------

6. WEBTOB 환경설정

  1) 웹투비홈\config\sample.m을 카피해서 http.m을 생성

  2) wscfl -i http.m을 커맨드창에서 실행 (webtob 환경설정)

  정상결과 예)

        Current configuration:
                Number of client handler(HTH) = 1
                Supported maximum user per node = 975
                Supported maximum user per handler = 975
        CFL is done successfully for node(노드명(노드명))

---------------------------------------------------------------------------------------

7. 시동

1) webtob를 실행

- webtob 실행 :  wsboot

2) JEUS를 실행

- 우선 command창을 두개 띄웁니다.(제우스, 제우스관리자)

- 제우스창에 "jeus + 엔터"

- 제우스관리자창에 "jeusadmin 노드명 -U유져명 -P제우스패스워드 ->boot

- 제우스창에 에러(Exception)가 없다면 실행 성공!!!

--------------------------------------------------------------------------------------

8. 테스팅

- JEUS기본포트는 8088, webtob기본포트는 8080

- JSP 기본경로

제우스홈\webhome\servlet_home\webapps\examples
           http://127.0.0.1/examples/

- Servlet 기본경로

제우스홈\webhome\servlet_home\webapps\examples\WEB-INF\classes
    http://127.0.0.1/examples/

--------------------------------------------------------------------------------------

9. 종료

1) JEUS종료

- 제우스관리자창에 down -> jeusexit

2) WEBTOB종료

- 웹투비창에 wsdown -i

-------------------------------------------------------------------------------------- 

   

### JEUS/WEBTOB 연동하기 ###

--------------------------------------------------------------------------------------

1. webtob 설정

   - 웹투비홈/config/http.m의 각 항목에 추가합니다.

   *NODE

       JSVPORT = 9900

   *SVRGROUP

       jsvg     NODENAME=노드이름, SVRTYPE=JSV

   *SERVER

      MyGroup    SVGNAME=jsvg, MinProc=10, MaxProc=10

   *URI

      uri2    Uri="/examples/", Svrtype=JSV

--------------------------------------------------------------------------------------

2. jeus 설정

   - 제우스홈/config/노드이름/노드이름_servlet_engine1/WEBMain.xml 수정

        <webserver-connection>
            <webtob-listener>
                <listener-id>webtob1</listener-id>
                <port>9900</port>
                <hth-count>1</hth-count>
                <webtob-address>IP 혹은 127.0.0.1(동일서버에 JEUS와 WEBTOB존재시)</webtob-address>
                <registration-id>MyGroup</registration-id>
                <thread-pool>
                    <min>4</min>
                    <max>10</max>
                    <step>2</step>
                    <max-idle-time>30000</max-idle-time>
                    <max-wait-queue>4</max-wait-queue> 
                </thread-pool>
            </webtob-listener>
        </webserver-connection>


--------------------------------------------------------------------------------------

3. 제우스홈/bin/jeus.properties 조정

    - JEUS_WSDIR 부분을 주석처리 하거나 삭제

    - PATH 에서 $JEUS_HOME/webserver 부분도 제거

--------------------------------------------------------------------------------------

4. webtob 와 jeus 를 부팅 후 확인

   http://주소:8080/exapmples/index.jsp 에서 테스팅 페이지 보기

-------------------------------------------------------------------------------------- 

 
### DB 연동 ###

--------------------------------------------------------------------------------------

* MySQL 커넥션풀 샘플 (WEBMain.xml에 추가)

JEUS에서 제공하는 ConnectionPool은 JDBC Drive를 통해 얻은 Connection의 관리는 
엔진에서 해주는 것이므로 JDBC Driver를 $JEUS_HOME/lib/datasource 아래에 두고
DBConnectionPool은 container.xml에 DataSource는 JeusMain.xml에 다음과 같이 
설정을 하시면 사용하실 수가 있습니다. 
 
1) DBConnectionPool
------------------------------------------------------------------------------
<DBConnectionPool MaxUseCount="-1" 
                  ConnectionPoolType="shared" 
                  CloseDelayMillis="-1" 
                  MaxActiveTimeSecs="-1" 
                  ConnectionPoolID="mysql-shared" 
                  ConnectionArguments="user=root;password=" 
                  DriverClassName="org.gjt.mm.mysql.Driver" 
                  DynamicIncrement="true" 
                  ConnectionURL="jdbc:mysql://localhost:3306/mysql" 
                  LoginDelayMillis="-1" 
                  CloseLongActiveConnection="false" 
                  ConnectionTimeOutSecs="10"> 
        <DBPoolControl MaxCapacity="30" 
                   InitCapacity="20" 
                   MaxIdleTimeSecs="300" 
                   IncrementRate="4" /> 
        <DBAConnection ForcedClose="false" />
</DBConnectionPool>
 
 
2) DataSource
------------------------------------------------------------------------------
<DataSource> 
    <Database> 
            <Vendor>others</Vendor> 
            <ExportName>mysql</ExportName> 
            <DataSourceClassName>
                jeus.jdbc.driver.blackbox.BlackboxConnectionPoolDataSource
            </DataSourceClassName> 
            <Property> 
                <Name>URL</Name> 
                <Type>java.lang.String</Type> 
                <Value>jdbc:mysql://localhost:3306/mysql</Value> 
            </Property> 
            <Property> 
                <Name>DriverClassName</Name> 
                <Type>java.lang.String</Type> 
                <Value>com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource</Value> 
            </Property> 
            <Property> 
                <Name>Password</Name> 
                <Type>java.lang.String</Type> 
                <Value></Value> 
            </Property> 
            <Property> 
                <Name>User</Name> 
                <Type>java.lang.String</Type> 
                <Value>root</Value> 
            </Property> 
            <DataSourceType>ConnectionPoolDataSource</DataSourceType> 
            <ConnectionPool> 
                <MinPoolSize>4</MinPoolSize> 
                <MaxPoolSize>4</MaxPoolSize> 
                <IncreasingStep>1</IncreasingStep> 
                <ResizingPeriod>10</ResizingPeriod> 
                <OperationTimeout>30000</OperationTimeout> 
                <WaitForFreeConnection> 
                    <WaitingTime>10000</WaitingTime> 
                </WaitForFreeConnection> 
            </ConnectionPool> 
        </Database> 
  </DataSource>
--------------------------------------------------------------------------------------

* Oracle 커넥션풀 샘플 (JEUSMain.xml의 </node>하단에 추가)

    <resource>
        <data-source>
            <database>
                <vendor>oracle</vendor>
                <export-name>오라클UID</export-name>
                <data-source-class-name>oracle.jdbc.pool.OracleConnectionPoolDataSource</data-source-class-name>
                <data-source-type>DataSource</data-source-type>
                <database-name>디비명</database-name>
                <data-source-name>oracle.jdbc.pool.OracleConnectionPoolDataSource</data-source-name>
                <network-protocol>tcp</network-protocol>
                <user>scott</user>
                <password>tiger</password>
                <port-number>1521</port-number>
                <server-name>아이피 또는 127.0.0.1</server-name>
                <driver-type>thin</driver-type>
                <connection-pool>
                    <pooling>
                        <max>20</max>
                        <step>1</step>
                        <period>500000</period>
                    </pooling>
                </connection-pool>
            </database>
        </data-source>
    </resource>

--------------------------------------------------------------------------------------

* DB2

  1) JEUS 3.x ($JEUS_HOME/config/<NODENAME>/JeusMain.xml
        <Database> 
            <Vendor>db2</Vendor> 
            <ExportName>db2local</ExportName> 
            <DatabaseName>SAMPLE</DatabaseName> 
            <DataSourceClassName>COM.ibm.db2.jdbc.DB2ConnectionPoolDataSource</DataSourceClassName>
            <DataSourceName/> 
            <ServiceName/> 
            <Description/> 
            <NetworkProtocol/> 
            <Password>jeus2013</Password> 
            <PortNumber>포트번호</PortNumber> 
            <ServerName>DB서버 IP</ServerName> 
            <User>db2inst1</User> 
            <DataSourceType>LocalXADataSource</DataSourceType> 
            <ConnectionPool> 
                <MinPoolSize>2</MinPoolSize> 
                <MaxPoolSize>4</MaxPoolSize> 
                <IncreasingStep>1</IncreasingStep> 
                <ResizingPeriod>600000</ResizingPeriod> 
                <OperationTimeout>30000</OperationTimeout> 
                <WaitForFreeConnection> 
                    <WaitingTime>10000</WaitingTime> 
                </WaitForFreeConnection> 
            </ConnectionPool> 
        </Database>  
  2) JEUS 4.x ($JEUS_HOME/config/<NODENAME>/JEUSMain.xml
           <database>
                <vendor>db2</vendor>
                <export-name>db2XADatasource1</export-name>
<data-source-class-name>COM.ibm.db2.jdbc.DB2XADataSource</data-source-class-name>
                <data-source-type>XADataSource</data-source-type>
                <database-name>sample</database-name>
                <description>Customer DB</description>
                <password>db2inst1</password>
                <encryption>false</encryption>
                <port-number>포트번호</port-number>
                <server-name>DB서버 IP</server-name>
                <user>db2inst1</user>
                <connection-pool>
                    <pooling>
                        <min>2</min>
                        <max>4</max>
                        <step>1</step>
                        <period>600000</period>
                    </pooling>
                    <wait-free-connection>
                        <enable-wait>false</enable-wait>
                        <wait-time>10000</wait-time>
                    </wait-free-connection>
                    <operation-to>30000</operation-to>
                </connection-pool>
            </database>
--------------------------------------------------------------------------------------


 

 

### TIPS ###

--------------------------------------------------------------------------------------

* 파일경로설정

1) 파일 실제경로 (기본값)

- servlet : 제우스홈\webhome\servlet_home\webapps\examples\WEB-INF\classes

- jsp : 제우스홈\webhome\servlet_home\webapps\examples

2) 기존의 examples 컨텍스트 이외에 새로운 aaa라는 컨텍스트를 추가하는 방법 (컨텍스트 설정법)
- WEBMain.xml에서 다음 부분을 추가한다. 
  <context> 
    <context-name>aaa</context-name> 
    <context-path>/aaa</context-path> 
  </context> 
- aaa 컨텍스트의 DD(deployment descriptor)파일을 작성 
  제우스홈\config\노드명\[SERVLET_ENGINE_NAME]\jeus-web-dd_examples.xml 파일을 jeus-web-dd_aaa.xml 파일로 복사  

  하여 편집. context-name, docbase 만 설정하면 됩니다. WEBMain.xml의 이름과 동일해야 함. 
  <?xml version="1.0"?> 
  <!DOCTYPE jeus-web-dd PUBLIC "-//Tmax Soft., Inc.//DTD JEUS WEB Deployment Info 4.0//EN" 
                             "http://www.tmaxsoft.com/jeus/dtd/4.0/jeus-web-dd.dtd"> 
  <jeus-web-dd> 
    <context> 
        <context-name>aaa</context-name> 
        <docbase>서버의 물리적 절대경로</docbase> 
        <auto-reload> 
            <enable-reload>true</enable-reload> 
            <check-on-demand>true</check-on-demand> 
        </auto-reload> 
    </context> 
  </jeus-web-dd> 
- WebtoB의 환경설정파일(http.m)의 URI 절에 aaa 컨텍스트 경로를 다음과 같이 추가한다. 
  *URI 
  uri8 Uri = "/aaa/",Svrtype = JSV 
- WebtoB의 환경파일 수정 후에는 반드시 환경파일 컴파일 후 WebtoB를 재기동 : wscfl -i http.m 
- JEUS 를 재기동



--------------------------------------------------------------------------------------

* index.jsp를 자동으로 인식시키려면

- 제우스홈\config\노드명\[SERVLET_ENGINE_NAME]\webcommon.xml 파일에 index.jsp추가

  <welcome-file-list>
    <welcome-file>index.jsp</welcome-file>
    <welcome-file>index.html</welcome-file>
    <welcome-file>index.htm</welcome-file>
  </welcome-file-list>

--------------------------------------------------------------------------------------

* jspwork 디렉토리 변경

1. JEUS 3.x
$JEUS_HOME/config/<HOSTNAME>/<SERVLET_ENGINE_NAME>/container.xml의
<JSPEngine> 태그 안에 JspWorkDir을 설정하면 됩니다.
<Container>
  ...
  <ContextGroup>
    ...
    <JSPEngine ... 
      JspWorkDir="/app/jwork" 
      ...
    />
2. JEUS 4.x
$JEUS_HOME/config/<HOSTNAME>/<SERVLET_ENGINE_NAME>/WEBMain.xml의
<jsp-engine> 태그 안에 <jsp-work-dir>를 설정하면 됩니다.
<web-container>
  <context-group>
    ...
    <jsp-engine>
      ...
      <jsp-work-dir>/app/jwork</jsp-work-dir>
      ...
    </jsp-engine>
--------------------------------------------------------------------------------------

* 폴더관리 (webtob, jeus 연동시)

- image, js, css, html 등은WebToB홈\docs 에 폴더로 관리해서 WEBTOB가 처리

- jsp, servlet은 context를 별도 설정 (컨텍스트 설정법 참조)해서 JEUS가 처리

--------------------------------------------------------------------------------------

* 오라클 데이터베이스 사용시 C:/jeus/lib/datasource 폴더에 classes12.zip 복사

--------------------------------------------------------------------------------------

* trouble shooting

- Out Of Memory 에러

  JVM에서 사용할 수 있는 memory가 부족할 때 발생합니다. 
  이것을 해결하는 방법으로는 버전별로 다음과 같이 JEUS 환경 파일에서
  추가하면 됩니다. -Xms가 min 값이고 -Xmx가 max 값입니다.
  1) JEUS 3.x ($JEUS_HOME/config/<HOSTNAME>/JeusMain.xml)
  <JeusSystemConfig>
      <NodeConfig>
          ...
          <EngineContainer>
              ...
              <CommandOption>-Xms256m -Xmx256m<CommandOption>
  2) JEUS 4.x ($JEUS_HOME/config/<HOSTNAME>/JEUSMain.xml)
  <jeus-system>
      <node>
          ...
          <engine-container>
             ...
              <command-option>-Xms256m -Xmx256m<command-option>
- 노드명에 '-' 문자를 썼을 경우 또는 노드명에 공백이 있는 경우

  wscfl -i http.m 부분에서 오류 -> 노드명을 ""으로 묶어준다.

- 8080포트 사용하려고 할때 XDB 인증창이 뜬다면... 

  =====> 오라클의 XDB포트와 충돌하는 경우이므로 오라클의 XDB포트를 아래와 같이 변경해준다.

  [시작] -> [프로그램] -> [Oracle - OraHome92] -> [Configuration and Migration Tools] 

  -> [Database Configuration Assistant]   선택

  프로그램이 실행이되면.....

  [다음] 버튼을 Click -> [데이터베이스의 데이이터베이스 옵션구성] 선택 -> [사용 가능한 데이터베이스] 선택 

  -> [표준데이터베이  스 기능...] 버튼을 Click -> Oracle XML DB 의 [사용자 정의 ...] 버튼을 Click 

  -> [포트 번호 구성] 항목의 [사용자 정의 값 지정] 을 선택하셔서 HTTP 포트를 바꿔줍니다. 

  그리고 FTP 및 WebDAV 포트는 기본 설정인 2100 을 사용합니다. -> [확인] 버튼을 Click 하시고 

  [다음] 버튼을 Click 하셔서 데이터베이스를 실행할 기본모드를 선택하시고 [완료] 버튼을 눌러주시면 

  요약 메세지창이 뜨고 [확인] 버튼을 눌러주시면 XDB 의 Port 설정이 끝나게 됩니다.

- 다음과 같은 nullpointer exception 발생시

  <<__Exception__>>
  java.lang.NullPointerException
          at javax.servlet.GenericServlet.getServletContext(GenericServlet.java:20
  5)
          at javax.servlet.GenericServlet.log(GenericServlet.java:300)
          at javax.servlet.GenericServlet.init(GenericServlet.java:257)
          at jeus.servlet.common.WebContainerManager.startContainer(WebContainerMa
  nager.java:538)
          at jeus.servlet.syscontext.SystemContext.startup(SystemContext.java:64)
          at jeus.servlet.deployment.SystemWebContainer.startup(SystemWebContainer
  .java:35)
          at jeus.server.SystemEngineController.startEngine(SystemEngineController
  .java:26)
          at jeus.server.JeusServer.boot(JeusServer.java:720)
          at jeus.server.ControlThread.acceptRequests(ControlThread.java:181)
          at jeus.server.ControlThread.run(ControlThread.java:86)
  java.lang.NullPointerException : null
  [SystemEngineController] fail to start System Engine [devserver_system_engine] :
   jeus.server.JeusServerException
  <<__!Exception__>>
  [2005.05.26 10:30:05][2] [ControlThread] command (210.117.198.62:1063) : disconn
  ect()

 =====> j2sdk1.4.1_07 이하 버젼으로 jdk를 다시 설치한 수 jeus/webtob 다시설치 해보세요.

- C:\Program Files\Java\j2re1.4.1_07\bin\server\jvm.dll 파일을 찾지 못할때

  =====> C:\j2sdk1.4.1_07\jre\bin\server 폴더를 카피해서 

             C:\Program Files\Java\j2re1.4.1_07\bin 폴더에 복사하세요.

--------------------------------------------------------------------------------------

* 클래스파일 변경시 실시간으로 변경 반영

소스가 WEB-INF/classes 아래에 있으면 리부팅이 필요 없습니다. 
단, 확인 하실 것이 container.xml(WEBMain.xml)에 context 태그 내에 AutoReload="true"가 설정되어 있으면 됩니다.
WEB-INF/lib/*.jar는 라이브러리와 같이 수정하지 않는다는 의미를 포함하고 있으므로(J2EE 스펙에 준하면...) 
jar 파일 내의 수정은  반드시 제우스를 리부팅 해야 적용됩니다.
--------------------------------------------------------------------------------------

* 인클루드된 파일 변경시 즉시 적용(<%@ include 자동 반영하기)

JSP의 include의 방식에는 <%@ include (action), <jsp:include (directive) 가 있다.

이 중 <jsp:include (action) 는 include하는 JSP(a.jsp)와 include되는 JSP(b.jsp)가 각각 별도의 servlet으로 변환된다.
a.jsp가 수행 도중 b.jsp의 include 구문을 만나면 b.jsp로 제어권이 넘어가서 수행된 후 다시 a.jsp로 제어권이 넘어와서 계속 수행된다.
그래서 b.jsp가 변경된 경우 변경사항이 자동으로 반영된다.

그리고 <%@ include (directive)는 include하는 JSP(a.jsp)와 include되는 JSP(b.jsp)가  하나의 servlet으로 변환되어서 a.jsp 내에 b.jsp가 완전히 포함되는 형태로 변환된다.
<%@ include (directive)의 목적은 JSP가 Servlet으로 변환되어 컴파일 될 때에
특정 코드나 text를 포함하기 위해서 이다.
따라서 b.jsp가 변경된 경우 a.jsp는 b.jsp가 변경되었는지 모르기 때문에 include 된 JSP의 변경시 이것을 인지하지 못한다.

<%@ include (directive) 를 사용하는 경우 JSP container가 include된 파일이 변경된 경우 자동으로 반영해 주기 위해서는 include하는 파일이 수행될 때 마다 include된 파일의 변경 여부를 검사해서 변경되었다면 include 하는 파일을 recompile 해 주어야 한다.
이것은 JSP container에게는 상당히 부하를 주는 작업이다.
그래서 JSP Spec에서는 include된 파일의 변경시 반영 여부는 명시하지 않고 있다.

JEUS에서는 개발과 운영의 편의성을 위해서 이것을 옵션으로 지정하여 변경시 자동 반영이 되게 설정할 수 있다.
하지만 이 옵션을 true로 설정하는 경우 불필요한 검사가 들어가게 되므로 수행 속도에 지장을 주게됩니다. 반드시 JSP 파일의 변경이 빈번한 경우에만 설정하면 된다.

1. JEUS 3.x
$JEUS_HOME/config/<HOSTNAME>/<SERVLET_ENGINE_NAME>/container.xml에 설정
---------------------------------------------------------
<Container>
    ...
    <ContextGroup>
        ...
        <JSPEngine ...
            CheckIncludedJspFile="true"
            ... />
2. JEUS 4.x
$JEUS_HOME/config/<HOSTNAME>/<SERVLET_ENGINE_NAME>/WEBMain.xml에 설정
---------------------------------------------------------
<web-container>
    ...
    <context-group>
        ...
        <jsp-engine>
            ...
            <check-included-jspfile>true</check-included-jspfile>
            ...
        </jsp-engine>
        ...
    </context-group>
    ...
</web-container>
--------------------------------------------------------------------------------------

* http.m 샘플

*DOMAIN
WebtoB

*NODE
devserver WEBTOBDIR="C:/webtob", 
  SHMKEY = 54000,
  DOCROOT="C:/tmax/webdocs",
  IndexName="index.jsp,index.html,index.htmm",
  PORT = "80", 
  LOGGING = "log1",
  ERRORLOG = "log2",
  HTH = 1,
  JSVPORT = 9900

*SVRGROUP
htmlg  NODENAME = devserver, SvrType = HTML
cgig  NODENAME = devserver, SVRTYPE = CGI
ssig  NODENAME = devserver, SVRTYPE = SSI
jsvg  NODENAME = devserver, SVRTYPE=JSV

*SERVER
html  SVGNAME = htmlg, MinProc = 3, MaxProc = 10
cgi  SVGNAME = cgig, MinProc = 3, MaxProc = 10
ssi  SVGNAME = ssig, MinProc = 3, MaxProc =10
MyGroup  SVGNAME=jsvg, MinProc=10, MaxProc=10

*URI
uri1  Uri = "/cgi-bin/", Svrtype = CGI
uri2  Uri="/examples/", Svrtype=JSV
uri3  Uri="/", Svrtype=JSV

*ALIAS
alias1  URI = "/cgi-bin/", RealPath = "C:/webtob/cgi-bin/"

*LOGGING
log1  Format = "DEFAULT", FileName = "C:/webtob/log/access.log", Option = "sync"
log2  Format = "ERROR", FileName = "C:/webtob/log/error.log", Option = "sync"

*EXT
htm  MimeType = "text/html", SvrType = HTML
--------------------------------------------------------------------------------------

* JEUSMain.xml 샘플

<?xml version="1.0"?>
<!DOCTYPE jeus-system PUBLIC "-//Tmax Soft, Inc.//DTD JEUS Main Config 4.0//EN"
                             "http://www.tmaxsoft.com/jeus/dtd/4.0/jeus-main-config.dtd">
<jeus-system>
    <node>
        <name>devserver</name>
        <class-ftp>true</class-ftp>
        <sequential-start>true</sequential-start>
        <enable-webadmin>true</enable-webadmin>
        <system-log>
            <level>debug</level>
        </system-log>
        <engine-container>
            <name>container1</name>
            <engine-command>
                <type>servlet</type>
                <name>engine1</name>
                <startup-mode>xml</startup-mode>
            </engine-command>
            <tm-config>
                <pooling>
                    <min>10</min>
                    <max>20</max>
                    <step>2</step>
                    <period>600000</period>
                </pooling>
                <active-timeout>300000</active-timeout>
                <commit-timeout>120000</commit-timeout>
                <capacity>20000</capacity>
            </tm-config>
        </engine-container>
    </node>
</jeus-system>

--------------------------------------------------------------------------------------

* WEBMain.xml 샘플

<?xml version="1.0"?>
<!DOCTYPE web-container PUBLIC "-//Tmax Soft., Inc.//DTD WEB Main Config 4.0//EN"
                               "http://www.tmaxsoft.com/jeus/dtd/4.0/web-main-config.dtd">
<web-container>
    <context-group>
        <group-name>MyGroup</group-name>
        <group-docbase>webapps</group-docbase>
        <session-config>
            <timeout>20</timeout>
            <shared>true</shared>
        </session-config>
        <logging>
            <error-log>
                <target>stdout</target>
                <level>information</level>
                <buffer-size>0</buffer-size>
                <valid-day>1</valid-day>
            </error-log>
            <user-log>
                <target>file</target>
                <buffer-size>0</buffer-size>
                <valid-day>1</valid-day>
            </user-log>
            <access-log>
                <target>file</target>
                <buffer-size>0</buffer-size>
                <valid-day>1</valid-day>
                <log-format>
                    <time-format>default</time-format>
                </log-format>
            </access-log>
        </logging>
        <context>
            <context-name>examples</context-name>
            <context-path>/examples</context-path>
        </context>
  <context> 
   <context-name>ngi</context-name> 
   <context-path>/</context-path> 
  </context> 
        <webserver-connection>
            <webtob-listener>
                <listener-id>webtob1</listener-id>
                <port>9900</port>
                <hth-count>1</hth-count>
                <webtob-address>127.0.0.1</webtob-address>
                <registration-id>MyGroup</registration-id>
                <thread-pool>
                    <min>4</min>
                    <max>10</max>
                    <step>2</step>
                    <max-idle-time>30000</max-idle-time>
                    <max-wait-queue>4</max-wait-queue> 
                </thread-pool>
            </webtob-listener>
        </webserver-connection>
    </context-group>
</web-container>
--------------------------------------------------------------------------------------

 

 

 

### 실무 적용 예 (버츄얼호스팅 사용) ###

-------------------------------------------------------------------------------------- 

프로젝트 실제환경을 로컬에서 구현해 작업해야 하는 상황에서...

두대의 IBM서버로 돌아가는 JEUS/WEBTOB의 환경설정 입니다.

 

<<< 실제환경 >>>

---------------------------------------------------------------------------

- 서버1 : WindowsServer2003Standard, 웹서버 (WEBTOB)

- 서버2 : WindowsServer2003Standard, 웹컨테이너 (JEUS), DB(Oracle9i)

- 두 서버는 9999포트를 통해 연동한다.

- images,css,js는 서버1에 jsp,java는 서버2에 위치시킨다.

- 서버구조는 1 WEBSERVER, 2 CONTAINER (원래 4개에서 필요한 두개만 가동)

- 윈도우 hosts파일에 localhost2, localhost3 추가

----------------------------------------------------------------------------

 

<<< sample.m >>>

*DOMAIN
WebtoB

*NODE
realchokyCompaq
  WebtobDir="C:/webtob",
  Shmkey=54000,
  Docroot="C:/center",
  HTH=1,
  port="9900",
  JSVPort=9999,
  IndexName="index.jsp,index.htm,index.html",
  Logging="log1",
  ErrorLog="log2"

*VHOST
center
  NodeName="realchokyCompaq",
  HostName="localhost2",
  DocRoot="C:/center",
  Port="9900",
  SSLFlag=N,
  IndexName="index.jsp,index.htm,index.html"

admin
  NodeName="realchokyCompaq",
  HostName="localhost3",
  DocRoot="C:/admin",
  Port="9900",
  IndexName="index.jsp,index.htm,index.html"

*SVRGROUP
htmlg
  NodeName="realchokyCompaq",
  SvrType=HTML

jsvg
  NodeName="realchokyCompaq",
  SvrType=JSV,
  VHostName=center

jsvg2
  NodeName="realchokyCompaq",
  SvrType=JSV,
  VHostName=admin

*SERVER
html
  SvgName=htmlg,
  MinProc=30,
  MaxProc=60

Center
  SvgName=jsvg,
  MinProc=30,
  MaxProc=30,
  HttpInBufsize=0,
  HttpOutBufsize=0

Admin
  SvgName=jsvg2,
  MinProc=10,
  MaxProc=10,
  HttpInBufsize=0,
  HttpOutBufsize=0

*URI
images
  Uri="/images/",
  SvrType=HTML

center
  Uri="/",
  SvrType=JSV,
  VhostName=center

admin
  Uri="/",
  SvrType=JSV,
  VhostName=admin

*LOGGING
log1
  FileName="C:/webtob/log/access.log",
  Format="DEFAULT",
  Option="sync"

log2
  FileName="C:/webtob/log/error.log",
  Format="ERROR",
  Option="sync"

*EXT
htm
  Mimetype="text/html",
  Svrtype=HTML

jsp
  Mimetype="application/jsp",
  Svrtype=JSV

 

 

<<< JEUSMain.xml >>>

 

<?xml version="1.0"?>
<!DOCTYPE jeus-system PUBLIC "-//Tmax Soft, Inc.//DTD JEUS Main Config 4.0//EN"
                             "http://www.tmaxsoft.com/jeus/dtd/4.0/jeus-main-config.dtd">
<jeus-system>
    <node>
        <name>realchokyCompaq</name>
        <class-ftp>true</class-ftp>
        <sequential-start>true</sequential-start>
        <system-log>
            <level>debug</level>
        </system-log>
        <engine-container>
            <name>container1</name>
            <engine-command>
                <type>servlet</type>
                <name>engine1</name>
                <startup-mode>xml</startup-mode>
            </engine-command>
            <tm-config>
                <pooling>
                    <min>10</min>
                    <max>20</max>
                    <step>2</step>
                    <period>600000</period>
                </pooling>
                <active-timeout>300000</active-timeout>
                <commit-timeout>120000</commit-timeout>
                <capacity>20000</capacity>
            </tm-config>
        </engine-container>
        <engine-container>
            <name>container2</name>
            <engine-command>
                <type>servlet</type>
                <name>engine2</name>
                <startup-mode>xml</startup-mode>
            </engine-command>
            <tm-config>
                <pooling>
                    <min>10</min>
                    <max>20</max>
                    <step>2</step>
                    <period>600000</period>
                </pooling>
                <active-timeout>300000</active-timeout>
                <commit-timeout>120000</commit-timeout>
                <capacity>20000</capacity>
            </tm-config>
        </engine-container>
    </node>
    <resource>
        <data-source>
            <database>
                <vendor>oracle</vendor>
                <export-name>오라클UID</export-name>
                <data-source-class-name>oracle.jdbc.pool.OracleConnectionPoolDataSource</data-source-class-name>
                <data-source-type>DataSource</data-source-type>
                <database-name>디비명</database-name>
                <data-source-name>oracle.jdbc.pool.OracleConnectionPoolDataSource</data-source-name>
                <network-protocol>tcp</network-protocol>
                <user>아이피</user>
                <password>패스워드</password>
                <port-number>1521</port-number>
                <server-name>아이피 혹은 127.0.0.1</server-name>
                <driver-type>thin</driver-type>
                <connection-pool>
                    <pooling>
                        <max>20</max>
                        <step>1</step>
                        <period>500000</period>
                    </pooling>
                </connection-pool>
            </database>
        </data-source>
    </resource>
</jeus-system>

 

 

<<< WEBMain.xml (컨테이너 1) >>>

 

<?xml version="1.0"?>
<!DOCTYPE web-container PUBLIC "-//Tmax Soft., Inc.//DTD WEB Main Config 4.0//EN"
                               "http://www.tmaxsoft.com/jeus/dtd/4.0/web-main-config.dtd">
<web-container>
    <context-group>
        <group-name>Center</group-name>
        <group-docbase>webapps</group-docbase>
        <servlet-home>c:\</servlet-home>
        <context>
            <context-name>Center</context-name>
            <context-path>/</context-path>
        </context>
        <session-config>
            <shared>true</shared>
            <timeout>20</timeout>
        </session-config>
        <webserver-connection>
            <webtob-listener>
                <listener-id>Center</listener-id>
                <port>9999</port>
                <output-buffer-size>0</output-buffer-size>
                <webtob-address>127.0.0.1</webtob-address>
                <thread-pool>
                    <min>30</min>
                    <max>30</max>
                </thread-pool>
            </webtob-listener>
        </webserver-connection>
        <logging>
            <error-log>
                <target>stdout</target>
                <buffer-size>0</buffer-size>
                <level>information</level>
            </error-log>
            <user-log>
                <buffer-size>0</buffer-size>
            </user-log>
            <access-log>
                <buffer-size>0</buffer-size>
                <valid-day>1</valid-day>
                <log-format>
                    <time-format>default</time-format>
                </log-format>
            </access-log>
        </logging>
    </context-group>
</web-container>

 

 

<<< jeus-web-dd_Center.xml >>>

 

<?xml version="1.0"?>
<!DOCTYPE jeus-web-dd PUBLIC "-//Tmax Soft., Inc.//DTD JEUS WEB Deployment Info 4.0//EN"
                             "http://www.tmaxsoft.com/jeus/dtd/4.0/jeus-web-dd.dtd">
<jeus-web-dd>
    <context>
        <context-name>center</context-name>
        <docbase>center</docbase>
        <auto-reload>
            <enable-reload>true</enable-reload>
            <check-on-demand>true</check-on-demand>
        </auto-reload>
    </context>
</jeus-web-dd>

 

 

 

<<< WEBMain.xml (컨테이너 2) >>>

 

<?xml version="1.0"?>
<!DOCTYPE web-container PUBLIC "-//Tmax Soft., Inc.//DTD WEB Main Config 4.0//EN"
                               "http://www.tmaxsoft.com/jeus/dtd/4.0/web-main-config.dtd">
<web-container>
    <context-group>
        <group-name>Admin</group-name>
        <group-docbase>webapps</group-docbase>
        <servlet-home>c:\</servlet-home>
        <context>
            <context-name>Admin</context-name>
            <context-path>/</context-path>
        </context>
        <session-config>
            <shared>true</shared>
            <timeout>20</timeout>
        </session-config>
        <webserver-connection>
            <webtob-listener>
                <listener-id>Center</listener-id>
                <port>9999</port>
                <output-buffer-size>0</output-buffer-size>
                <webtob-address>127.0.0.1</webtob-address>
                <thread-pool>
                    <min>30</min>
                    <max>30</max>
                </thread-pool>
            </webtob-listener>
        </webserver-connection>
        <logging>
            <error-log>
                <target>stdout</target>
                <buffer-size>0</buffer-size>
                <level>information</level>
            </error-log>
            <user-log>
                <buffer-size>0</buffer-size>
            </user-log>
            <access-log>
                <buffer-size>0</buffer-size>
                <valid-day>1</valid-day>
                <log-format>
                    <time-format>default</time-format>
                </log-format>
            </access-log>
        </logging>
    </context-group>
</web-container>


 

 

<<< jeus-web-dd_Admin.xml >>>

 

<?xml version="1.0"?>
<!DOCTYPE jeus-web-dd PUBLIC "-//Tmax Soft., Inc.//DTD JEUS WEB Deployment Info 4.0//EN"
                             "http://www.tmaxsoft.com/jeus/dtd/4.0/jeus-web-dd.dtd">
<jeus-web-dd>
    <context>
        <context-name>admin</context-name>
        <docbase>admin</docbase>
        <auto-reload>
            <enable-reload>true</enable-reload>
            <check-on-demand>true</check-on-demand>
        </auto-reload>
    </context>
</jeus-web-dd>