tomcatmanager
tomcatmanager is a command line tool and python library for managing a Tomcat server.
What Can It Do?
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
--connected to http://localhost:8080/manager as ace
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 package directly:
>>> import tomcatmanager as tm
>>> tomcat = tm.TomcatManager()
>>> r = tomcat.connect(url="http://localhost:8080/manager",
... user="ace", password="newenglandclamchowder")
>>> tomcat.is_connected
True
>>> r = tomcat.stop("/someapp")
>>> r.status_code == tm.StatusCode.OK
False
>>> r.status_message
'No context exists named /someapp'
The following capabilites are supported from interactive use, the Command Line, and from python:
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
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
sessions - show active sessions for a particular tomcat application
expire - expire idle sessions
list - show all installed applications
serverinfo - show information about the server, including tomcat version, OS version and architecture, and jvm version
status - show server status information in xml format
vminfo - show diagnostic information about the jvm
threaddump - show a jvm thread dump
resources - show the global jdni resources configured in tomcat
findleakers - show tomcat applications that leak memory
sslconnectorciphers - show tls ciphers configured for each connector
sslconnectorcerts - show tls certificate chain for each virtual host
sslconnectortrustedcerts - show trusted certificates for each virtual host
sslreload - reload tls certificate and key files
Table of Contents
- Installation
- Configure Tomcat
- Interactive Use
- Command Line
- Use from Python
- Authentication
- API Documentation
- TomcatManager
- TomcatManagerResponse
- TomcatApplication
- ApplicationState
- StatusCode
- ServerInfo
- TomcatMajorMinor
- TomcatError
- TomcatNotConnected
- TomcatNotImplementedError
- Migrating to version 2.x
- Migrating to version 3.x
- Migrating to version 4.x
- Migrating to version 5.x
- Migrating to version 6.x
- Migrating to version 7.x
- Contributing
- Get Source Code
- Create Python Environments
- Install Dependencies
- Branches, Tags, and Versions
- Invoking Common Development Tasks
- Testing
- Testing Against A Real Server
- Code Quality
- Code Formatting
- Punctuation and Capitalization for Users
- Punctuation and Capitalization for Developers
- Documentation
- Make a Release
- Changelog
- Unreleased
- 6.0.1 (2022-11-15)
- 6.0.0 (2022-11-14)
- 5.0.0 (2021-11-19)
- 4.0.0 (2021-08-26)
- 3.0.0 (2021-05-04)
- 2.0.0 (2021-03-26)
- 1.0.2 (2020-03-05)
- 1.0.1 (2020-02-21)
- 1.0.0 (2020-02-01)
- 0.14.0 (2019-05-16)
- 0.13.0 (2018-07-06)
- 0.12.0 (2018-02-23)
- 0.11.0 (2017-09-06)
- 0.10.0 (2017-08-24)
- 0.9.2 (2017-08-16)
- 0.9.1 (2017-08-10)
- 0.9.0 (2017-08-10)
- Changes in 2014 and 2015
- 0.4 (2013-07-07)
- 0.3 (2013-01-02)