Jens Schauder
Jens Schauder

Reputation: 81988

Multiple appbase directories for Tomcat 5.5

I have machine with an installed tomcat 5.5 it serves various application from the default appbase.

I also have a bunch of directories which should get turned into WEBDAV applications, by configuring the common root as appbase, which of course is completely different from the appbase mentioned above

Neither of the directories should move.

So, is there a way to have a second appbase?

Upvotes: 3

Views: 3866

Answers (4)

Ronnie
Ronnie

Reputation: 691

Just want to add to what ZZ Coder said:

The xml file name will be the context/app name.

The xml file name can be anything, and Tomcat will use it as the "path" attribute for your Context. Examples:
myapp.xml -> /myapp
tomcatapp#myapp.xml -> tomcatapp/myapp

tomcat documents

Upvotes: 0

ZZ Coder
ZZ Coder

Reputation: 75496

You can't have multiple appbase but there are multiple ways to get around this issue.

  1. If you have an Apache front-end, you can make multiple hosts look like one by mapping the URLs.
  2. You can create symlink in the appBase.
  3. You can use context fragment so the docBase can be pointed to anywhere, effectively having multiple appBase.

To use context fragment, you need to place a xml file in conf/Catalina/[host] directory. The file should contain something like this,

<Context docBase="/appbase2/app">
</Context>

The xml file name will be the context/app name.

Upvotes: 5

Mark
Mark

Reputation: 108567

You can do it with a multiple virtual HOSTs. A related question.

Upvotes: 2

Aaron Digulla
Aaron Digulla

Reputation: 328770

No but you can create links on the file system to have all directories appear in the same place.

Note that links on NTFS are possible but a bit fragile (which is probably why no one uses them on Windows while Unix users use this powerful feature all the time).

Upvotes: 0

Related Questions