
The Tomcat Host Manager application enables you to create, delete, and otherwise manage virtual hosts within Tomcat. This how-to guide is best accompanied by the following pieces of documentation:
The Tomcat Host Manager application is a part of
Tomcat installation, by default available using the following
context: /host-manager. You can use the host manager in the
following ways:
{server}:{port}/host-manager/html.
{server}:{port}/host-manager/text.
Both ways enable you to add, remove, start, and stop virtual hosts.
Changes may be persisted by using the persist command. This
document focuses on the HTML interface. For further information about the
graphical interface, see
Host Manager App -- Text Interface.
The description below uses $CATALINA_HOME to refer the
base Tomcat directory. It is the directory in which you installed
Tomcat, for example C:\tomcat9, or
/usr/share/tomcat9.
The Host Manager application requires a user with one of the following roles:
admin-gui - use this role for the graphical web interface.
admin-script - use this role for the scripting web interface.
To enable access to the HTML interface of the Host Manager application,
either grant your Tomcat user the appropriate role, or create a new one with
the correct role. For example, open
${CATALINA_BASE}/conf/tomcat-users.xml and enter the following:
<user username="test" password="chang3m3N#w" roles="admin-gui"/>
No further settings is needed. When you now access
{server}:{port}/host-manager/html,you are able to
log in with the created credentials.
If you are using a different realm you will need to add the necessary role to the appropriate user(s) using the standard user management tools for that realm.
The interface is divided into six sections:
Displays information about the success or failure of the last Host Manager command you performed:
Note that the console of your Tomcat server may reveal more information about each command.
The Host Manager section enables you to:
The Host name section contains a list of currently-configured virtual host names. It enables you to:
The Add Virtual Host section enables you to add a virtual host using a graphical interface. For a description of each property, see the Host Manager App -- Text Interface documentation. Note that any configuration added via this interface is non-persistent.
The Persist Configuration section enables you to persist your current configuration into the server.xml file.
This functionality is disabled by default. To enable this option, you must
configure the StoreConfigLifecycleListener listener first.
To do so, add the following listener to your server.xml:
<Listener className="org.apache.catalina.storeconfig.StoreConfigLifecycleListener"/>After you configure the listener, click All to make your configuration persistent.
Provides a basic information about the currently-running Tomcat instance, the JVM, and the underlying operating system.