How to set extracting of WAR-files in automatic mode?
2. Go to Plesk > Tools & Settings > Server Components and make sure that psa-tomcat-configurator and Tomcat components are installed.
In case of CentOS with SELinux, is required to install
policycoreutils-python and set SELinux as permissive for Tomcat with following commands:
# yum install policycoreutils-python -y
# semanage permissive -a tomcat_t
3. Enable Tomcat support going to Plesk > Subscriptions > Websites & Domains > example.com > Java Applications, or running following command:
# plesk bin tomcat --update-service example.com -status enabled
unpackWARs directive globally running following command:
# sed -i 's/unpackWARs=\"false\" autoDeploy=\"true\" liveDeploy=\"true\"/unpackWARs=\"true\" autoDeploy=\"true\" liveDeploy=\"true\"/g' /etc/tomcat/server.xml
If, instead, it's needed to enable
unpackWARs directive only for a specific domain
unpackWARs directive to true in the
/etc/tomcat/server.xml file for the line containing
# vi /etc/tomcat/server.xml
<Host deployXML="true" name="example.com" appBase="psa-webapps/example.com" unpackWARs="true" autoDeploy="true" liveDeploy="true">
5. Restart Tomcat service:
# systemctl restart tomcat.service
sample.war file attached to this article for testing purposes.
In case WAR-files weren't unpacked, please check following article: Unable to unpack WAR-files: java.io.IOException: Unable to create the directory [/usr/share/tomcat/psa-webapps/example.com/sample]