Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where is the Tomcat7 WEB root in Ubuntu 14

Tags:

jsp

ubuntu

tomcat

I have just installed Tomcat 7 for my JSP projects via apt-get so it is installed as a service. I am using Ubuntu 14.10 LTS

I run this code to install everything about Tomcat 7.0.61

sudo apt-get install tomcat7 tomcat7-docs tomcat7-examples tomcat7-common tomcat7-admin tomcat7-user

Then I found that there is tomcat7, tomcat7-docs, tomcat7-examples, and tomcat7-admin installed in /usr/share folder

This makes me completely confused cuz I can run examples and docs via the url http://localhost:8080/examples or http://localhost:8080/docs

Note that the examples and docs folders are in /usr/share. So I feel like the /usr/share folder is my web root for Tomcat 7 because those folders are in there.

However, in /var/lib/tomcat7/, there is webapps folder but when I try putting file in the folder, the file is not working at all.

So anyone can explain where the webapps or root folder for Tomcat is? and how to properly set the path for the web root folder?

like image 271
H.J. Frost Avatar asked Apr 18 '15 16:04

H.J. Frost


1 Answers

tomcat webapps root is /var/lib/tomcat7/webapps/ and you may want to set a soft link to it in /usr/share/tomcat7 :

cd /usr/share/tomcat7/
ln -s /var/lib/tomcat7/webapps/ . 

and same for conf

cd /usr/share/tomcat7
ln -s /var/lib/tomcat7/conf/ .

and for log:

cd /usr/share/tomcat7
ln -s /var/log/tomcat7 .
like image 129
Taher Khorshidi Avatar answered Nov 09 '22 11:11

Taher Khorshidi