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

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Extensions
> Step 2: And Like the video. BONUS: You can also share it!


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.

Got any tomcat Question?