Asghar
Asghar

Reputation: 2346

java application deployment on tomcat server on red hat?

I have a java web service application, i created a .WAR file. and now i have loaded .WAR file in a folder that is in a root for example

/mytestdir/mywebapp.WAR

now i want my tomcat5 to run this file that is out of tomcat5 webapps directry. Please help me how can i run this .WAR that i should be able to access like this

http://www.mysite.com:8080/mywebapp

in .WAR file i have a code that needs to access some root level folders.

this is my first deployment.

Upvotes: 0

Views: 974

Answers (2)

Konstantin Yovkov
Konstantin Yovkov

Reputation: 62864

You have to create a Tomcat Context.

In order to do so, open TOMCAT_HOME/conf/server.xml and add a Context that will point to the war file location. For example:

<Context path="/MyApplication" docBase="/mytestdir/mywebapp.WAR" reloadable="false" />

Then, restart your Tomcat instance and you're done.

Upvotes: 2

PonomarevMM
PonomarevMM

Reputation: 462

You should change your config.xml Smth, like this

<?xml version="1.0" encoding="UTF-8"?>
    <Context path="/mywebapp"  docBase="/mytestdir/mywebapp.WAR">

see docBase attribute

Upvotes: 0

Related Questions