aspose file tools*
The moose likes Tomcat and the fly likes How to deploy my application in different directory rather than in WEBAPPS? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "How to deploy my application in different directory rather than in WEBAPPS?" Watch "How to deploy my application in different directory rather than in WEBAPPS?" New topic
Author

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

S Dongan
Greenhorn

Joined: Sep 17, 2005
Posts: 18
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.


Regards,
Dongan
Scott Dunbar
Ranch Hand

Joined: Sep 23, 2004
Posts: 245
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.


<a href="http://forums.hotjoe.com/forums/list.page" target="_blank" rel="nofollow">Java forums using Java software</a> - Come and help get them started.
dimpsonu arora
Ranch Hand

Joined: Aug 13, 2003
Posts: 51
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

Joined: Sep 17, 2005
Posts: 18
Thank u very much. Will try it out today and let u all know the result.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to deploy my application in different directory rather than in WEBAPPS?