Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tomcat - Multiple webapps folders

Is it possible to have multiple folders where I can place applications to be deployed?

How are these defined?

And is it possible to restrict one folder to just be applications for "domain.com" and no other domain.

Thanks

like image 472
Mark Sailes Avatar asked Nov 04 '08 13:11

Mark Sailes


People also ask

What is Tomcat webapps folder?

The webapps directory is where deployed applications reside in Tomcat. The webapps directory is the default deployment location, but this can be configured with the appBase attribute on the <Host> element.

Can you deploy multiple services in Tomcat?

You can of course have multiple apps in each directory if you need. Another option is to keep the default tomcat configuration and use another http server (apache, nginx, lighttpd,...) to map a port to the internal path of a tomcat application.


1 Answers

Take a look at conf/server.xml:

  <Host name="localhost" debug="0" appBase="webapps"
   unpackWARs="true" autoDeploy="true"
   xmlValidation="false" xmlNamespaceAware="false">

You can nest <Host> elements within the <Engine> element and have different ones corresponding to different virtual hosts, different appBase's etc.

Here's the documentation on the <Host> element.

like image 191
matt b Avatar answered Oct 12 '22 09:10

matt b