<?xml version="1.0" encoding="UTF-8"?>
<section version="5.0" 
         xmlns="http://docbook.org/ns/docbook" 
         xmlns:xlink="http://www.w3.org/1999/xlink" 
         xmlns:xi="http://www.w3.org/2001/XInclude" 
         xmlns:svg="http://www.w3.org/2000/svg" 
         xmlns:mml="http://www.w3.org/1998/Math/MathML" 
         xmlns:html="http://www.w3.org/1999/xhtml" 
         xmlns:db="http://docbook.org/ns/docbook" 
         xml:lang="en" 
         xml:id="deploy.war">

  <info><title>Deploying and installing a Web application</title></info>
    
    <para>
      Before deploying a web application in the JOnAS application server, first 
      package
       its components in a war file as explained in the 
      <link xlink:href="web_pg.html#web.packaging">
        WAR packaging guide
      </link>
      . 
       For 
      Apache ANT
      , refer to the target 
      <code>
        war
      </code>
       in the 
      <code>
        $JONAS_ROOT/examples/earsample/build.xml
      </code>
       file.
    </para>
    <para>
      Next, 
      install
       the war file into the 
      <code>
        $JONAS_ROOT/webapps
      </code>
       directory. 
      Note:
       Be aware that the war file must not be installed in the 
      <code>
        $CATALINA_HOME/webapps
      </code>
       directory.
    </para>
    <para>
      Then, check the 
      configuration
      : before running the web application; check that the 
      web
       service is present in the 
      <code>
        jonas.services
      </code>
       property. The 
      ejb
       service may also be needed if the Web application uses enterprise beans. 
       The name of the war file can be added in the 
      <code>
        jonas.service.web.descriptors
      </code>
       section.
    </para>
    <para>
      Finally, 
      run
       the application Server:
      <code>
        
        jonas start
      </code>
    </para>
    <para>
      The web components are deployed in a web container created during the startup. If the war file was not added in the 
      <code>
        jonas.service.web.descriptors
      </code>
       list, the web components can be dynamically deployed using the 
      <code>
        jonas admin
      </code>
       command or 
      <code>
        JonasAdmin
      </code>
       tool.
    </para>
  </section>