My Java web application (myapp.war
) ist deployed by placing it into the webapps
direcotry on Tomcat on Ubuntu 10.04.
This application needs to save some data in files. But the user, which is running Tomcat (tomcat6
) has no write access to the home directory /usr/share/tomcat6/
and no write access to the current working direcotry /var/lib/tomcat6/
, since both belong to root
.
So where should a web application store its data? I hope it is not the extracted archive in the webapps direcotry. This one could be deleted very easily by accident. And Tomcat can be configured, not to extract .war files. Then there would be no extracted direcotry.
Perhaps /var/lib/tomcat6/
should belong to user tomcat6
ant this is a bug in Ubuntu?