This in not a cocoon specific issue, I think.
You can configure Tomcat to use a webapp located somewhere else that its webapps directory.
To do this you need to edit Tomcat's server.xml file located in the conf directory.
Make sure you have the following Connector enabled (it's enabled by default):
<!-- Define a non-SSL Coyote HTTP/1.1 Connector on port 8080 -->
port="8080" minProcessors="5" maxProcessors="75"
acceptCount="100" debug="0" connectionTimeout="20000"
useURIValidationHack="false" disableUploadTimeout="true" />
Then change the default Host to something like:
<!-- Define the default virtual host -->
<Host name="localhost" debug="3" appBase="C:/www/myproject/webapp"
unpackWARs="true" autoDeploy="false" liveDeploy="false">
<!-- Logger shared by all Contexts related to this virtual host. By
default (when using FileLogger), log files are created in the "logs"
directory relative to $CATALINA_HOME. If you wish, you can specify
a different directory with the "directory" attribute. Specify either a
relative (to $CATALINA_HOME) or absolute path to the desired
directory="C:/www/myproject/logs" prefix="tomcat." suffix=".log"
<!-- Define properties for each web application. This is only needed
if you want to set non-default properties, or have web application
document roots in places other than the virtual host's appBase
<!-- Default Context -->
<Context path="" docBase="" debug="3">
<!-- PersistentManager: Uncomment the section below to test Persistent
saveOnRestart: If true, all active sessions will be saved
to the Store when Catalina is shutdown, regardless of
other settings. All Sessions found in the Store will be
loaded on startup. Sessions past their expiration are
ignored in both cases.
maxActiveSessions: If 0 or greater, having too many active
sessions will result in some being swapped out. minIdleSwap
limits this. -1 or 0 means unlimited sessions are allowed.
If it is not possible to swap sessions new sessions will
This avoids thrashing when the site is highly active.
minIdleSwap: Sessions must be idle for at least this long
(in seconds) before they will be swapped out due to
0 means sessions will almost always be swapped out after
use - this will be noticeably slow for your users.
maxIdleSwap: Sessions will be swapped out if idle for this
long (in seconds). If minIdleSwap is higher, then it will
override this. This isn't exact: it is checked periodically.
-1 means sessions won't be swapped out for this reason,
although they may be swapped out for maxActiveSessions.
If set to >= 0, guarantees that all sessions found in the
Store will be loaded on startup.
maxIdleBackup: Sessions will be backed up (saved to the Store,
but left in active memory) if idle for this long (in seconds),
and all sessions found in the Store will be loaded on startup.
If set to -1 sessions will not be backed up, 0 means they
should be backed up shortly after being used.
To clear sessions from the Store, set maxActiveSessions, maxIdleSwap,
and minIdleBackup all to -1, saveOnRestart to false, then restart
Now put your cocoon stuff directly inside C:/www/myproject/webapp (no subdirectory, so the WEB-INF directory is directly under webapp) and you can access your application by calling
Hope this helps. (I've used Tomcat 4.1 for this. I'm not sure if Tomcat 5's config has changed.)
On 3-jan-2006, at 13:02, Antonio Gallardo wrote:
How could I have my Cocoon app located in a directory other than $TOMCAT_HOME/webapps/cocoon/<my-app>?
Maybe it does not fully answer your question, but hope this helps.