A Oracle HTTP Server WLST Custom Commands

There are specific WLST Server commands for managing Oracle HTTP Server in WebLogic Server domains. Most are online commands, which require a connection between WLST and Administration Server for the domain.

This appendix contains information on Oracle HTTP Server specific WLST commands:

Getting Help on Oracle HTTP Server WLST Custom Commands

Online help is available for Oracle HTTP Server WLST custom commands.

To get online help, enter help('manageohs') from the WLST command line and it will display all the of the WLST custom commands for Oracle HTTP Server.

To get help for specific WLST custom commands, enter help('custom_command_name') from the WLST command line, for example:

help('ohs_createInstance')

Using WLST Online Commands

Perform the following steps before you use WLST online commands:
  1. Open the CLI and launch WLST using the following command:
    • (Linux/UNIX) $ORACLE_HOME/oracle_common/common/bin/wlst.sh
    • (Windows) $ORACLE_HOME\oracle_common\common\bin\wlst.cmd
  2. Connect to the Admin Server of the Domain.
    For more information about connecting to Admin Server, see connect section in WLST Command Reference for Oracle WebLogic Server.
  3. Run the custom OHS WLST online command with the recommended arguments as shown in the following example:
    ohs_createInstance(instanceName='xxx', machine='yyy', serverName='zzz', ...)

Oracle HTTP Server Commands

Use the ohs_createInstance and ohs_deleteInstance commands to create and delete Oracle HTTP Server instances instead of using the Configuration Wizard. These custom commands perform additional error checking and assign ports automatically in the case of instance creation.

The WLST custom commands listed in Table A-1 manage Oracle HTTP Server instances in WebLogic Server domains.

Table A-1 Oracle HTTP Server Commands

Use this command... To... Use with WLST...

ohs_addAdminProperties

Add the LogLevel property to Oracle HTTP Server Administration server property file.

Online

ohs_addNMProperties

Add a property to the Oracle HTTP Server Node Manager plug-in property file.

Online

ohs_createInstance

Create a new instance of Oracle HTTP Server.

Online

ohs_deleteInstance

Delete the specified Oracle HTTP Server instance.

Online

ohs_exportKeyStore

Exports the keyStore to the specified Oracle HTTP Server instance.

Online

ohs_updateInstances

Creates a keystore in the KSS database in the case where Oracle HTTP Server instances were created using Configuration Wizard.

Online

ohs_addAdminProperties

The ohs_addAdminProperties command adds the LogLevel property to Oracle HTTP Server Administration server property file (ohs_admin.properties); LogLevel is the only parameter ohs_addAdminProperties currently supports. This command is available when WLST is connected to an Administration Server instance.

Use with WLST: Online

Syntax

ohs_addAdminProperties(logLevel = 'value')
Argument Description

LogLevel

The granularity of information written to the log. The default is INFO. The following other values are accepted:

  • ALL

  • CONFIG

  • FINE

  • FINER

  • FINEST

  • OFF

  • SEVERE

  • WARNING

Example

This example creates a log file when log level is set to FINEST.

ohs_addAdminProperties(logLevel = 'FINEST')

ohs_addNMProperties

Use with WLST: Online

Description

The ohs_addNMProperties command adds a property to the Oracle HTTP Server Node Manager plug-in property file (ohs_nm.properties). This command is available when WLST is connected to an Administration Server instance.

Syntax

ohs_addNMProperties(logLevel = 'value', machine='node-manager-machine-name')
Argument Description

LogLevel

The granularity of information written to the log. The default is INFO; other values accepted are:

  • ALL

  • CONFIG

  • FINE

  • FINER

  • FINEST

  • OFF

  • SEVERE

  • WARNING

machine

The name of the machine on which Node Manage is running.

Example

This example creates a log file with name ohs_nm.log under the path <domain_dir>/system_components/OHS with log level is set to FINEST on the target machine, my_NM_machine. The user need not restart Node Manager.

