• 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

How to deploy my application in different directory rather than in WEBAPPS?

 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello All,

I want to deploy my application in someother location rather than webapps directory in Tomcat.

I installed Apache Tomcat 4.1.31 (C:/tomcat4.1.31) and Apache web server 2.0.46 (C:/apache2046). I keep my projects at projects (E:/Projects) directory. I have both PHP and Java projects. I have configured PHP projects to run straightway by creating Virtual hosts at Apache web server. They are all working fine. Now, i have placed my new java project, PortalJobs at E:/Projects/PortalJobs. I also created a project, PortalJobs in Eclipse for E:/Projects/PortalJobs and the workspace is also the same location of the project. Now, What i do is I compile the class files and place them at webapps/PortalJobs/WEB-INF/classes/com/PortalJobs/core/ to run my JSP files. It works perfectly.

Now, i am tired of copying files from my project directory to Webapps directory each time after compilation and also making changes in JSP files for testing my application. Is there any way to keep my files at E:/Project/PortalJobs and run them strightway without moving files to WebApps like Virtual Host in Apache? i.e Deploying an application in different directory rather than the traditional one, WEBAPPS.

I am totally newbie in Tomcat and could anyone guide step by step. I am in a beginner level when it comes to Tomcat. But, For Apache, i am in intermediate level.

Thank you.
 
Ranch Hand
Posts: 245
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You'll want to modify either the Host tag or the Context tag within your conf/server.xml. For example the default looks something like:



If you want the entire host to go to a different directory then change the appBase in the Host section. If you want only a particular URL to go somewhere else change the context to something like:



That way any accesses that include /someURL will be directed to a different web app. Note that if the docBase path does not start with a root path name (like / on Unix or C: on Windows) the context is relative to the appBase of the enclosing Host.
 
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Before closing of host tag write following code.

<Context path="/jsf" reloadable="true" docBase="F:\JSF\jsfks\WebContent" workDir="F:\JSF\work" />
</Host>
 
S Dongan
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank u very much. Will try it out today and let u all know the result.
 
permaculture is a more symbiotic relationship with nature so I can be even lazier. Read tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic