1. Overview of GlassFish Server Administration
Default Settings and Locations
Instructions for Administering GlassFish Server
4. Administering the Virtual Machine for the Java Platform
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
Administering HTTP Network Listeners
To Create an Internet Connection
Administering HTTP Configurations
To Create an HTTP Configuration
To Delete an HTTP Configuration
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
To Assign a Default Web Module to a Virtual Server
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
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:
By default, when GlassFish Server starts, the following virtual servers are started automatically:
A virtual server named server, which hosts all user-defined web modules.
For development, testing, and deployment of web services in a non-production environment, server is often the only virtual server required.
A virtual server named __asadmin, which hosts all administration-related web modules (specifically, the Administration Console). This server is restricted, which means that you cannot deploy web modules to this virtual server.
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.
Remote subcommands require a running server.
Information about properties for this subcommand is included in this help page.
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.
Use the list-virtual-servers subcommand in remote mode to list the existing virtual servers.
Remote subcommands require a running server.
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.
The virtual server is identified by its dotted name.
Use the delete-virtual-server subcommand in remote mode to delete an existing virtual server.
Remote subcommands require a running 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.
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
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.
For more information, see To Assign a Default Web Module to a Virtual Server.
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.
The values supported for these attributes are as follows:
A boolean value that specifies whether the HttpOnly attribute is included in JSESSIONIDSSO cookies. When set to true, which is the default, the HttpOnly attribute is included. When set to false, the HttpOnly attribute is not included.
A string value that specifies whether the Secure attribute is included in JSESSIONIDSSO cookies. Allowed values are as follows:
true — The Secure attribute is included.
false — The Secure attribute is not included.
dynamic — The Secure attribute setting is inherited from the first session participating in SSO. This is the default value.