반응형

기초

{톰캣 설치 경로}/conf/server.xml 파일의 Host 부분을 수정하면 된다.

 

톰캣을 설치하면 기본적으로 아래와 같이 설정이 되어 있다.

<Host name="localhost"  appBase="webapps"
            unpackWARs="true" autoDeploy="true">

해당 부분을 아래와 같이 설정하면 webapps 폴더 하위에 있는 test 폴더가 루트 경로가 된다.

<Host name="localhost"  appBase="webapps/test"
            unpackWARs="true" autoDeploy="true">

 

주의사항

해당 주의사항은 필자가 톰캣 설정을 하면서 겪은 현상을 해결하기 위해 진행했던 기록이다.
아래 방법이 정답이라고는 할 수 없으니 참고만 하길 바란다.

 

1. 위와 같이 설정을 하면 war 파일이 unpack되지 않는다.
   이를 우회하기 위해서는 아래와 같이 Host는 그대로 두고 Context를 추가한다.

<Host name="localhost"  appBase="webapps"
            unpackWARs="true" autoDeploy="true">
	<Context docBase="test" path="/" reloadable="true"/>

 

2. 1항처럼 설정을 하면 webapps 폴더에 ROOT폴더와 test폴더가 함께 생성되는 현상이 발생한다.
   이를 해결하기 윈해서는 Host에 deployIgnore를 추가하면 해결된다.

<Host name="localhost"  appBase="webapps"
	unpackWARs="true" autoDeploy="true" deployIgnore=".*">
    <Context docBase="IDS" path="/" reloadable="true"/>
반응형

+ Recent posts