Debian

從包中安裝的 Tomcat 的正確 catalina_base 路徑是什麼?

  • April 1, 2015

我有以下清單來配置 Tomcat 以使用 8983 埠:

include java
class { 'tomcat': install_from_source => false }

tomcat::instance {'default': package_name => 'tomcat7'} ->
 tomcat::service  {'default':
   use_jsvc => false, use_init => true, service_name => 'tomcat7'
 }->
 tomcat::config::server { 'tomcat7':
   catalina_base => '/usr/share/tomcat7',
   port          => 8983,
 }

但是,執行時,出現以下錯誤:

$ sudo puppet apply -vd tomcat-test.pp
debug: Augeas[server-/usr/share/tomcat7](provider=augeas): Augeas version 1.3.0 is installed
debug: Augeas[server-/usr/share/tomcat7](provider=augeas): sending command 'set' with params ["/files/usr/share/tomcat7/conf/server.xml/Server/#attribute/port", "8983"]
debug: Augeas[server-/usr/share/tomcat7](provider=augeas): Closed the augeas connection
err: /Stage[main]//Tomcat::Config::Server[tomcat7]/Augeas[server-/usr/share/tomcat7]: Could not evaluate: Save failed with return code false

這表明 Augeas 正在嘗試/usr/share/tomcat7/conf/server.xml修改/etc/tomcat7.

puppetlabs-tomcat GitHub 上,我們可以閱讀:

tomcat::config::server:為$CATALINA_BASE/conf/server.xml.

$catalina_base指定 Tomcat 安裝的基本目錄。

這表明我應該conf在 Tomcat 基本文件夾 () 中有 dir CATALINA_BASE,但它不存在,因為所有配置都單獨儲存在/etc/tomcat7.

請參閱:Tomcat 文件

該模組有什麼方法puppetlabs-tomcat可以以某種方式正確處理預設安裝的Tomcat實例嗎?或者我應該創建一個符號連結?

似乎它的catalina_base屬性不正確,即CATALINA_HOME已被定義而不是CATALINA_BASE. 將其更改為/var/lib/tomcat7並再次執行 puppet。

引用自:https://serverfault.com/questions/679918