tomcat-userconfig
 

Host lifecycle event listener for Apache Tomcat to automatically deploy update and undeploy applications from user home directories.

This is a rewrite of org.apache.catalina.startup.UserConfig

Changes (full changelog)

(Mikhail Kryshen)
2009-11-03: Fix typo in comment. tip

Fix typo in comment.

(Mikhail Kryshen)
2009-11-03: Update README.

Update README.

(Mikhail Kryshen)
2009-11-03: Update README.

Update README.

(Mikhail Kryshen)
2009-11-03: Move README.

Move README.

Readme

Host lifecycle event listener for Apache Tomcat to automatically deploy update and undeploy applications from user home directories.

This is a rewrite of org.apache.catalina.startup.UserConfig listener included in Tomcat which adds the following features:

  • multiple web applications for each user,
  • automatic application deployment,
  • on UNIX uses getent to read network user database.

Installation

Pre-built version

Copy dist/userconfig.jar to Tomcat lib directory. Add Listener to the Host element in the Tomcat configuration file (server.xml).

Listener that uses passwd database to list users:

<Listener className="kryshen.catalina.userconfig.PasswdUserConfig"/>

Listener that considers all home directories in the specified base directory:

<Listener className="kryshen.catalina.userconfig.HomesUserConfig"/>

Listener properties

Common:

  • directoryName — base directory for web applications inside user's home directory. Default: "public_webapps".

  • appsPerUser — maximum number of application each user is allowed to deploy. If greater than 1 or equals -1 (multi-app mode) each user's application subdirectory in the base directory is mapped to "/~username/application", "ROOT" is mapped to "/~username". In single-app mode (appsPerUser = 1) the base directory is mapped to "/~username". Default: -1 (unlimited).

PasswdUserConfig:

  • passwd - path to local passwd file. Default: "/etc/passwd".

  • getent - path to getent program. Local passwd is used if this is not set.

HomesUserConfig:

  • homeBase - base directory for user homes. Default: "/home".

Example

<Host name="localhost" appBase="webapps"
      unpackWARs="true" autoDeploy="true"
      xmlValidation="false" xmlNamespaceAware="false"
      backgroundProcessorDelay="15">

     <Listener className="kryshen.catalina.userconfig.PasswdUserConfig"
               getent="/usr/bin/getent" directoryName="public_html"
               appsPerUser="5"/>
</Host>