JEUS6.0 정리 및 Setting

 | Jeus
2012. 8. 10. 23:15



================================================================================================

1. webtob(WS: 정적인 업무 처리) 구동시
  1) WSM(웹서버 모니터 프로세스), HTL, HTH 3가지가 구동됨
  2) HTL(리스닝 작업)이 클라이언트로부터 리슨하고,
  3) HTH로 핸들링해서 HTH에서 업무프로세스에 할당하고 처리한 값을 다시 HTL로 보냄
   3-1) HTH 앞단에 큐를 사용하여 과부하를 막음
   3-2) 단위 업무자체가 클 경우 업무프로세스를 확장
   3-3) 사용자가 몰릴경우 HTH(인스턴스)를 4개까지 확장 가능(안에 컨테이너 수는 제한없음)
  4) WSM이 HTL과 HTH를 모니터링하여 문제 발생시 처리

 

 

2. JEUS 구조
  - SERVER > NODE > 제우스 메니저 <동급> 제우스 컨테이너
  1) 제우스 메니저의 역할
     - J2EE 서비스, 리소스 관리(시큐리티, 데이터베이스, 외부소스, jndi 등등)
  2) 제우스 컨테이너
     - 서블릿 엔진, EJB, JMS 등등 업무처리

 

 

3. webtob

  1) 설치 중간에 servlet은 제하고 순수 webtob체크
  2) /bin파일/ wsboot, wscfl(실행파일 설정), wsdown

 

 


4. jeus
  1) 설치 중간에 어드민 패스워드 입력
  2) webserver(내장 webtob ==> 인스턴스 1개만 생성가능, 같은 공간의 제우스하고만 연결) 
  3) /webserver/config/ws_engine.m 을 http.m으로 새로 저장하여 작업
  4) cmd창 /webserver/config> wscfl -i http.m(파일 유효성 검사) --> wsconfig생성
  5) cmd창 /webserver/config> wsboot --> 웹투비 가동
                              wsdown --> 웹투비 다운

 

  6) jeus 환경설정
    --> /config/해당컴터이름/jeusmain.xml 수정
        /config/해당컴터이름/해당컴터이름_servlet_engine1/webmain.xml 수정 
    --> 최초의 연결설정은 jeus에서 webtob로 설정명령
 

  7) cmd창> jeus
 

  8) cmd창> jeusadmin 사용자컴터이름  ==> 어드민 로그인
 

  9) cmd창> boot  ==> 제우스 가동
                  down  ==> 제우스 다운

 

 10) 기타 환경 변수 추가는 jeus가 설치된 폴더(c:\tmaxsoft)의 bin 폴더의 jeus.properties.cmd

       파일을 열어 설정해 줄 수 있다.

         - JEUS_BASEPORT : JEUS 가 사용할 네트워크 포트중 기본 포트 --> 9736

         - JAVA_HOME : Java 2 설치 디렉토리

         등등...

         - JEUS_BASEPORT를 수정할 경우

           : %JEUS%\config\vhost.properties의

             컴퓨터이름 = 컴퓨터이름:9736 의 포트도 같이 수정

 

 11) admin페이지 접속 ==> http://localhost:9744/webadmin/ 

      (포트는 jeus.properties.cmd 의 JEUS_BASEPORT 숫자 + 8한 숫자)

      (로그 보기 및 jdbc 컨넥션 풀, 어플리케이션 배포 등 설정)

       - webadmin 을 실핼 시키기 위해서는 JEUSMain.xml 에 <enable-webadmin> 태그의 값이

          true 로 설정 되어 있어야 한다.

          (경로--> %JEUS_HOME%\config\<nodename>\JEUSMain.xml)

  12) /lib/datasource 안에 관련 jar파일(jdbc 드라이버 등) 저장

  13) admin 명령어 (admin으로 cmd창에서 접속후 cmd창>help 로 확인가능)
     -  st -v
        st -p
        st -r
        q
        conlist
        downcon [컨테이너명] 
        applist
        dsinfo
        ti -a
        dsconinfo -con [컨테이너명] -t [컨넥션풀 이름]
        등등


  14) 설정파일의 xml스키마를 보고싶을땐  /lib/schemas/jeus/ 안에서 참조

 

  15) jeus/bin/ 안에서 .cmd 파일로 만들고 cmd창에서 모아서 어디서든 실행할 수 있다.

       (서버 내리기, 어드민 접속 등등)
      예) jeusadmin [컴퓨터이름] -Uadministrator -Ppassword jeusexit   ==>jdown.cmd로 만듬    
           jeus -Uadministrator -Ppassword   ==> jboot.cmd로 만듬
          jeusadmin [컴퓨터이름] -Uadministrator -Ppassword  ==>jadmin.cmd로 만듬

  

  16) 메뉴얼
     [jeus 6.x]
      http://technet.tmax.co.kr/kr/edocs/jeus/60/index.html

     [webtob 4.x]
     http://technet.tmax.co.kr/kr/edocs/webtob/41/index.htm

  

 

 

 

 

======= java.net.ConnectException: Connection refused: connect

           worker(webtob1-hth0(localhost:9900)-w00:null) : Failed to reconnect
                                                                                                        ===============

1. webtob와 설정이 맞지 않기 때문이다.

2. jeus 설정을 바꿨다면 webtob까지 모두 내렸다가 다시 올려야 한다.

 

 

 

 

 

 

 

================================ log 설정 =======================================

1. JeusMain.xml (<node> 태그 사이에 작성)

