Sun Java System Web Server 7.0 Update 7 Developer's Guide to Java Web Applications

Deploying Web Applications

You can deploy a web application using either the Admin console or the command-line interface.

Procedure To Deploy Using Admin Console

Before You Begin

Select the virtual server, in which you need to deploy the web application.

  1. Access the Admin Console.

  2. Click the Add Web Application tab in the home page.

    The Add Web Application screen appears.

  3. Specify the location or package file path to upload to the Web Server.

  4. Type the URI for your web application.

    Specify the URI. This URI is the application's context root and is relative to the server host.

  5. Select JSP pre-compilation.

  6. Click OK.

    The Web Application page appears.

  7. Click Save.

  8. Click the Deployment Pending link in the top right of the screen.

    The Configuration Deployment screen displays.

  9. Click Deploy.

    The web application is deployed.

    For more information about using the Administration Console, see the Sun Java System Web Server 7.0 Update 7 Administrator’s Guide

Deploying Using wadm


Note –

Before you can manually deploy a web application, make sure that the server_root/bin directory is in your path.


You can use the wadm utility at the command line to deploy a WAR file into a virtual server web application environment as follows:

wadm [--user=admin-user] [--password-file=admin-pswd-file][--host=admin-host][--port=admin-port][--no-ssl][--rcfile=rcfile][--no-prompt][--commands-file=]filename

For more information about how to add, enable, and disable web applications, see the add-webapp(1).

The following table describes the command parameters. The left column lists the parameter, and the right column describes the parameter.

Table 9–1 Command Parameters

Parameter  

Description  

--user

Specify the user name of the authorized Web Server administrator. 

--password-file

Specify the password file. The password file contains the password to authenticate administrators to the administration server. This file must contain the line wadm_password=password. If you do not specify this option, you will be prompted for a password while executing this command.

--host

Specify the name of the machine where the administration server is running. The default host is localhost.

--port

Specify the port number of the administration server. The default non-SSL port is 8800 and the default SSL port is 8989. 

--no-ssl

Specify this option to use a plain text connection to communicate with the administration server. The default connection is SSL. 

--rcfile

Specify the name of the rcfile that has to be loaded while starting the wadm utility. rcfile can contain environment commands like set and unset, or a JACL script that needs to be run while starting wadm. The default file is ~/.wadmrc

--no-prompt

If you specify this option, wadm will prompt you for password while executing this command. Use this option if you have defined all passwords in a password file and specified the file using the --password-file option.

When you execute the wadm command, two things happen:

The following shows a sample command.

wadm add-webapp --user=admin --password-file=admin.pwd --host=serverhost --port=8989 --config=config1 --vs=config1_vs_1 --uri=/testapp /abc/sample.war

After you have deployed an application, you can access it from a browser as follows:

http://vs_urlhost[:vs_port]/uri_path/[index_page]

The following table describes the parts of the URL. )

Table 9–2 Parts of the URL

Part  

Description  

vs_urlhost

One of the urlhosts values for the virtual server.

vs_port

(Optional) Only needed if the virtual server uses a non default port. 

uri_path

The same path you used to deploy the application. This is also the context path. 

index_page

(Optional) The page in the application that end users are meant to access first. 

The following two examples show sample URLs:

http://sun.com:80/hello/index.jsp
http://sun.com/hello/