![]() | Resin Documentation | home company blog wiki docs app server web server health cloud java ee pro | ![]() |
deployment from the command-line
.war files can be deployed to a cluster using the Resin command-line. The uploaded file will be distributed to all Resin servers. For security reasons, Resin's deployment must be enabled in the resin.xml. The default behavior is to disable deployment. The configuration has four requirements:
Example: minimal resin.xml for deployment
<resin xmlns="http://caucho.com/ns/resin"
xmlns:resin="urn:java:com.caucho.resin">
<cluster id="app-tier">
<resin:AdminAuthenticator password-digest="none">
<user name="foo" password="test"/>
</resin:AdminAuthenticator>
<resin:RemoteAdminService/>
<resin:DeployService/>
<server id="" port="6800">
<http port="8080"/>
</server>
<host id="">
<web-app-deploy path="webapps"
expand-preserve-fileset="WEB-INF/work/**"/>
</host>
</cluster>
</resin>
deploy for default hostThe "deploy" command deploys a .war file to the default virtual host. Since the AdminAuthenticator requires a user and password, you'll need to pass those arguments as well. Example: deploy hello.war
unix> bin/resin.sh deploy hello.war \
-user foo -password test
undeploy for default hostThe "undeploy" command removes a .war from the default virtual host. Since the AdminAuthenticator requires a user and password, you'll need to pass those arguments as well. Example: undeploy hello
unix> bin/resin.sh undeploy hello \
-user foo -password test
deploy with specified hostThe "deploy" command allows a "-host" argument to specify a virtual host. Example: deploy www.example.com hello.war
unix> bin/resin.sh deploy -host www.example.com hello.war \
-user foo -password test
undeploy for www.example.comThe "undeploy" command removes a .war from the virtual host. Example: undeploy www.example.com hello
unix> bin/resin.sh undeploy -host www.example.com hello \
-user foo -password test
Command line deployment capabilities were introduced in Resin 4.0.14. The set of commands allows deploying, undeploying, listing applications deployed on the server and controlling application lifecycle. Synopsis of the provided commands and options
deploying applicationDeploying an application is done with a bin/resin.sh [-conf <file>] deploy [options] <war-file> deploying an application from a hello-world.war archive unix> bin/resin.sh deploy -user admin -password secret /projects/hello-world/hello-world.war Deployed production/webapp/default/hello-world as hello-world.war to http://127.0.0.1:8080/hmtp
listing deployed applicationsListing deployed applications is done with a bin/resin.sh [-conf <file>] deploy-list [options] unix> bin/resin.sh deploy-list -user admin -password secret production/webapp/default/hello-world copy application from context '/hello-world' to context '/foo'Copying an applicaiton is done with a bin/resin.sh [-conf <file>] deploy-copy [options] bin/resin.sh deploy-copy -user admin -password secret -source hello-world -target foo copied production/webapp/default/hello-world to production/webapp/default/foo
undeploying applicationUndeploying an application is done with an bin/resin.sh [-conf <file>] undeploy [options] <name> unix> bin/resin.sh undeploy -user admin -password secret undeploy foo Undeployed foo from http://127.0.0.1:8080/hmtp
starting applicationStarting an application is done with a unix> bin/resin.sh [-conf <file>] start-webapp [options] <name> start web application deployed at context '/foo' unix> bin/resin.sh start-webapp -user admin -password secret foo 'production/webapp/default/foo' is started
stopping applicationStopping an application is done with an bin/resin.sh [-conf <file>] stop-webapp [options] <name> stop web application deployed at context '/foo' unix> bin/resin.sh stop-webapp -user admin -password secret foo 'production/webapp/default/foo' is stopped
restarting applicationRestarting an application is done with an bin/resin.sh [-conf <file>] restart-webapp [options] <name> stop web application deployed at context '/foo' unix> bin/resin.sh restart-webapp -user admin -password secret foo 'production/webapp/default/foo' is restarted
|