I've tried
sudo chmod +rwx webapps
and
sudo chmod +rwx -R webapps
but I'm still not being able to create a new folder inside webapps. Why and what should be done?
I've tried
sudo chmod +rwx webapps
and
sudo chmod +rwx -R webapps
but I'm still not being able to create a new folder inside webapps. Why and what should be done?
You probably need to specify a permission for this in tomcats security polices. On Ubuntu the relevant file should be /etc/tomcat6/policy.d/04webapps.policy
, and you probably need to add a FilePermission.
Appending something like this should do the trick:
permission java.io.FilePermission "insert path here", "read,write,delete";
I think that you need to change permissions in /var/lib/tomcat6/webapps
, /usr/share/tomcat6
is mostly made of symlinks if I remember correctly and I'm not sure of the result of the command you ran. Actually, run ls -al
to check the exact status.
But I wonder why you need this, the owner of Tomcat's file should typically be tomcat6:adm
and the permissions restricted to the minimal rights.
If you need this for development, my advice would be to NOT use the packaged version for this purpose. Instead, just unpack a Tomcat distro somewhere in your home folder (I put stuff in ~/opt
), this is much more convenient.
I find the for development and test purposes a freshly untarred tomcat in ~/Tools/tomcat folder works best. Everything is in the standard layout, eclipse, intellij, netbeans et al can find what they want to deploy to the server and hook the debugger in. All files have you ownership/permission so you are not crossing any security lines.
The debian provided tomcat is well integrated in the system and pretty tightly secured with the config files where a Linux admin expects them. This is fine for deployment but a pain during development. When preparing to deploy, better immediately create a debian package with a proper rules file to put everything in the right spot, so you only need to figure it out once.