You can deploy a web application to any existing virtual server.
Identify a virtual server where you will need to deploy the web application.
Be sure you have either the web application archive (.war file) or know the web application path in the server.
Web applications can be deployed through wadm, Administration Console and other supported IDEs.
To deploy a web application, click Server Configuration and then click the Virtual Servers tab.
Select the virtual server in which you will need to deploy the web application.
Click the Web Applications tab > New button.
Specify the web application package.
If you need to upload a web application archive, click the Browse button and select the archive. Optionally, you can also specify a web application archive located in the server.
Specify the URI for your web application. The URL will be the applications context root and is relative to the server host.
Provide a short description about the web application.
Enable/Disable JSP Pre-compilation.
Enabling this directive will allow all the JSPs present in the web application to be pre-compiled to improve performance.
Enable the application.
When a web application state is set to be Disabled, it will not be available on request. However you can toggle this option anytime without redeploying the application to the instances.
Deploy the application.
Click Deploy to deploy the web application.
You can access the application with the context root specified. E.g. http://<your-server>:<port>/<URI>
Using CLI
wadm> add-webapp --user=admin --password-file=admin.passwd --host=localhost --port=8888 --config=config1 --vs=HOSTNAME --uri=/hello /home/test/hello.war |
See CLI Reference, add-webapp(1).
For large web applications, exploding the application's WAR file outside Web Server's installation directory improves Admin Server's performance. To add the web application to Web Server, use the --file-on-server option and specify the path to the application's exploded WAR file as the warfile operand.
A WAR file can be exploded on the administration server host machine, and the path to the exploded WAR file can be provided as the warfile operand to the add-webapp(1) command using the --file-on-server option; for example:
wadm> add-webapp --user=admin-user --password-file=admin.passwd --port=8989 --vs=vs1 --config=config1 --file-on-server --uri=/mywebapp /space/tmp/mywebapp |
The administration server does not keep track of the files under the web application in this case because it is located outside the instance server's installation directory. Instead, you must manage the web application manually. Removal of the application using admin interfaces removes it from server.xml, but does not remove any of the files under the web application.
If another version of the web application is exploded into a different outside directory, you can specify the new path using the Update button in the Admin Console page on web applications.
To pre-compile JSPs in a web application while deploying the web application, execute the command with –precompilejsp option as given below:
wadm> add-webapp --user=admin-user --password-file=admin.passwd --port=8989 --vs=vs1 --config=config1 --file-on-server --uri=/mywebapp --precompilejsp mywebapp.war |