Deploy
Links
Context
To deploy an application outside of the webapps
folder, extract the war
file or copy the exploded application to a folder. In this example the folder
is:
C:\deploy\myfaces-template\
Create new folders inside the conf
folder of Tomcat. In this example the
folder names are:
conf\Catalina\localhost\
The folder names are from two places:
The
Engine name
fromconf/server.xml
(I think).The host name. In this example
localhost
.
Inside this folder create an XML file to hold the context (web application).
In this example the file is called myfaces-template.xml
. Here are the
contents of a typical (Tomcat 6) file:
<Context
cachingAllowed="true"
cookies="true"
privileged="false"
docBase="c:/deploy/myfaces-template"
reloadable="true"
swallowOutput="false"
useNaming="true">
<Valve
className="org.apache.catalina.valves.AccessLogValve"
directory="c:/deploy/myfaces-template/logs"
prefix="localhost_access_log."
suffix=".txt"
pattern="common"
/>
</Context>
For Tomcat 5 you will probably need to add the path
attribute.
|
The cache for static resources will be used |
|
If you want cookies to be used for session identifier communication |
|
For Tomcat 6 (see Issues):
The value of this field must not be set except when statically defining
a Context in |
|
Set to true to allow this context to use container servlets, like the manager servlet. |
|
The Document Base (also known as the Context Root) directory for this web application, or the pathname to the web application archive file (if this web application is being executed directly from the WAR file). You may specify an absolute pathname for this directory or WAR file, or a pathname that is relative to the appBase directory of the owning Host. |
|
Set to true if you want Catalina to monitor classes in
|
|
If the value of this flag is true, the bytes output to |
|
Set to true to have Catalina enable a JNDI |
|
A |
See Issues for details of an error which occurs when the path
attribute is missing.
Permissions
From:
http://www.springframework.org/docs/MVC-step-by-step/Spring-MVC-step-by-step-Part-1.html
If you are on a system where you are not the owner of the Tomcat install, then the Tomcat owner must either grant you full access to the webapps directory or the owner must create a new directory named ‘springapp’ in the ‘webapps’ directory of the Tomcat installation, and also give you full rights to deploy to this newly created directory.
On Linux I run the command:
chmod a+rwx springapp
to give everybody full rights to this directory.