tomcat Tomcat Virtual Hosts Adding a Virtual Host to server.xml


Once a virtual host has been added via the web application, directories will exist at:


To persist the virtual host after a restart, the server.xml file must be updated with the configuration. A Host element needs to be added inside the Engine element, similar to this:

<Engine name="Catalina" ...>
  <Host name="my-virtual-app" appBase="virtualApp" autoDeploy="true" unpackWARs="true" ... />

The attributes in the Host element should reflect the selections made in the host manager GUI (see the Host documentation for details), but can be changed. Note that the Manager App option in the GUI does not correspond to any Host attribute.