On 11/20/2012 10:32 AM, vicky wrote:
MARK -
My client has application archives files which all have version
string in it as stated below :-
eg:- mom-1.2.0.war, mom-1.3.0.war, mom-1.4.0.war, mom-1.5.0.war
So they doest want the version string mentioned in the application
archive to become part of application context.
The context should remain same irrespective of the application
archive they deploy,
Do you have any better approach /suggestion for this requirement
thanks for your help vicky
________________________________ From: Mark Thomas
<ma...@apache.org> To: Tomcat Users List <users@tomcat.apache.org>
Sent: Tuesday, 20 November 2012 11:51 PM Subject: Re: Context root
query
On 20/11/2012 17:47, vicky wrote:
3> As i have a user requirement that they want to have a
application context as different from application archive file
name
That sounds like an x-y problem to me. What is the real user
requirement?
Mark
As has been said before:
1. Create a directory
This should be outside of the appBase for the host you're deploying on.
This should also not be in a place where a web server can serve content
(see below).
2. Add all the war files
mom-1.1.0.war
mom-1.2.3.war
mom-5.7.9.war
3. Create a mom.xml file
In the mom.xml file, have a context element. It should read something
like the following:
<Context docBase="/your-directory/mom-1.2.3.war"/>
That's it. No reloadable="true", no debug="0", no crossContext="false".
reloadable="true" is not recommended for production environments, there
is no debug attribute, and crossContext="false" is the default.
4. Place the file in the appropriate spot.
$CATALINA_BASE/conf/[hostname]/mom.xml is where it goes.
The above configuration will serve mom-1.2.3.war as context mom for that
host when accessed from Tomcat.
And no, hacking server.xml, adding a path attribute to the context.xml
file (mom.xml file), and other such games will either not work or cause
you nothing but grief.
Note on the above.
Do NOT place this war file where Apache HTTPD (or another web server)
can serve the content directly. If it's a WAR file, the user will get to
download a copy of the application. If it's an exploded WAR file
(directory, etc.) then JSP files will get served as source (most
likely), and anything in WEB-INF will be served by the web server unless
you've taken special precautions.
Just follow the instructions in the Tomcat documentation.
. . . . just my two cents.
/mde/
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org