• Tomcat 서버를 sh shutdown.sh 명령어를 통해 Shutdown 한 후 webapps 폴더 내부에서 모든 파일을 삭제를 한다. 올리고자하는 WAR파일명을 ROOT.war로 변경한뒤 폴더에 업로드 후 bin 폴더의 sh startup.sh 명령어로 실행한다.

  • Leave your war file in $CATALINA_BASE/webapps under its original name. Turn off autoDeployand deployOnStartup in your Host element in the server.xml file. Explicitly define all application Contexts in server.xml, specifying both the path and docBase attributes. You must do this because you have disabled all the Tomcat auto-deploy mechanisms, and Tomcat will not deploy your applications anymore unless it finds their Context in the server.xml.

    second method: in order to make any change to any application, you will have to stop and restart Tomcat.

  • $CATALINA_BASE/webapps 에 고유 이름이 있다면 Ex) webapps/project. shutdown 완료 이후 conf 폴더 내부의 server.xml 파일을 확인 이후 docBase를 추가한다.
    docBase추가 방법은

    <Host name="localhost"  appBase="webapps"

                unpackWARs="true" autoDeploy="true">


            <!-- SingleSignOn valve, share authentication between web applications

                 Documentation at: /docs/config/valve.html -->

            <!--

            <Valve className="org.apache.catalina.authenticator.SingleSignOn" />

            -->


            <!-- Access log processes all example.

                 Documentation at: /docs/config/valve.html

                 Note: The pattern used is equivalent to using pattern="common" -->

          <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"

                   prefix="localhost_access_log." suffix=".txt"

                   pattern="%h %l %u %t &quot;%r&quot; %s %b" />

            <Context docBase="project" path="" reloadable="true" />

    </Host>

아래의 한줄을 Server.xml 에 추가를 하면 해결된다.

Posted by MIDDLE
,