10 Oracle HTTP Server Custom WLST Commands

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

Use the commands listed in Table 10-1 to create, start, stop, and delete Oracle HTTP Server components in WebLogic Server domains.

Table 10-1 IOracle HTTP Server Commands

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

createOHSInstance()

Create a new instance of Oracle HTTP Server.

Online

deleteOHSInstance()

Deletes the specified Oracle HTTP Server instance.

Online

addOHSAdminProperties()

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

Online

addOHSNMProperties()

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

Online

createOHSTestDomain()

Creates a compact domain for testing or other non-production uses of Oracle HTTP Server.

Offline


10.1 Oracle HTTP Server Commands

You should use the createOHSInstance() and deleteOHSInstance() commands to create and delete Oracle HTTP Server instances instead of using the Configuration Wizard or offline WLST, as these custom commands perform additional error checking and, in the case of instance creation, automatic port assignment. The WLST commands described for Oracle HTTP Server will only work if you run the WLST implementation on $ORACLE_HOME/ohs/common/bin/.

10.1.1 createOHSInstance()

Use with WLST: Online

10.1.1.1 Description

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

10.1.1.2 Syntax

createOHSInstance(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 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.


10.1.1.3 Example

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

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

10.1.2 deleteOHSInstance()

Use with WLST: Online

10.1.2.1 Description

deleteOHSInstance() 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.

10.1.2.2 Syntax

deleteOHSInstance(instanceName='xxx')

instanceName is the only argument deleteOHSInstance() accepts.

10.1.2.3 Example

The following example deletes the Oracle HTTP Server ohs1.

deleteOHSInstance(instanceName='ohs1')

10.1.3 addOHSAdminProperties()

Use with WLST: Online

10.1.3.1 Description

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

10.1.3.2 Syntax

addOHSAdminProperties(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


10.1.3.3 Example

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

addOHSAdminProperties(logLevel = 'FINEST')

10.1.4 addOHSNMProperties()

Use with WLST: Online

10.1.4.1 Description

addOHSNMProperties() 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.

10.1.4.2 Syntax

addOHSNMProperties(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.


10.1.4.3 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.

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

10.1.5 createOHSTestDomain()

Use with WLST: Offline

10.1.5.1 Description

createOHSTestDomain() creates a compact domain for testing or other non-production uses of Oracle HTTP Server. The domain will include the template for managed Oracle HTTP Server instances. Only collocated instances are supported. This command should be issued offline, when WLST is not connected to an Administration Server instance.

10.1.5.2 Syntax

createOHSTestDomain(domainName = 'domain-name', adminAccountPass = 'password', adminServerPort = nnnn, nmAccountName = 'nm-account', nmAccountPass = 'password', nmPort = nnnn)
Argument Description
domainName

(Optional) This is the name of the compact domain being created. If this is not specified, 'base_domain' will be used.

adminAccountPass

This is the password for the administration server account.

adminServerPort

(Optional) This is the HTTP and T3 port for the administration server. If this is not specified, 7001 will be used.

nmAccountName

This is the name of the node manager account.

nmAccountPass

This is the password for the node manager account.

nmPort

(Optional) This is the port number for node manager. If this is not specified, 5556 will be used.


10.1.5.3 Example

This example creates an Oracle HTTP Server test domain called testOHS. It also sets log-in credentials for the administration server and Node Manager.

createOHSTestDomain(domainName = 'testOHS', adminAccountPass = 'welcome1', nmAccountName = 'nm', nmAccountPass = 'welcome1')