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

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/