我是 Linux 新手,我不明白为什么 apt-get install tomcat6
会产生两个 tomcat6
文件夹,一个在 /var/lib/
,另一个在/usr/share/
。我确信这是有充分理由的,但它让我困惑了几个小时,没有任何效果。
这是怎么回事?
最佳答案
Tomcat 提供了一种机制,您可以在其中运行多个实例,这些实例都使用一些通用配置元素。您将使用环境变量 CATALINA_HOME
与 CATALINA_BASE
来配置 tomcat(或相应的属性)。参见 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."
所以 default tomcat6 package in Ubuntu具有对运行单个实例以及运行多个实例的人友好的配置。
您可以看到 tomcat6 package includes两者:
/usr/share/tomcat6
/var/lib/tomcat6
如果您只运行一个 tomcat 实例,那么您可能希望使用 /var/lib/tomcat6
位置。
如果您(或其他读者)碰巧正在寻找脚本来在基于 debian 的发行版上自动安装多个 Tomcat 实例,this one has worked well对我来说稍作修改。
关于linux - 为什么tomcat6在/var/lib/和/usr/share/都有文件夹?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1894657/