Multiple appbase directories for Tomcat 5.5
I have mach开发者_如何学运维ine 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?
You can't have multiple appbase but there are multiple ways to get around this issue.
- If you have an Apache front-end, you can make multiple hosts look like one by mapping the URLs.
- You can create symlink in the appBase.
- 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.
You can do it with a multiple virtual HOSTs. A related question.
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).
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
精彩评论