On 07/05/2021 21:09, Christopher Schultz wrote:
Cris,
On 5/7/21 14:29, Berneburg, Cris J. - US wrote:
Hi Mark
Thanks for getting back with me. :-)
markt> What is the setting for unpackWARs for Host?
These are the host settings in server.xml:
name="localhost"
appBase="webapps"
unpackWARs="true"
autoDeploy="true"
deployOnStartup="false"
markt> Running directly from a WAR (with unpackWARs="false"
markt> file will impact performance. It looks as if something
markt> is unpacking the WAR to the temp directory.
Where is it supposed to unpack the WAR files to? I would have
thought the work folder.
webapps/
(Well... "appBase")
To add to what Chris said, abc.war unpacks to abc (if unpackWARs is
true) and then the filename is used to derive the context path.
The reason for this is the file names have to be unique so (given how
file names are converted to context paths) it is guaranteed that context
paths are unique.
It looks like your WARs are unpacking into appBase (webapps in your
case) as expected.
markt> Tomcat does provide the org.apache.catalina.webresources.
markt> ExtractingRoot resources implementation to help alleviate
markt> performance issues in this case but that should only
markt> extract the JARs in WEB-INF/lib and location they are
markt> extracted to should be under the work directory and include
markt> "application-jars" in the path.
OK good to know that at least for JAR's the "normal" place is the
work folder and *not* the temp folder.
markt> Maybe some custom "unpack to temp" code?
That's what I'm afraid of. :-\ What's weird(er) is that the default
TC apps like docs and manager are copied to the temp folder too.
Also, the subfolders start with a number, like "0-app1", "4-docs",
and "5-manager". Does that provide a clue, or is that just normal?
I think it points to a process outside of Tomcat's control.
+1.
That apps are trying to access resources from temp suggests at least one
app is aware of what is going on here.
That manager, docs etc are also in temp is strange. That suggests
configuration at Host level or above.
The Manager app does have a little used feature (tags) that does store
apps in temp but if I am reading the code correctly they still get
deployed to appBase.
Could the destination for unpacking the WAR files be changed from
default with a setting or an environment variable?
You can change the appBase on the <Host> but then you have to move your
WAR files, too.
You could try making temp read only for the Tomcat user. You might need
to do that after Tomcat starts as I think it checks it can write.
Hopefully you'll get an error when something tries to write there.
Mark
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org