<system-logging>
            <name>jeus</name>
            <handler>

                <console-handler>

                      <name>handler0</name>
                      <level>FINE</level>
                 </console-handler>
                <file-handler>
                    <name>handler1</name>
                    <level>FINE</level>
                     <valid-day>1</valid-day>
                     <file-name>D:\Project\workspace\JeusLog\JeusServer.log</file-name>
                </file-handler>
            </handler>
</system-logging>

 

2. ~~-servlet 폴더의 WEBMain.xml(<context-group>안에..)

<logging>
            <access-log>
                <handler>

                   < console-handler>

                      <name>handler0</name>
                    </console-handler>                   

                   <file-handler>
                        <name>handler1</name>
                    </file-handler>
                </handler>
            </access-log>
        </logging>

 

 

==================== OutOfMemoryError:PermGem Space 에러 =================

<JEUSMain.xml>

<engine-container>
            <name>container1</name>
     <command-option>-Xms256m -Xmx512m -XX:PermSize=512m

                                -XX:MaxPermSize=1024m</command-option>
            <sequential-start>true</sequential-start>
            <engine-command>
                <type>ws</type>
                <name>engine1</name>
            </engine-command>
            <engine-command>
                <type>jms</type>
                <name>engine1</name>
            </engine-command>
            <engine-command>
                <type>ejb</type>
                <name>engine1</name>
            </engine-command>
            <engine-command>
                <type>servlet</type>
                <name>engine1</name>
            </engine-command>
        </engine-container>

 

==> 이런식으로 PermSize를 늘려준다.

 

 

 

============================= webtob 사용 안하기 ==============================

<해당 servlet-engine의 WEBMain.xml>

<webserver-connection>
            <http-listener>
                <listener-id>http1</listener-id>
                <port>8088</port>
                <thread-pool>
                    <min>10</min>
                    <max>20</max>
                    <step>1</step>
                </thread-pool>
            </http-listener>
            <!--<webtob-listener>
                <listener-id>webtob1</listener-id>
                <port>9900</port>
                <output-buffer-size>8192</output-buffer-size>
                <thread-pool>
                   <min>1</min>
                   <max>5</max>
                   <step>1</step>
                   <max-idle-time>30000</max-idle-time>
                </thread-pool>
                <webtob-address>localhost</webtob-address>
                <registration-id>MyGroup</registration-id>
            </webtob-listener>
  -->
        </webserver-connection>

==> webtob를 사용하지 않고 jeus만으로 web을 구동할 경우

      <webtob-listener>를 주석처리한다.

 

 

 

======================== <invocation-manager-action> =========================

1. Warning

  : 이 선택사항이 선택되면, 만약 한 자원이 무상태 메소드 호출 동안 사용되었지만 반환할 때 닫지 않게 될 경우 이벤트가
container log에 warning 메세지로 기록된다.

 

2.AutoClose:
이 선택사항이 선택되면, 만약 한 자원이 무상태 메소드 호출 동안 사용되었으나 반환할 때 닫히지 않는다면 자원이
자동적으로 닫힌다.


===JEUSMain.xml===
<jeus-system>
  <node>
...
    <engine-container>
...
      <invocation-manager-action>
          AutoClose
      </invocation-manager-action>
...
    </engine-container>
  </node> 
</jeus-system>

 

 

 

============================ jeus admin 비밀번호 수정 ========================

1. cmd창 열고
2. java -classpath "%JEUS_HOME%\lib\system\jeus.jar" jeus.security.util.Base64Coder <바뀔 암호>
   하면 암호가 반환됨
3. %JEUS_HOME%\config\컴퓨터이름\security\SYSTEM_DOMAIN\accounts.xml을 열어서

<?xml version="1.0"?>
<accounts xmlns="http://www.tmaxsoft.com/xml/ns/jeus" version="6.0">
      <users>
        <user>
            <name>administrator</name>
            <password>{base64}이부분 수정</password>
            <group>Administrators</group>
        </user>
    </users>
    <groups>
        <group>
            <description>A group for administrators</description>
            <name>Administrators</name>
        </group>
    </groups>
</accounts>

'Jeus' 카테고리의 다른 글

Jeus 기본 설정 통합  (0) 2012.07.23
Posted by 사라링

Jeus 기본 설정 통합

 | Jeus
2012. 7. 23. 17:40

JEUS 설정 종합

분류없음 2008/01/10 16:14

### 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>

'Jeus' 카테고리의 다른 글

JEUS6.0 정리 및 Setting  (0) 2012.08.10
Posted by 사라링

BLOG main image
.. by 사라링

카테고리

사라링님의 노트 (301)
JSP (31)
J-Query (41)
JAVA (24)
디자인패턴 (1)
스트러츠 (3)
안드로이드 (11)
오라클 (45)
우분투-오라클 (1)
이클립스메뉴얼 (6)
스프링3.0 (23)
자바스크립트 (10)
HTML5.0 (17)
정보처리기사 (1)
기타(컴퓨터 관련) (1)
문제점 해결 (3)
프로젝트 (2)
AJAX (4)
하이버네이트 (3)
트러스트폼 (11)
Jeus (2)
재무관리(회계) (5)
정규식 (5)
아이바티스 (8)
취미 (2)
소프트웨어 보안 관련모음 (0)
정보보안기사 (6)
C언어 베이직 및 프로그램 (3)
보안 관련 용어 정리 (2)
넥사크로 (6)
웹스퀘어_ (0)
Total :
Today : Yesterday :