A Oracle HTTP Server WLST Custom Commands

The following Oracle HTTP Server-specific WLST custom commands are provided for managing the server in WebLogic Server domains. Most are online commands, which require a connection between WLST and the administration server for the domain:

This appendix contains the following information:

A.1 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')

A.2 Names of WLST Custom Commands Have Changed

For ease of use and greater visibility, the names of the following Oracle HTTP Server WLST custom commands have been changed in the current release. Instead of incorporating "OHS" in the command name, the command is now prefixed with "ohs_". For example, the createOHSInstance command becomes ohs_createInstance. The old command names are deprecated. They will be accepted by WLST in the current release, but you should avoid using them. If you use one of the old command names, you will receive a message saying that the name is deprecated and containing a pointer to the new command.

The following table lists the old and new command names.

Table A-1 Old and New Names of Oracle HTTP Server WLST Custom Commands

Old Name (deprecated) New Name

addOHSAdminProperties

ohs_addAdminProperties

addOHSNMProperties

ohs_addNMProperties

createOHSInstance

ohs_createInstance

deleteOHSInstance

ohs_deleteInstance


A.3 Oracle HTTP Server Commands

You should 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, in the case of instance creation, automatic port assignment.

Use the WLST custom commands listed in Table A-2 to manage Oracle HTTP Server instances in WebLogic Server domains.

Table A-2 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_postUpgrade

Import the contents of wallet for all of the Oracle HTTP Server instances (valid for those Oracle HTTP Server instances which have been upgraded from a previous version) in the domain to the KSS database.

Online

ohs_updateInstances

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

Online


A.3.1 ohs_addAdminProperties

Use with WLST: Online

Description

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.

Syntax

ohs_addAdminProperties(logLevel = 'value')
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


Example

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

ohs_addAdminProperties(logLevel = 'FINEST')

A.3.2 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')

A.3.3 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>.us.oracle.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')

A.3.4 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')

A.3.5 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 Section 5.3.3, "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')

A.3.6 ohs_postUpgrade

Use with WLST: Online

Description

Use the ohs_postUpgrade command after you have upgraded from a previous version of Oracle HTTP Server to release 12c (12.2.1).

Prior to release 12c (12.2.1), Oracle HTTP Server instances/components used wallets without KSS integration. If you use the Upgrade Assistant to upgrade to 12c (12.2.1), the existing wallet contents must be imported to the KSS database for further management.

The ohs_postUpgrade command parses across all of the Oracle HTTP Server instances in the domain and imports their wallets to the KSS database if an entry does not already exist in the database for the same keystore name. This command is available only when WLST is connected to an Administration Server instance. For more information on using this command, see Section 1.7, "Upgrading from Earlier Releases of Oracle HTTP Server" and Section 5.3.4, "Importing Wallets to the KSS Database after an Upgrade Using WLST."

Syntax

ohs_postUpgrade()

This command does not take any arguments.

Example

ohs_postUpgrade()

A.3.7 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. For more information on using this command, see Section 5.3.5, "Associating Oracle HTTP Server Instances With a Keystore Using WLST."

Syntax

ohs_updateInstances()

This command does not take any arguments.

Example

ohs_updateInstances()