• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Configure Tomcat 6 to serve applications in other than default directory

 
shaikna lebbai
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
By default, Tomcat serves any application context stored under %TOMCAT_HOME%\webapps directory.

Besides, I want to keep a new application, say "test2", in other than default directory, i.e say in "d:\www\test2" directory.

I've tried different ways in both server.xml and context.xml, but in vain.
(There is no clear documentation or specific example in forum too)

Would you please guide me the required file changes with corresponding codes.
Thanks.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you create a context fragment file under tomcat/conf/Catalina/localhost that points to your web app, you can keep your web app anywhere you like.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This exact same scenario was discussed here.
 
shaikna lebbai
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks!

I've created %CATALINA_HOME%\conf\catalina\localhost\test2.xml, and placed below contents:

<Context path="/test2" reloadable="true" docBase="d:\www\test2" debug="1"/>

and, restarted tomcat.

It worked perfectly!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic