Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does tomcat6 have folders in both /var/lib/ and /usr/share/?

I'm new to Linux, and I don't understand why apt-get install tomcat6 resulted in two tomcat6 folders, one in /var/lib/, the other in /usr/share/. I'm sure there is a good reason for it, but it caused me a few hours confusion with nothing working.

What's the deal?

like image 827
Eric Wilson Avatar asked Dec 12 '09 20:12

Eric Wilson


2 Answers

Tomcat Provides a mechanism where you can run multiple instances that all utilizes some common configuration elements. You would use the environment variables CATALINA_HOME vs CATALINA_BASE to configure tomcat(or corresponding properties). See this article for an explanation.

"The first properties (catalina.home) points to the location of the common information, while the other property (catalina.base) points to the directory where all the instance specific information are held."

So the default tomcat6 package in Ubuntu has a configuration that is friendly to people who run single instances as well as those who run multiple instances.

You can see that the tomcat6 package includes both:

  • /usr/share/tomcat6
  • /var/lib/tomcat6

If you are only running one instance of tomcat, then you probably want to use the /var/lib/tomcat6 location.

If by chance you(or other readers) are looking for scripts to automate installing multiple instances of Tomcat on a debian based distro, this one has worked well for me with some slight modifications.

like image 109
Colin Harrington Avatar answered Sep 20 '22 04:09

Colin Harrington


As a developer, the best answer to this question is Don't use apt to install Tomcat.

apt is wonderful for most development tools, but there are exceptions, such as Tomcat and Eclipse.

So just download the zip file, expand, and there you are. logs, conf, webapps, bin, lib and everything else you could need in one place.

like image 39
Eric Wilson Avatar answered Sep 19 '22 04:09

Eric Wilson