• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Configure Tomcat 6 to serve applications in other than default directory

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This exact same scenario was discussed here.
 
shaikna lebbai
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic