views:

27

answers:

1

Hi,

I have web application abc.war and I want to deploy it on Apache Tomcat. The problem is that, by default, the path to this application is http://<server-name>/abc but I want to access it as http://<server-name>/xyz.

I put into WAR's META-INF folder the file context.xml that is :

<Context path="/xyz" docBase="abc" override="true" />

The application WAR abc.war is located under %CATALINA_HOME%\webapps and it is extracted to %CATALINA_HOME%\webapps\abc folder.

Also, while deployment, the file context.xml from abc/META-INF is copied to %CATALINA_HOME%\conf\Catalina\localhost as abc.xml

It seems that this should work, but I still can't access my application through http://&lt;server-name&gt;/xyz, but only through http://&lt;server-name&gt;/abc

In addition, I still see in apache log the following line while deployment of abc.war : context path = /abc

Could anybody, please, help while this doesn't work, or tell if there is any way of deploying of web application on apache such that application could be accessed by customized path (that does not relate to war-file name) ?

Thanks in advance.

A: 

Take a look at the docs:

The context path of this web application, which is matched against the beginning of each request URI to select the appropriate web application for processing. All of the context paths within a particular Host must be unique. If you specify a context path of an empty string (""), you are defining the default web application for this Host, which will process all requests not assigned to other Contexts.

The value of this field must not be set except when statically defining a Context in server.xml, as it will be inferred from the filenames used for either the .xml context file or the docBase.

Georgy Bolyuba