JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
Oracle GlassFish Server 3.1 Administration Guide
search filter icon
search icon

Document Information

Preface

1.  Overview of GlassFish Server Administration

Default Settings and Locations

Configuration Tasks

Administration Tools

Instructions for Administering GlassFish Server

Part I Runtime Administration

2.  General Administration

3.  Administering Domains

4.  Administering the Virtual Machine for the Java Platform

5.  Administering Thread Pools

6.  Administering Web Applications

7.  Administering the Logging Service

8.  Administering the Monitoring Service

9.  Writing and Running JavaScript Clients to Monitor GlassFish Server

10.  Administering Life Cycle Modules

11.  Extending and Updating GlassFish Server

Part II Resources and Services Administration

12.  Administering Database Connectivity

13.  Administering EIS Connectivity

14.  Administering Internet Connectivity

About Internet Connectivity

About HTTP Network Listeners

About Virtual Servers

Administering HTTP Network Listeners

To Create an Internet Connection

Administering HTTP Protocols

To Create a Protocol

To List Protocols

To Delete a Protocol

Administering HTTP Configurations

To Create an HTTP Configuration

To Delete an HTTP Configuration

Administering HTTP Transports

To Create a Transport

To List Transports

To Delete a Transport

Administering HTTP Network Listeners

To Create an HTTP Network Listener

To List HTTP Network Listeners

To Update an HTTP Network Listener

To Delete an HTTP Network Listener

To Configure an HTTP Listener for SSL

To Delete SSL From an HTTP Listener

To Assign a Default Virtual Server to an HTTP Listener

Administering Virtual Servers

To Create a Virtual Server

To List Virtual Servers

To Update a Virtual Server

To Delete a Virtual Server

To Assign a Default Web Module to a Virtual Server

To Assign a Virtual Server to an Application or Module

To Set JSESSIONIDSSO Cookie Attributes

15.  Administering the Object Request Broker (ORB)

16.  Administering the JavaMail Service

17.  Administering the Java Message Service (JMS)

18.  Administering the Java Naming and Directory Interface (JNDI) Service

19.  Administering Transactions

Part III Appendixes

A.  Subcommands for the asadmin Utility

Index

Administering Virtual Servers

A virtual server is a virtual web server that serves content targeted for a specific URL. Multiple virtual servers can serve content using the same or different host names, port numbers, or IP addresses. The HTTP service directs incoming web requests to different virtual servers based on the URL.

When you first install GlassFish Server, a default virtual server is created. You can assign a default virtual server to each new HTTP listener you create.

Web applications and Java EE applications containing web components (web modules) can be assigned to virtual servers during deployment. A web module can be assigned to more than one virtual server, and a virtual server can have more than one web module assigned to it. If you deploy a web application and don't specify any assigned virtual servers, the web application is assigned to all currently defined virtual servers. If you then create additional virtual servers and want to assign existing web applications to them, you must redeploy the web applications. For more information about deployment, see the Oracle GlassFish Server 3.1 Application Deployment Guide.

You can define virtual server properties using the asadmin set command. For example:

asadmin> set server-config.http-service.virtual-server.MyVS.property.sso-enabled="true"

Some virtual server properties can be set for a specific web application. For details, see glassfish-web-app in Oracle GlassFish Server 3.1 Application Deployment Guide.

The following topics are addressed here:

To Create a Virtual Server

By default, when GlassFish Server starts, the following virtual servers are started automatically:

In a production environment, additional virtual servers provide hosting facilities for users and customers so that each appears to have its own web server, even though there is only one physical server.

Use the create-virtual-server subcommand in remote mode to create the named virtual server.

Before You Begin

A virtual server must specify an existing HTTP listener. Because the virtual server cannot specify an HTTP listener that is already being used by another virtual server, create at least one HTTP listener before creating a new virtual server.

  1. Ensure that the server is running.

    Remote subcommands require a running server.

  2. Create a virtual server by using the create-virtual-server(1) subcommand.

    Information about properties for this subcommand is included in this help page.

  3. To apply your changes, restart GlassFish Server.

    See To Restart a Domain.

Example 14-16 Creating a Virtual Server

This example creates a virtual server named sampleServer on localhost.

asadmin> create-virtual-server sampleServer
Command create-virtual-server executed successfully.

See Also

You can also view the full syntax and options of the subcommand by typing asadmin help create-virutal-server at the command line.

To List Virtual Servers

Use the list-virtual-servers subcommand in remote mode to list the existing virtual servers.

  1. Ensure that the server is running.

    Remote subcommands require a running server.

  2. List virtual servers by using the list-virtual-servers(1) subcommand.

Example 14-17 Listing Virtual Servers

This example lists the virtual servers for localhost.

asadmin> list-virtual-servers
sampleListener
admin-listener
http-listener-2
http-listener-1
Command list-http-listeners executed successfully.

See Also

You can also view the full syntax and options of the subcommand by typing asadmin help list-virutal-servers at the command line.

To Update a Virtual Server

  1. List virtual servers by using the list-virtual-servers(1) subcommand.
  2. Modify the values for the specified virtual server by using the set(1) subcommand.

    The virtual server is identified by its dotted name.

To Delete a Virtual Server

Use the delete-virtual-server subcommand in remote mode to delete an existing virtual server.

  1. Ensure that the server is running.

    Remote subcommands require a running server.

  2. List virtual servers by using the list-virtual-servers(1) subcommand.
  3. If necessary, notify users that the virtual server is being deleted.
  4. Delete a virtual server by using the delete-virtual-server(1) subcommand.
  5. To apply your changes, restart GlassFish Server.

    See To Restart a Domain.

Example 14-18 Deleting a Virtual Server

This example deletes the virtual server named sampleServer from localhost.

asadmin> delete-virtual-server sampleServer
Command delete-virtual-server executed successfully.

See Also

You can also view the full syntax and options of the subcommand by typing asadmin help delete-virutal-server at the command line.

To Assign a Default Web Module to a Virtual Server

A default web module can be assigned to the default virtual server and to each new virtual server. To access the default web module for a virtual server, point the browser to the URL for the virtual server, but do not supply a context root. For example:

http://myvserver:3184/

A virtual server with no default web module assigned serves HTML or JavaServer Pages (JSP) content from its document root, which is usually domain-dir/docroot. To access this HTML or JSP content, point your browser to the URL for the virtual server, do not supply a context root, but specify the target file.

For example:

http://myvserver:3184/hellothere.jsp

To Assign a Virtual Server to an Application or Module

You can assign a virtual server to a deployed application or web module.

Before You Begin

The application or module must already be deployed. For more information, see Oracle GlassFish Server 3.1 Application Deployment Guide.

  1. In the Administration Console, open the HTTP Service component under the relevant configuration.
  2. Open the Virtual Servers component under the HTTP Service component.
  3. Select the virtual server to which you want to assign a default web module.
  4. Select the application or web module from the Default Web Module drop-down list.

    For more information, see To Assign a Default Web Module to a Virtual Server.

To Set JSESSIONIDSSO Cookie Attributes

Use the sso-cookie-http-only and sso-cookie-secure virtual server attributes to set the HttpOnly and Secure attributes of any JSESSIONIDSSO cookies associated with web applications deployed to the virtual server.