The chown
command can help you reassign the ownership of a file or folder. With Tomcat and autodeployment, the WAR file must be readable by the Tomcat user so that it can read and unpack it for deployment.
To change the owner of cms.war:
chown ftp cms.war
Note: This command is likely to require root privileges/sudo
To ensure that cms.war is readable by Tomcat:
chmod 744 cms.war
Note: This gives read, write, and execute privileges to the owner, and read privileges only to the group and others.
As for the Tomcat removing the the deployed cms/ folder when the WAR is deleted, that seems entirely reasonable behaviour for the autodeploy feature, as it allows you to easily add and remove web apps:
- When you add the WAR, Tomcat reads it and deploys it to a directory of the same name
- When you remove the WAR, Tomcat undeploys it by deleting the directory
What exactly is the problem with that?