I am setting this up on Ubuntu 14.04.3 LTS.
I am using the Tomcat 7 provided by the
It installs Tomcat as a system service by providing a standard init script:
and configuration file:
Tomcat supports running multiple instances with the same server software.
The server software is located in
$CATALINA_HOME, the files for the instance are located in
$CATALINA_BASE. They are defined as follows in
(Caveat: when editing files in the latter, be aware that it has some symlinks into the former.)
tomcat7-user package provides the utility
tomcat7-instance-create that can be used to create a directory tree for an additional Tomcat instance, including a
bin/ directory with scripts for starting and stopping the instance manually.
What I haven't found is support for turning such an additional instance into a system service. Therefore, it must be done manually, e.g. as follows:
- Pick a value for the service name; it will be
$NAME in the new init script.
- Create a new user with that name that will own the files for the Tomcat instance and as which Tomcat will run. It can be a system user, its properties should be the same as for the
tomcat7-instance-create as that user to create a Tomcat instance.
- Configure it and install the web application(s) you want to run with it. Test them using its
- Move the logs to
/var/log/$NAME and symlink them back to
logs/ of the new Tomcat instance.
/etc/init.d/$NAME, e.g. by copying and modifying
/etc/init.d/tomcat7 and modifying the assignment to
$NAME. (It would be nicer if you didn't need to copy the whole script but could just create a link to it.)
/etc/default/$NAME to point at your Tomcat instance and user.
upstart-rc.d to install the new service.
I gleaned some of the details from Kodjo-Kuma Djomeda.