You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Marty Hagenston <ha...@earthlink.net> on 2002/09/28 06:20:56 UTC

Deploy or install .war

Greetings,

I am very new at this.  I have tomcat running and I can view the index.jsp in my browser set to localhost: 8080

Now I want to deploy or install (not sure which one) a .war   I put the .war in webapps and tried to use the manager command of both deploy and install by giving it the path..

No go..it doesn't recognize my command deploy.

Stuck..Please help.

Marty

Re: Deploy or install .war

Posted by Nani Jon <na...@yahoo.com>.
Marty:
Make sure that you add the context for your WAR file in the server.xml file. There are examples of a working and deployed application in Tomcat (e.g. /examples applicaton). You can also set the flag in the server.xml file to keep the WAR file as is or un-pack it.
Hope this will help.
Nanijon.
 Ben Walding wrote:Once the war file is in the webapps directory it will auto-deploy when 
you restart TomCat. I realise this doesn't truly answer your question, 
but it should fix your problem.


I'm presuming you are using a 4.1.x version (4.0.x is pretty much the 
same, but not quite as nice).

Marty Hagenston wrote:

>Greetings,
>
>I am very new at this. I have tomcat running and I can view the index.jsp in my browser set to localhost: 8080
>
>Now I want to deploy or install (not sure which one) a .war I put the .war in webapps and tried to use the manager command of both deploy and install by giving it the path..
>
>No go..it doesn't recognize my command deploy.
>
>Stuck..Please help.
>
>Marty
>
> 
>




--
To unsubscribe, e-mail: 
For additional commands, e-mail: 



---------------------------------
Do you Yahoo!?
New DSL Internet Access from SBC & Yahoo!

Re: Deploy or install .war

Posted by Ben Walding <be...@walding.com>.
Once the war file is in the webapps directory it will auto-deploy when 
you restart TomCat.  I realise this doesn't truly answer your question, 
but it should fix your problem.


I'm presuming you are using a 4.1.x version (4.0.x is pretty much the 
same, but not quite as nice).

Marty Hagenston wrote:

>Greetings,
>
>I am very new at this.  I have tomcat running and I can view the index.jsp in my browser set to localhost: 8080
>
>Now I want to deploy or install (not sure which one) a .war   I put the .war in webapps and tried to use the manager command of both deploy and install by giving it the path..
>
>No go..it doesn't recognize my command deploy.
>
>Stuck..Please help.
>
>Marty
>
>  
>




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Deploy or install .war

Posted by Bryan Dollery <Br...@ChaosEngineers.co.nz>.
Hi Marty,

> I am very new at this.  I have tomcat running and I can view the
> index.jsp in my browser set to localhost: 8080

That's a good start.

> Now I want to deploy or install (not sure which one) a .war   I
> put the .war in webapps and tried to use the manager command of
> both deploy and install by giving it the path..

If you put the war in your webapps then you have manually deployed it - you
don't need to do anything else except restart tomcat, and hit the url.

> No go..it doesn't recognize my command deploy.

You have to do a few things to get the manager working, like add a manager
role, username, and password to the tomcat-users.xml file. Once you've done
that the easiest way to use it is through ANT.

First you need one of the Catalina ant tasks, like this:

<taskdef name="deploy" classname="org.apache.catalina.ant.DeployTask"/>

To make this work you need to add the Catalina ant tasks to your
classpath - they're in server/lib/catalina-ant.jar.

Then you need a target that uses this task, something like:

<target name="deploy" depends="init">
  <deploy url="${url}" username="${un}" password="${pw}"
path="${context-path}" war="file://${war}" />
</target>

In the init target you'll need to set the variables up:

<target name="init">
  <property name="dist" value="dist" />
  <property name="projectName" value="book" />
  <property name="war" value="${dist}/${projectName}.war" />
  <property name="url" value="http://localhost/manager" />
  <property name="context-path" value="/${projectName}" />
  <property name="un" value="admin" />
  <property name="pw" value="admin" />
</target>

Then you can simply call ant's deploy task whenever you want to deploy your
war file.

Cheers,

Bryan



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>