3

I am running springsource framework in ubuntu 10.01. In my home folder, I have installed springsource IDE. I have my tomcat6 appserver in the /usr/share/tomcat6. While executing a sample project springapp, I have created the springapp dir in /users/share/tomcat6/webapps/ folder using sudo as I am unable to do it directly.

On running the ant deploy or ant deploywar command, I am unable to copy the sample file -index.jsp from my workspace in springsource IDE to springapp dir in /usr/share/tomcat6/webapps as I am getting the error permission denied while copying the .jsp file.

Can anybody please provide suggestion as to how to overcome this issue?

Regards

Jorge Castro
  • 73,717

2 Answers2

8

You do not own the files, neither do you have the permission to write to /usr/share/tomcat6/webapps. The following command will change the ownership of the webapps folder and files recursively to yourusername. That enables user yourusername to write to that directory.

sudo chown -R yourusername /usr/share/tomcat6/webapps
Lekensteyn
  • 178,446
2

To temporarily upgrade rights to copy a file using terminal, 'sudo cp file1 file2' to copy file as a superuser (i.e. root). Another option is to use 'gksudo nautilus' to upgrade rights and invoke the GUI file manager. These upgraded rights are revoked when you exit terminal.

This is a user or group rights issue if you need to copy to this directory all the time. 'sudo chgrp' or 'sudo chown' to update rights to the directory.

The intention is to never log in as root on a production machine and use the aforementioned user or group commands instead. Use care exposing your development/learning environment to the internet.

Bret
  • 66