Skip to main content

If you use Apache Tomcat for any sort of development work you’ve probably deployed lots of applications to it. There are a several ways to get your war files deployed:

Here’s another way. tomcatmanager is a command line tool and python library for managing a Tomcat server.

Quick Tour

This package installs a command line utility called tomcat-manager. It’s easily scriptable using your favorite shell:

$ tomcat-manager --user=ace --password=newenglandclamchowder \
  http://localhost:8080/manager deploy local sample.war /sampleapp
$ echo $?
0

There is also an interactive mode:

$ tomcat-manager
tomcat-manager>connect http://localhost:8080/manager ace newenglandclamchowder
tomcat-manager>list
Path                     Status  Sessions Directory
------------------------ ------- -------- ------------------------------------
/                        running        0 ROOT
/sampleapp               stopped        0 sampleapp##9
/sampleapp               running        0 sampleapp##8
/host-manager            running        0 /usr/share/tomcat8-admin/host-manage
/manager                 running        0 /usr/share/tomcat8-admin/manager

And for the ultimate in flexibility, you can use the python library directly:

>>> import tomcatmanager as tm
>>> tomcat = tm.TomcatManager(url='http://localhost:8080/manager',
... userid='ace', password='newenglandclamchowder')
>>> tomcat.is_connected
True
>>> r = tomcat.stop('/')
>>> r.status_code == tm.codes.ok
False
>>> r.status_message
'No context exists named /sample'

Installation

Install tomcatmanager using pip:

$ pip install tomcatmanager

Tomcat Configuration

This library and associated tools do their work via the Tomcat Manager web application included in the Tomcat distribution. You will need to configure authentication in tomcat-users.xml with access to the manager-script role:

<tomcat-users>
.....
    <role rolename="manager-script"/>
    <user username="ace" password="newenglandclamchowder" roles="manager-script"/>
</tomcat-users>

Features

The tomcat-manager command line tool supports the following commands:

  • list - show all installed applications

  • serverinfo - show information about the server, including tomcat version, OS version and architecture, and jvm version

  • statusxml - show server status information in xml format

  • vminfo - show diagnostic information about the jvm

  • sslconnectorciphers - show ssl/tls ciphers configured for each connector

  • threaddump - show a jvm thread dump

  • resources - show the global jdni resources configured in tomcat

  • findleakers - show tomcat applications that leak memory

  • sessions - show active sessions for a particular tomcat application

  • expire - expire idle sessions

  • start - start a tomcat application that has been deployed but isn’t running

  • stop - stop a tomcat application and leave it deployed on the server

  • reload - stop and start a tomcat application

  • deploy - deploy a war file containing a tomcat application in the tomcat server

  • redeploy - remove the application currently installed at a given path and install a new war file there

  • undeploy - remove an application from the tomcat server

Metadata

Release files for tomcatmanager 0.9.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tomcatmanager 0.9.2
File Size Uploaded
tomcatmanager-0.9.2.tar.gz 42.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for tomcatmanager 0.9.2
File Interpreter ABI Platform
tomcatmanager-0.9.2-py3-none-any.whl Python 3 none any Details

Total release size: 64.2 kB

Release files / tomcatmanager-0.9.2.tar.gz

Download URL tomcatmanager-0.9.2.tar.gz
Size 42.0 kB
Tags Source
SHA-256 checksum
How to use checksums
ab300cb8b89d43cb5e9613d47bce366d1287e65ee352f293db082e1eba22efcc
BLAKE2b-256 checksum
How to use checksums
0138dab3e4e597e653d3ae78b735fda45e4bb082ed83b00710d87bd196953db7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / tomcatmanager-0.9.2-py3-none-any.whl

Download URL tomcatmanager-0.9.2-py3-none-any.whl
Size 22.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c4b82b2841e1b5fddfe37afb48b90b58efe3209e9698d4a9efbe8f795cef7ee1
BLAKE2b-256 checksum
How to use checksums
409db49e99bcef49da9afd814837edc1ba33b278b7e4aaca54aa6346ad1310b1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

7.0.1

2 release files

7.0.0

2 release files

6.0.1

2 release files

6.0.0

2 release files

5.0.0

2 release files

4.0.0

2 release files

3.0.0

2 release files

2.0.0

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.14.0

2 release files

0.12.0

2 release files

0.10.0

2 release files

This release

0.9.2 This release

2 release files

0.9.1

2 release files

0.9.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page