5

Installed Tomcat7 via repository via Synaptic package manager

enter image description here

& pasted my app(Beerv1) folder to /var/lib/tomcat7/webapps/ & also to /usr/share/tomcat7-root/

Still gets

HTTP Status 404 - /Beerv1/form.html

Using:

CLASSPATH: /usr/share/tomcat7//bin/bootstrap.jar:/usr/share/tomcat7//bin/tomcat-juli.jar touch: cannot touch ‘/usr/share/tomcat7//logs/catalina.out’: Permission denied ./catalina.sh: 387: ./catalina.sh: cannot create /usr/share/tomcat7//logs/catalina.out: Permission denied

This error shows after I uninstalled Tomcat7 & downloaded package manually from apache-tomcat website, extracted it to (/usr/share) & added CATALINA_HOME=<path> & JAVA_HOME=<path>.

My webapps weren't working on repository package. I pasted my webapps in both folder /usr/share/tomcat7-root & /var/lib/tomcat7/webapps. In Windows just pasting webapps worked but in Ubuntu doesn't. Does it require any extra configuration?

I read somewhere that myapp.xml file should be made in /etc/tomcat7/conf/catalina folder & writing etc configurations. But that also didn't worked.

guntbert
  • 12,914
  • 37
  • 45
  • 86
Deepen
  • 4,009
  • 4
  • 22
  • 32
  • resource not found error...but my app works fine on Windows – Deepen Feb 02 '14 at 10:25
  • Any error in `catalina.out` or in `locahosthost..log`? – David Levesque Feb 02 '14 at 15:50
  • how do I ensure this? – Deepen Feb 02 '14 at 17:33
  • Using CLASSPATH: /usr/share/tomcat7//bin/bootstrap.jar:/usr/share/tomcat7//bin/tomcat-juli.jar touch: cannot touch ‘/usr/share/tomcat7//logs/catalina.out’: Permission denied ./catalina.sh: 387: ./catalina.sh: cannot create /usr/share/tomcat7//logs/catalina.out: Permission denied – Deepen Feb 02 '14 at 18:26
  • This error shows after I uninstalled tomcat7 & downloaded package manually from apache-tomcat website,extracted it to (/usr/share)& added CATALINA_HOME= & JAVA_HOME= @DavidLevesque – Deepen Feb 02 '14 at 18:27
  • May I ask, what's wrong with the standard repository package? – David Levesque Feb 02 '14 at 19:58
  • external webapps werent working! :\ – Deepen Feb 03 '14 at 05:47
  • Can you elaborate? It was probably just a configuration issue. Personally I would stick with the repository package unless I have very good reasons to do otherwise. It has better integration with the OS. – David Levesque Feb 03 '14 at 15:36
  • my webapps werent working on repository package. I pasted my webapps in both folder /usr/share/tomcat7-root & /var/lib/tomcat7/webapps. In Windows just pasting webapps worked but in ubuntu doesnt. Does it require any extra configuration? – Deepen Feb 03 '14 at 16:24
  • I read somewhere that myapp.xml file should be made in /etc/tomcat7/conf/catalina folder & writing etc configurations. But that also didnt worked. – Deepen Feb 03 '14 at 16:26
  • If you understood anything please extend ur answer! :) – Deepen Feb 03 '14 at 16:27
  • You should just paste your webapp under `/var/lib/tomcat7/webapps` (not in two places). Then make sure it has the proper permissions for the user running Tomcat. If it doesn't work, look for errors in the Tomcat logs and post them in your question body. – David Levesque Feb 03 '14 at 16:54

1 Answers1

10

The "Permission denied" error for the logs directory most likely means that the OS user running the Tomcat process does not have write permission on that directory.

Assuming you are running Tomcat with user "tomcat7", try setting the ownership and filesystem permissions of the logs directory, e.g.:

sudo chown -R tomcat7:tomcat7 /usr/share/tomcat7/logs
sudo chmod -R u+rw /usr/share/tomcat7/logs

If you are running Tomcat with a different OS user, replace tomcat7:tomcat7 by the username and primary group of that user, respectively.

David Levesque
  • 671
  • 7
  • 11