Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

WebApps directory

 
Sunder Ganapathy
Ranch Hand
Posts: 120
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it compulsory to have one's application immediately under webapps directory? I want to have my application to be accessed as http://localhosts:8080/a/b/Servlet, where a is under webapps and b is in a.

Some previous discussions at this place have given some solutions and they do not work. For example, Configure Tomcat 6 to serve applications in other than default directory, does give one solution and it does not work. While starting, Tomcat 6.0.14, it gives serious error.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is compulsory to have a well formed application directory structure (there has to be a 'WEB-INF' directory in the root of your application.

As long as you have a proper directory structure, you can configure Tomcat to deploy it from any directory that it can see.

To do this, you can add a <Context .../> entry to your server.xml (old way) or create a context fragment file in tomcat/conf/Catalina/localhost with the <Context .../> tag in it (best practice).
With either approach, just add a the path to your app in the docBase attribute.

See:
http://tomcat.apache.org/tomcat-6.0-doc/config/context.html
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic