Tomcat Service and Java Applications on Domains: tomcat Utility

The tomcat utility is used to manage the Tomcat service and the Java-based Web applications on domains through CLI. By using this utility, you can perform the following tasks:

Syntax

tomcat <command> [

<option_1> [<param>]

[<option_2> [<param>]]

…[<option_N> [<param>]]

]

Example

The following command line installs a new Java-based Web application from file /usr/local/siteapps/webapp1.war on domain example.com:

# ./tomcat --install /usr/local/siteapps/webapp1.war -domain example.com

Commands

Command

Parameter

Description

Example

--install or -i

<file name>

Installs a Java-based Web application on a domain.

Requires concomitant use of the -domain option.

To install a Web application from file /usr/local/siteapps/webapp1.war on domain example.com:

# ./tomcat --install /usr/local/siteapps/webapp1.war -domain example.com

or

# ./tomcat -i /usr/local/siteapps/webapp1.war -domain example.com

--remove or -r

<webapp name>

Deletes a Java-based web application from a domain.

Requires concomitant use of the -domain option.

To delete Web application WebApp1 from domain example.com:

# ./tomcat --remove webapp1 -domain example.com

or

# ./tomcat -r webapp1 -domain example.com

-update-service

<domain name>

Updates a domain's Tomcat service status.

To enable Tomcat service on domain example.com:

# ./tomcat --update-service example.com -status enabled

--update

<webapp name>

Updates a Java-based web application status.

Requires concomitant use of the -domain option.

To start Web application WebApp1 on domain example.com:

# ./tomcat --update webapp1 -domain example.com -status enabled

or

# ./tomcat -r webapp1 -domain example.com -status enabled

--help or -h

 

Displays help on the use of the utility.

To view help on the use of the utility:

# ./tomcat --help

or

# ./tomcat -h

Options

Option

Parameter

Description

Example

-domain

<domain name>

Specifies a domain on which a Java application is to be installed or updated.

To install a Web application from file /usr/local/siteapps/webapp1.war on domain example.com:

# ./tomcat -i /usr/local/siteapps/webapp1.war -domain example.com

-status

enabled| disabled| admin, domadm, parent, client

Enables or disables Tomcat service or a Java application on a domain (the enabled or disabled parameters, respectively). Disables Tomcat service or a Java application and sets the Tomcat service or a Java application status to disabled by administrator (admin) or disabled by client (client). Sets the Tomcat service or a Java application status to the status of the domain (parent). The use of the domadm parameter is restricted; the parameter should not be used for changing the service or application status.

To enable the webapp application on domain example.com:

# ./tomcat --update webapp -status enabled -domain example.com

 

To set the status of the Tomcat service on domain example.com to the status of the domain:

# ./tomcat --update-service example.com -status parent