0
votes

Amongst many of the configuration options, in tomcat's conf/server.xml, under the <Host> tag, as shown here you can set "unpackWARs=true".

I am using a modified server.xml which correctly points to a different "appBase" directory, which contains the WAR files, which do get deployed correctly by tomcat.

<Service name="..." >
<Engine name="..."
    <Host name="..." appBase="..." autoDeploy="false" unpackWARs="true" />

I need the functionality of "unpackWARs=true", however when I deploy tomcat, it will incorrectly try to unpack the wars in the default application base directory CATALINA_HOME/webapps/ (which will not exist).

Tomcat is obviously trying to then explode the war into the deployment configuration folder (which it considers to be appBase), but I have not found any way to modify this behaviour. Problem is similar to the one here, but I do not want to manually have to expand the war files, so am wondering if there is any way to configure tomcat to expand the WARs from a custom appBase in a folder different than CATALINA_HOME/webapps/ that it is defaulting to.

1

1 Answers

0
votes

Go to \conf\Catalina\localhost and create an xml file named the same as your .war. For example if your war file is called myApp.war create an xml file called myApp.xml. In it paste the following code

<Context
    path="yourFolder/"
    docBase="yourApp"
    debug="1"
    reloadable="true"
    distributable="true"
    crossContext="false"
    swallowOutput="true"
</Context>