Caucho Technology
documentation
examples
changes

overview
quick start
installation
command-line
configuration
admin
amber
clustering
caching
database
deployment
ejb 3.0
embedding
filters
hessian
hmtp
ioc
jsp
logging
messaging
performance
quercus/php
remoting
scheduled tasks
security
server push
servlets
third-party
troubleshooting
virtual hosting
watchdog
webapp
xml and xslt

packaging/deployment


Resin provides a wide variety of custom packaging and deployment options.

See Also

  • web-app tags defines all of the available tags for web-app configuration.
  • host tags defines all of the available tags for host configuration.

Custom web-app with .war file

In this scenario, you want to configure a web-app with a specific root-directory and specify the location of the .war file. As usual, when Resin sees any changes in the .war file, it will expand the new data into the root-directory and restart the web-app. This capability, gives sites more flexibility where their directories and archive files should be placed, beyond the standard webapps directory.

The optional archive-path argument of the <web-app> will point to the .war file to be expanded.

web-app deployment options
ATTRIBUTEDESCRIPTIONDEFAULT
archive-pathpath to the .war file which contains the web-app's contents
dependency-check-intervalhow often Resin should check for changes in the web-app for a redeployment2s
idunique identifier for the web-app and the default context-path value
redeploy-check-intervalhow often Resin should check the .war file for changes60s
redeploy-modehow Resin should handle redeployment: automatic, lazy, or manualautomatic
root-directorypath to the expanded web-app directoryid as a sub-directory of the virtual-hosts's root
Example: resin.conf for custom web-app
<resin xmlns="http://caucho.com/ns/resin">
<cluster id="">
  <host id="">

    <web-app id="/foo" root-directory="/var/www/foo"
             archive-path="/usr/local/stage/foo.war"/>

  </host>
</cluster>
</resin>

web-app versioning

Resin can deploy multiple versions of a web-app simultaneously, simplifying any application upgrades. The old version of the web-app will continue to receive old sessions, while the new version will get the new requests. So any user will see a consistent version as the web site update occurs with no downtime required.

The versioning requires <web-app-deploy>, i.e. it works with the webapps directory. The versioning is numerically-based, allowing dotted notation, to determine the most recent version. A simple deployment process might use foo-101 to upgrade from foo-100. A more complicated one might use foo-10.3.14 to upgrade from foo-10.3.13.

The versioning attribute of the <web-app-deploy> enables versioning:

Example: resin.conf for webapps versioning
<resin xmlns="http://caucho.com/ns/resin">
<cluster id="">
<host id="">

  <web-app-deploy path="webapps" versioning="true"/>

</host>
</cluster>
</resin>

Deploying to a live server without interruption

It may be possible to deploy a web application to a live server without interruption to service if certain conditions are met.

  1. The session objects for your users are being persisted.
  2. The usage of session scoped objects between the old version and the new is compatible.
  3. The usage of application scoped objects between the old version and the new is compatible.
  4. Database schema changes are not required.

Resin allows you to have a backup instance running. The idea is that this backup instance of Resin takes over if your primary Resin instance goes down.

If you are using a load balancer to distribute your load to multiple primary servers, each primary server has a backup server.

You can use this feature to deploy to a live server without interruption of service.

  1. shutdown primary server(s) (backup server(s) takes over)
  2. deploy new war to primary server(s)
  3. start primary server(s). As soon as the primary server starts, the user will be using the new version of the application.
  4. deploy new war to backup server(s)

JSP Precompilation

See JSP/Compilation.


Copyright © 1998-2008 Caucho Technology, Inc. All rights reserved.
Resin ® is a registered trademark, and Quercustm, Ambertm, and Hessiantm are trademarks of Caucho Technology.