Webapps-style war deployment
From Resin 3.0
This article requires cleanup and may refer to a legacy version of Resin.
Please visit http://www.caucho.com/documentation/ for the most up-to-date documentation. |
When you have a single virtual host with multiple web-apps, you can use Resin's <web-app-deploy> tag to configure a webapps/ directory where all *.war files will be expanded.
When you add a new foo.war in webapps/foo.war, Resin will expand the archive into webapps/foo and serve the web-app in that directory. You can also create the webapps/foo directory without a .war file, or you can deploy the .war using Resin's deploy service, either through the /resin-admin, on the command-line or remotely.
The new webapps will share the behavior configured by the <web-app-default> tag. Essentially, the <web-app-default> acts as an include file where all the contents are evaluated for each webapp.
resin.web for webapps/
In the following configuration, the webapps are deployed in /var/www/webapps, the default virtual host serves all requests and there is a single cluster and single server in the cluster. When you need new servers, you can add <server> tags to the cluster.
<resin xmlns="http://caucho.com/ns/resin"> xmlns:resin="urn:java:com.caucho.resin"> <root-directory>/var/www</root-directory> <cluster id=""> <resin:import path="${__DIR__}/app-default.xml"/> <server id="" port="6800"> <http port="80"/> <user-name>resin</user-name> <group-name>resin</group-name> </server> <host id=""> <access-log path="log/access.log"/> <web-app-default path="webapps/"/> </host> </cluster> </resin>
- The root of the server is /var/www
- The configuration uses the default cluster and a single server listening to port 80
- For security, the user is "resin" instead of root
- The default virtual host has an access log in log/access.log
- The web-apps are served out of the /var/www/webapps directory, as configured by web-app-default