Easy to Learn Java: Programming Articles, Examples and Tips

Start with Java in a few days with Java Lessons or Lectures

Home

Code Examples

Java Tools

More Java Tools!

Java Forum

All Java Tips

Books

Submit News
Search the site here...
Search...
 
Search the JavaFAQ.nu
1000 Java Tips ebook

1000 Java Tips - Click here for the high resolution copy!1000 Java Tips - Click here for the high resolution copy!

Java Screensaver, take it here

Free "1000 Java Tips" eBook is here! It is huge collection of big and small Java programming articles and tips. Please take your copy here.

Take your copy of free "Java Technology Screensaver"!.

Question: Can I install an application on Tomcat on the fly or do I need to stop

JavaFAQ Home » JSP, Servlets Go to all tips in JSP, Servlets


Bookmark and Share

Answer: Installation of web application is named a deployment. Deployment can be done in two ways:

Statically - we stop Tomcat first, place our application and then starting up Tomcat.
Dynamically - this on the fly installation or update of currently deployed application.

The Tomcat Manager is a tool that allows URL-based web application deployment features. There is also a tool called the Client Deployer, which is a command shell based script that interacts with the Tomcat Manager but provides additional functionality such as compiling and validating web applications as well as packaging web application into web application resource (WAR) files.

For static deployment first look at server.xml file in conf directory and search for:

<Host name="localhost" appBase="webapps"
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false">

 

appBase is a place where you deploy your applications. For example you have an application named tomcatproblem. Then the full path to your files will be:

$CATALINA_BASE/webapps/tomcatproblem/

In this directory you copy all your files to make troubles for Tomcat Smile

All the files must have proper permissions.

P.S. I recommend you to extract files from war file yourself. From my experience Tomcat sometime does not do that Sad

Dynamic Deployment is more complex task and I never done it. So, I will not fool you and pretend that I am deployment guru. Just give you a direction where you should look: search  for "Tomcat manager". Just will mention what Tomcat manager do for you:

 

  • Deploy a new web application, on a specified context path, from the uploaded contents of a WAR file.
  • Deploy a new web application, on a specified context path, from the server file system.
  • List the currently deployed web applications, as well as the sessions that are currently active for those web apps.
  • Reload an existing web application, to reflect changes in the contents of /WEB-INF/classes or /WEB-INF/lib.
  • List the OS and JVM property values.
  • List the available global JNDI resources, for use in deployment tools that are preparing <ResourceLink> elements nested in a <Context> deployment description.
  • List the available security roles defined in the user database.
  • Start a stopped application (thus making it available again).
  • Stop an existing application (so that it becomes unavailable), but do not undeploy it.
  • Undeploy a deployed web application and delete its document base directory (unless it was deployed from file system).

The rest is up to you Smile


 Printer Friendly Page  Printer Friendly Page
 Send to a Friend  Send to a Friend

.. Bookmark and Share

Search here again if you need more info!
Custom Search



Home Code Examples Java Forum All Java Tips Books Submit News, Code... Search... Offshore Software Tech Doodling

RSS feed Java FAQ RSS feed Java FAQ News     

    RSS feed Java Forums RSS feed Java Forums

All logos and trademarks in this site are property of their respective owner. The comments are property of their posters, all the rest 1999-2006 by Java FAQs Daily Tips.

Interactive software released under GNU GPL, Code Credits, Privacy Policy