IT

Apache Tomcat 7 관리자(manager) 비밀번호 설정

하마연구소장 2019. 2. 6. 11:59
728x90
반응형

JSP, Servlet 컨테이너 중 가장 보편적으로 사용하는 것은 Apache Tomcat이다.

흔히 WAS라고 불리는 WebLogic, Glassfish, JBoss 등 다양한 제품도 있다. 이들은 엔터프라이즈급 제품으로 쉽게 관리자 계정을 설정할 수 있다.

하지만 Tomcat은 특별한 GUI가 없기 때문에 환경설정 파일로 직접 관리자 계정을 설정해야한다. (물론 윈도우용 Apache Tomcat은 간단하게나마 GUI를 제공해줘서 비교적 쉽게 환경설정 파일을 관리할 수 있다.)

UNIX나 Linux 등에서 Tomcat을 처음 설치하고나서 관리자 계정을 설정하기 위하여 아래와 같이 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
 
 
  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="admin-gui"/>
  <role rolename="manager-gui"/>
  <user username="tomcat" password="tomcat" roles="admin-gui,manager-gui"/>
 

</tomcat-users>


우 <role> 부분과 같이 설정하면, tomcat ID는 관리자 권한을 가진다.

반응형