개요

tomcat 의 manager 기능은 보안문제때문에 기본적으로 막혀있다.

jenkins 나 bamboo 등의 CI 에서 빌드와 배포를 수행하려면 이 기능을 켜야 한다.

보안상 취약하므로 id/pwd 를 잘 관리해야 하며 manager context 로 들어올 수 있는 client ip 를 제한해야 한다. (Web 서비스 구축시 보안 유의사항 참고)

 

설정

  1. tomcat 설치 폴더로 이동
  2. vi conf/vi tomcat-users.xml 
  3. 다음과 같이 tomcat-users 에 권한과 user 를 지정 

    <tomcat-users>
      <role rolename="manager-gui"/>
      <role rolename="manager-script"/>
      <role rolename="manager-status"/>
      <user username="myManagerId" password="secretP^wd" roles="manager-gui,manager-script,manager-status"/>
    </tomcat-users>
    XML

    Browser 에서 연결할 경우 manager-gui 권한이 필요하고 CI 등의 외부에서 연결하려면 manager-script 권한 필요

  4. 저장후 재구동
  5. http://myserver/manager  컨텍스트에 Browser 로 연결후 manager-id/secretP^wd 로 로그인하여 동작 확인

 

권한 종류

  • manager-gui — Access to the HTML interface.
  • manager-status — Access to the "Server Status" page only.
  • manager-script — Access to the tools-friendly plain text interface that is described in this document, and to the "Server Status" page.
  • manager-jmx — Access to JMX proxy interface and to the "Server Status" page.

 

Ref