Sun GlassFish Enterprise Server v3 Administration Guide

Administering HTTP Network Listeners

The following topics are addressed here:

ProcedureTo Create an HTTP Network Listener

Use the create-http-listener subcommand or the create-network-listener subcommand in remote mode to create a listener. These subcommands provide backward compatibility and also provide a shortcut for creating network listeners that use the HTTP protocol. Behind the scenes, a network listener is created as well as its associated protocol, transport, and HTTP configuration. This method is a convenient shortcut, but it gives access to only a limited number of options. If you want to specify the full range of listener options, follow the instructions in To Create an Internet Connection.

  1. Ensure that the server is running.

    Remote subcommands require a running server.

  2. Create an HTTP network listener by using the create-network-listener(1) subcommand or the create-http-listener(1) subcommand.

  3. If needed, restart the server.

    If you edit the special HTTP network listener named admin-listener, you must restart the server for changes to take effect. See To Restart a Domain.


Example 16–9 Creating an HTTP Listener

This example creates an HTTP listener named sampleListener that uses a non-default number of acceptor threads. Security is not enabled at runtime.


asadmin> create-http-listener --listeneraddress 0.0.0.0 
--listenerport 7272 --defaultvs server --servername host1.sun.com 
--acceptorthreads 100 --securityenabled=false 
--enabled=false sampleListener
Command create-http-listener executed successfully.


Example 16–10 Creating a Network Listener

This example a network listener named sampleListener that is not enabled at runtime:


asadmin> create-network-listener --listenerport 7272 protocol http-1
--enabled=false sampleListener
Command create-network-listener executed successfully.

See Also

You can also view the full syntax and options of the subcommand by typing asadmin help create-http-listener or asadmin help create-network-listener at the command line.

ProcedureTo List HTTP Network Listeners

Use the list-http-listeners subcommand or the list-network-listeners subcommand in remote mode to list the existing HTTP listeners.

  1. Ensure that the server is running.

    Remote subcommands require a running server.

  2. List HTTP listeners by using the list-http-listeners(1) or list-network-listeners(1) subcommand.


Example 16–11 Listing HTTP Listeners

This example lists the HTTP listeners. The same output is given if you use the list-network-listeners subcommand.


asadmin> list-http-listeners
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-http-listeners or asadmin help list-network-listeners at the command line.

ProcedureTo Update an HTTP Network Listener

  1. List HTTP listeners by using the list-http-listeners(1) or list-network-listeners(1) subcommand.

  2. Modify the values for the specified listener by using the set(1) subcommand.

    The listener is identified by its dotted name.


Example 16–12 Updating an HTTP Network Listener

This example changes security-enabled to false.


asadmin> set "server.network-config.protocols.protocol.
http-listener-2.security-enabled=false"server.network-config.
protocols.protocol.http-listener-2.security-enabled=false
Command set executed successfully.

ProcedureTo Delete an HTTP Network Listener

Use the delete-http-listener subcommand or the delete-network-listener subcommand in remote mode to delete an existing HTTP listener. This disables secure communications for the listener.

  1. Ensure that the server is running.

    Remote subcommands require a running server.

  2. List HTTP listeners by using the list-http-listeners(1) subcommand.

  3. Delete an HTTP listener by using the delete-http-listener(1) or delete-network-listener(1) subcommand.

  4. To apply your changes, restart Enterprise Server.

    See To Restart a Domain.


Example 16–13 Deleting an HTTP Listener

This example deletes the HTTP listener named sampleListener:


asadmin> delete-http-listener sampleListener
Command delete-http-listener executed successfully.

See Also

You can also view the full syntax and options of the subcommand by typing asadmin help delete-http-listener or asadmin help delete-network-listener at the command line.

ProcedureTo Configure an HTTP Listener for SSL

Use the create-ssl subcommand in remote mode to create and configure an SSL element in the specified listener. This enables secure communication for the listener.

  1. Ensure that the server is running.

    Remote subcommands require a running server.

  2. Configure an HTTP listener by using the create-ssl(1) subcommand.

  3. To apply your changes, restart Enterprise Server.

    See To Restart a Domain.


Example 16–14 Configuring an HTTP Listener for SSL

This example enables the HTTP listener named http-listener-1 for SSL:


asadmin> create-ssl --type http-listener --certname sampleCert http-listener-1
Command create-ssl executed successfully.

See Also

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

ProcedureTo Delete SSL From an HTTP Listener

Use the delete-ssl subcommand in remote mode to delete the SSL element in the specified listener. This disables secure communications for the listener.

  1. Ensure that the server is running.

    Remote subcommands require a running server.

  2. Delete SSL from an HTTP listener by using the delete-ssl(1) subcommand.

  3. To apply your changes, restart Enterprise Server.

    See To Restart a Domain.


Example 16–15 Deleting SSL From an HTTP Listener

This example disables SSL for the HTTP listener named http-listener-1:


asadmin> delete-ssl --type http-listener http-listener-1
Command delete-http-listener executed successfully.

See Also

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

ProcedureTo Assign a Default Virtual Server to an HTTP Listener

tbd

  1. In the Administration Console, open the HTTP Service component under the relevant configuration.

  2. Open the HTTP Listeners component under the HTTP Service component.

  3. Select or create a new HTTP listener.

  4. Select from the Default Virtual Server drop-down list.

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

See Also

For details, click the Help button in the Administration Console from the HTTP Listeners page.