달력

42024  이전 다음

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
프로그래밍/WEB 2016. 9. 23. 10:52


Tomcat7은 설치 되어 있다고 가정 한다. War 파일도 준비해야 한다.


Step 1.  Admin 계정 만들기

D:\Develop\was\tomcat\apache-tomcat-7.0.35\conf\tomcat-users.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.

-->

<tomcat-users>

<!--

  NOTE:  By default, no user is included in the "manager-gui" role required

  to operate the "/manager/html" web application.  If you wish to use this app,

  you must define such a user - the username and password are arbitrary.

-->

<!--

  NOTE:  The sample user and role entries below are wrapped in a comment

  and thus are ignored when reading this file. Do not forget to remove

  <!.. ..> that surrounds them.

-->

<!--

  <role rolename="tomcat"/>

  <role rolename="role1"/>

  <user username="tomcat" password="tomcat" roles="tomcat"/>

  <user username="both" password="tomcat" roles="tomcat,role1"/>

  <user username="role1" password="tomcat" roles="role1"/>

-->

<role rolename="manager-gui" />

      <user username="min" password="min" roles="manager-gui" />


</tomcat-users>



관리자에 해당하는 권한을 주고 아이디를 생성 했다.


Step 2.  서버 시작 하기


  • Windows -> D:\Develop\was\tomcat\apache-tomcat-7.0.35\bin\startup.bat
  • Linux -> D:\Develop\was\tomcat\apache-tomcat-7.0.35\bin\startup.sh

OS에 맞는 파일을 실행 한다. 


2013. 2. 1 오후 3:04:24 org.apache.catalina.core.AprLifecycleListener init
정보: Loaded APR based Apache Tomcat Native library 1.1.24 using APR version 1.4.6.
2013. 2. 1 오후 3:04:24 org.apache.catalina.core.AprLifecycleListener init
정보: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].
2013. 2. 1 오후 3:04:24 org.apache.catalina.core.AprLifecycleListener initializeSSL
정보: OpenSSL successfully initialized (OpenSSL 1.0.1c 10 May 2012)
2013. 2. 1 오후 3:04:25 org.apache.coyote.AbstractProtocol init
정보: Initializing ProtocolHandler ["http-apr-8080"]
2013. 2. 1 오후 3:04:25 org.apache.coyote.AbstractProtocol init
정보: Initializing ProtocolHandler ["ajp-apr-8009"]
2013. 2. 1 오후 3:04:25 org.apache.catalina.startup.Catalina load
정보: Initialization processed in 1208 ms
2013. 2. 1 오후 3:04:25 org.apache.catalina.core.StandardService startInternal
정보: Starting service Catalina
2013. 2. 1 오후 3:04:25 org.apache.catalina.core.StandardEngine startInternal
정보: Starting Servlet Engine: Apache Tomcat/7.0.35
2013. 2. 1 오후 3:04:25 org.apache.catalina.startup.HostConfig deployWAR
정보: Deploying web application archive D:\Develop\was\tomcat\apache-tomcat-7.0.35\webapps\ROOT.war
2013. 2. 1 오후 3:04:26 org.apache.catalina.startup.HostConfig deployDirectory
정보: Deploying web application directory D:\Develop\was\tomcat\apache-tomcat-7.0.35\webapps\docs
2013. 2. 1 오후 3:04:26 org.apache.catalina.startup.HostConfig deployDirectory
정보: Deploying web application directory D:\Develop\was\tomcat\apache-tomcat-7.0.35\webapps\examples
2013. 2. 1 오후 3:04:26 org.apache.catalina.startup.HostConfig deployDirectory
정보: Deploying web application directory D:\Develop\was\tomcat\apache-tomcat-7.0.35\webapps\host-manager
2013. 2. 1 오후 3:04:26 org.apache.catalina.startup.HostConfig deployDirectory
정보: Deploying web application directory D:\Develop\was\tomcat\apache-tomcat-7.0.35\webapps\manager
2013. 2. 1 오후 3:04:26 org.apache.coyote.AbstractProtocol start
정보: Starting ProtocolHandler ["http-apr-8080"]
2013. 2. 1 오후 3:04:26 org.apache.coyote.AbstractProtocol start
정보: Starting ProtocolHandler ["ajp-apr-8009"]
2013. 2. 1 오후 3:04:26 org.apache.catalina.startup.Catalina start
정보: Server startup in 1546 ms


Step 3.  관리자 페이지 접속 하기

따로 설정을 하지 않았다면 http://localhost:8080/manager 로 접속 한다.



방금 만들었던 Admin 계정을 입력 한다.



위와 같은 페이지가 뜨면 성공 이다. Applications 현황이나, Server Status를 볼 수 있다. 


Step 4.  War Deploy 하기

스크롤을 내리다 보면 아래와 같은 메뉴가 있다.



실행 절차


  1. 찾아보기 버튼을 클릭하여 War 파일을 추가 한다.
  2. Deploy 버튼을 클릭 한다.

참고) War 파일의 이름이 Context Path 가 된다. 아래 그림에 /whitelife 라고 추가 된 것을 볼 수 있다.



2013. 2. 1 오후 3:18:11 org.apache.catalina.startup.HostConfig deployWAR

정보: Deploying web application archive D:\Develop\was\tomcat\apache-tomcat-7.0.35\webapps\whitelife.war



정상적으로 Deploy가 된 경우, Applications 제일 밑에 추가 된 것을 볼 수 있다.

상황에 따라서 해당 Application을 Stop, Reload, Undeploy 할 수 있다.


Step 5.  Hello World !!! 확인하기


위 페이지가 떳다면 성공이다.


출처 : http://blog.whitelife.co.kr/73

'프로그래밍 > WEB' 카테고리의 다른 글

CSS 테이블 기본  (0) 2016.09.23
javascript:버튼(button)으로 팝업(popup) 띄우기  (0) 2016.09.23
[HTML5] File API  (0) 2016.09.23
Posted by 당구치는 개발자
|