Using auto-deployment, you can quickly deploy one or more web applications just by copying them to a designated directory. The server auto-deploys web applications that are in the form of web archives (.war files) or in a directory in which a web archive has been exploded.
The following table illustrates the correlation between the name of the web archive or directory and the context path at which the application is automatically deployed.
Web Application |
Format |
Context Path |
---|---|---|
instance_dir/auto-deploy/hello.war |
Web Archive |
/hello |
instance_dir/auto-deploy/test |
Directory |
/test |
instance_dir/auto-deploy/my_app.war |
Web Archive |
/my_app |
Auto-deployment does not require the administration server to be up and running. Web applications that are auto-deployed are accessible on all the active virtual servers that have been configured in the server. Auto-deployment is intended for use in a development environment.
During startup, the web applications for server.xml are deployed before any of the web applications in the auto-deploy directory.
Copy the web application (.war file or directory) to the following directory:
instance_dir/auto-deploy
where, instance_dir is the path to the installation directory of this server instance.
Start the instance. If the instance is already running, type the reconfig command:
instance_dir/bin/reconfig
All web applications in the instance_dir/auto-deploy directory are automatically deployed to all the virtual servers in the instance.
Delete the corresponding .war file or sub-directory in the directory:
instance_dir/auto-deploy
Start the instance. If the instance is already running, type the reconfig command:
instance_dir/bin/reconfig
The deleted web applications are no longer accessible.
You can also configure the server to periodically check the instance_dir/auto-deploy directory, for new or removed applications and automatically reflect these changes in the running instance. The dynamic-reload-interval attribute controls how often the server checks the auto-deploy directory for changes.
For information on how to set the dynamic-reload-interval attribute through Admin console, see Dynamic Reloading of Web Applications. For information on how to set the dynamic-reload-interval attribute through CLI, see set-servlet-container-prop(1).