1. JDK 설치
java 설치 확인
java -version
- 이미 설치되었고, JAVA_HOME 환경변수가 등록되어 있다면 다음 단계로 이동. 아니라면 이어서...
JDK 설치
JAVA_HOME 환경변수 등록
- 윈도우의 경우, 내PC > 속성 > 고급 시스템 설정 > 환경변수의 시스템변수에 등록
2. tomcat 설치
- 8.5나 9 버전으로 설치
- 설치경로 안의 bin 폴더의 starup.bat으로 구동
- 브라우저의 ‘localhost:8080’ 주소로 톰캣이 구동되고 있는지 확인
tomcat 로그 한글 깨짐
- conf > logging.properties
java.util.logging.ConsoleHandler.encoding = EUC-KR
- UTF-8 로 되어 있다면 EUC-KR로 변경해준다
OJDBC
- lib 경로에 ojdbc6.jar 추가 (오라클)
war 파일 다운로드
- 설치경로 안의 webapps 폴더에 war파일 이동
Server.xml (Context path)
- 설치경로 안의 conf 폴더에 server.xml 파일 수정
<Host name="localhost" appBase="webapps" unpackWARs="true" autoDeploy="true">
<Context path="/appName" docBase="applicationWarName" reloadable="false" > </Context>
</Host>
Server.xml (JNDI)
<!-- Global JNDI resources
Documentation at /docs/jndi-resources-howto.html
-->
<GlobalNamingResources>
<!-- Editable user database that can also be used by
UserDatabaseRealm to authenticate users
-->
<Resource name="UserDatabase" auth="Container"
type="org.apache.catalina.UserDatabase"
description="User database that can be updated and saved"
factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
pathname="conf/tomcat-users.xml" />
<!-- oracle -->
<Resource name="jdbc/ds_erp_app" auth="Container"
type="javax.sql.DataSource"
driverClassName="oracle.jdbc.driver.OracleDriver"
url="jdbc:oracle:thin:@devdb.erp.co.kr:1521:xe"
username="id" password="pw"
maxTotal="10" maxWaitMillis="5000"
testOnBorrow="false" testWhileIdle="true"
/>
</GlobalNamingResources>
conf> context.xml
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!-- The contents of this file will be loaded for each web application -->
<Context>
<!-- Default set of monitored resources. If one of these changes, the -->
<!-- web application will be reloaded. -->
<WatchedResource>WEB-INF/web.xml</WatchedResource>
<WatchedResource>WEB-INF/tomcat-web.xml</WatchedResource>
<WatchedResource>${catalina.base}/conf/web.xml</WatchedResource>
<!-- cache : 50MB -->
<Resources cachingAllowed="true" cacheMaxSize="51200"/>
<!-- Uncomment this to disable session persistence across Tomcat restarts -- >
<!--
<Manager pathname="" />
-->
<ResourceLink name="jdbc/ds_erp_app"
global="jdbc/ds_erp_app"
type="javax.sql.DataSource"
/>
</Context>
3. Oracle 11g xe 설치
https://www.oracle.com/database/technologies/xe-prior-release-downloads.html
프로그램 기초 데이터 생성