ohs_addNMProperties(logLevel = 'FINEST', machine = 'my_NM_machine')

ohs_createInstance

Use with WLST: Online

Description

The ohs_createInstance command creates a new instance of Oracle HTTP Server, allowing critical configuration such as listening ports to be specified explicitly or assigned automatically.

Syntax

ohs_createInstance(instanceName='xxx', machine='yyy', serverName='zzz', ...)
Argument Definition

instanceName

The name of the managed instance being created.

machine

The existing machine entry for the instance. This name (often <hostName>.myCorp.com) is set during creation of the WebLogic Server Domain. If you forget the name, you can check $ORACLE_INSTANCE/config/config.xml and look for the <machine> block. Alternately, in WLST you can find the machine name by running:

serverConfig()
cd('Machines')
ls()

listenPort

(Optional) The port number of the non-SSL server. If this value is not specified, a port is automatically assigned. Listen ports typically begin at 7777 and go up from there.

sslPort

(Optional) The port number of the SSL virtual host. If this value is not specified, a port is automatically assigned. SSL ports typically start at 4443 and go up from there.

adminPort

(Optional) The port number used for communication with Node Manager. If this value is not specified, a port is automatically assigned. Administration ports typically begin at 9999 and go up from there.

serverName

(Optional) The value of the ServerName directive of the non-SSL server. If this value is not specified, the host name of the machine and the listen port will be used to construct the value.

Example

The following example creates an Oracle HTTP Server instance called ohs1 that runs on the machine abc03.myCorp.com:

ohs_createInstance(instanceName='ohs1', machine='abc03.myCorp.com')

ohs_deleteInstance

Use with WLST: Online

Description

The ohs_deleteInstance command deletes a specified Oracle HTTP Server instance. The instance must be stopped before you can delete it. This command will return an error if the instance is in the UNKNOWN or RUNNING state.

Syntax

ohs_deleteInstance(instanceName='xxx')

instanceName is the name of the Oracle HTTP Server instance.

Example

The following example deletes the Oracle HTTP Server instance ohs1.

ohs_deleteInstance(instanceName='ohs1')

ohs_exportKeyStore

Use with WLST: Online

Description

The ohs_exportKeyStore command exports the keystore to the specified Oracle HTTP Server instance location. This command is available when WLST is connected to an Administration Server instance. For more information on how to use this command, see Exporting the Keystore to an Oracle HTTP Server Instance Using WLST.

Syntax

ohs_exportKeyStore(keyStoreName='<keyStoreName>', instanceName = '<instanceName>')
Argument Description

keyStoreName

The name of the keystore.

instanceName

The name of the Oracle HTTP Server instance.

Naming Conventions for Keystores

The keystore name (keyStoreName) must start with the string: <instanceName>_.

For example, presume that the keystore must be exported to an Oracle HTTP Server instance named ohs1. Then the names of all of the keystores that must be exported to ohs1 must start with ohs1_.

If this syntax is not followed while creating the keystore, then the export of the keystore might not be successful.

Example

This example exports the keystore ohs1_myKeystore to the Oracle HTTP Server instance ohs1.

ohs_exportKeyStore(keyStoreName='ohs1_myKeystore', instanceName = 'ohs1')

ohs_updateInstances

Use with WLST: Online

Description

The ohs_updateInstances command is available only when WLST is connected to an Administration Server instance. It will parse across all of the Oracle HTTP Server instances in the domain and perform the following tasks:

  • Create a new keystore with the name <instanceName>_default if one does not exist.

  • Put a demonstration certificate, demoCASignedCertificate, in the newly created keystore.

  • Export the keystore to the instance location.

This command is to be used after an Oracle HTTP Server instance is created using Configuration Wizard in collocated mode only. See Associating Oracle HTTP Server Instances With a Keystore Using WLST.

Syntax

ohs_updateInstances()

This command does not take any arguments.

Example

ohs_updateInstances()