To run Oracle HTTP Server, create and manage an Oracle HTTP Server instance in a WebLogic or standalone environment.
This chapter describes how to create an instance, perform basic Oracle HTTP Server tasks, and remotely administer Oracle HTTP Server. It includes the following sections:
Before running Oracle HTTP Server, there are prerequisite tasks that are to be completed. These tasks include installing and configuring the server, and starting WebLogic Server and Node Manager.
The Configuration Wizard enables you to simultaneously create multiple Oracle HTTP Server instances when you create a domain.
If you are creating a WebLogic Server Domain (Full or Restricted JRF domain types), you are not required to create any instances. If you elect not to create any instances, a warning appears; however, you are allowed to proceed with the configuration process.
If you are creating a standalone domain, an Oracle HTTP Server instance is created by default.
This section contains the following information:
Creating an Oracle HTTP Server Instance in a WebLogic Server Domain
Creating an Oracle HTTP Server Instance in a Standalone Domain
Note:
If you are attempting to create an Oracle HTTP Server instance that uses a TCP port in the reserved range (typically less than 1024), then you must perform some extra configuration to allow the server to bind to privileged ports. See Starting Oracle HTTP Server Instances on a Privileged Port (UNIX Only).
You can create a managed Oracle HTTP Server instance in a WebLogic Server Domain by using either the WLST custom command ohs_createInstance()
or from Fusion Middleware Control installed as part of a Oracle Fusion Middleware infrastructure. The following sections describe these procedures.
Note:
If you are working with a WebLogic Server Domain, it is recommended to use the Oracle HTTP Server WLST custom commands as described in Administering Oracle HTTP Server Using WLST. These commands offer superior error checking, provide automatic port management, and so on.
You can create an Oracle HTTP Server instance in a WebLogic Server Domain by using WLST. Follow these steps.
Note:
For information about using the WebLogic Scripting Tool (WLST), see Understanding the WebLogic Scripting Tool.
After using the Configuration Wizard to create Oracle HTTP Server instances in collocated mode, use the ohs_updateInstances
WLST custom command to associate the instances with a keystore.
This command 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.
See ohs_updateInstances.
To associate Oracle HTTP Server instances with a keystore:
You can create an Oracle HTTP Server instance in a WebLogic Server Domain by using Fusion Middleware Control installed as part of the Oracle Fusion Middleware infrastructure. Follow these steps.
After creating the instance, the Column on the OHS Instances page shows a down-arrow for that instance.
This indicates that the instance is not running. For instructions on starting an instance, see Starting Oracle HTTP Server Instances. Once started, the arrow will point up.
Once an instance is created, it will be provisioned within the DOMAIN_HOME.
The master (staging) copy will be in:
DOMAIN_HOME/config/fmwconfig/components/OHS/componentName
The runtime will be in:
DOMAIN_HOME/config/fmwconfig/components/OHS/instances/componentName
Node Manager must be running to provision an instance in runtime.
Immediately after creation, the state reported for an Oracle HTTP Server instance will vary depending on how the instance was created:
If ohs_createInstance()
was used, the reported state for the instance will be SHUTDOWN.
If the Configuration Wizard was used, the reported state for the instance will be UNKNOWN.
If you select Standalone as your domain during server configuration, the Configuration Wizard will create the domain, and during this process an Oracle HTTP Server instance will also be created. See Installing and Configuring Oracle HTTP Server.
You can use WLST or Fusion Middleware Control to perform basic Oracle HTTP Server administration tasks.
For detailed information on the process ID (PID) file, and how to use WLST or Fusion Middleware Control to perform basic administration tasks, see the following tasks:
The process ID can be used by the administrator when restarting and terminating the daemon. If a process stops abnormally, it is necessary to stop the httpd
child processes using the kill
command. You must not change the default PID file name or its location.
When Oracle HTTP Server starts, it writes the process ID (PID) of the parent httpd
process to the httpd.pid file located in the following directory:
DOMAIN_HOME/servers/<componentName>/logs
The PidFile
directive in httpd.conf specifies the location of the PID file; however, you should never modify the value of this directive.
See Also:
PidFile directive in the Apache HTTP Server documentation.
This section contains information on how to start Oracle HTTP Server using Fusion Middleware Control and WLST.
Note:
On the Windows platform, Oracle HTTP Server requires Microsoft Visual C++ run-time libraries to be installed on the system to function. See Installing and Configuring Oracle HTTP Server.
This section includes the following topics:
In Fusion Middleware Control, you start the Oracle HTTP Server from the Oracle HTTP Server home page. Navigate to the HTTP Server home page and do one of the following:
From the Oracle HTTP Server menu:
Select Control.
Select Start Up from the Control menu.
From the Target Navigation tree:
Right-click the Oracle HTTP Server instance you want to start.
Select Control.
Select Start Up from the Control menu.
From the page header, select Start Up.
The instance will start in the state UNKNOWN.
To start an Oracle HTTP Server instance by using WLST, use the start()
command in a WebLogic Server Domain or nmStart()
for a standalone domain. The commands are illustrated in the following table.
Note:
Node Manager must be running for these commands to work. If it is down, you will receive an error message.
serverType
is required for standalone domains. If it is not included an error will be thrown referencing an inability to find startWebLogic
.
These commands assume you have created an Oracle HTTP Server instance, as described in Creating an Oracle HTTP Server Instance and WLST is running.
Domain | Syntax | Example |
---|---|---|
WebLogic |
start('instanceName') or nmStart(serverName='name', serverType='type') |
start('ohs1') or nmStart(serverName='ohs1', serverType='OHS') |
Standalone |
nmStart(serverName='name', serverType='type') |
nmStart(serverName='ohs1', serverType='OHS') |
You can start Oracle HTTP Server instances from the command line by invoking the startComponent
script from the host that contains the Administration Server.
Note:
You can also use this script to start Oracle HTTP Server instances remotely. In that case, the scripts read the configuration to determine the location of the component. You must run this script from the same system as the Administration Server. See Remotely Administering Oracle HTTP Server.WARNING:
When this procedure is completed, any Oracle HTTP Server processes running from this Oracle Home will be able to bind to privileged ports.
On a UNIX system, TCP ports in a reserved range (typically less than 1024) can only be bound by processes with root privilege. Oracle HTTP Server always runs as a non-root user; that is, the user who installed Oracle Fusion Middleware. On UNIX, special configuration is required to allow Oracle HTTP Server to bind to privileged ports.
To enable Oracle HTTP Server to listen on a port in the reserved range (for example, the default port 80 or port 443) use the following one-time setup on each Oracle HTTP Server machine:
Update the ORACLE_HOME/ohs/bin/launch file by performing the following steps as the super user (if you do not have access to super user privileges, have your system administrator perform these steps):
Change ownership of the file to root:
chown root $ORACLE_HOME/ohs/bin/launch
Change the permissions on the file as follows:
chmod 4750 $ORACLE_HOME/ohs/bin/launch
The steps that require root permissions are now complete.
Modify the port settings for Oracle HTTP Server as described in Managing Ports.
Configure the User and Group directive in httpd.conf.
The configured user ID for User should be the same user ID that created the instance. The configured group ID for Group must be the same group ID used to create the instance. See Oracle HTTP Server Configuration Files. To configure Oracle HTTP Server to run as a different user id see Starting Oracle HTTP Server Instances as a Different User (UNIX Only).
Stop the instance if it is running by using any of the stop methods described in Stopping Oracle HTTP Server Instances.
Start the instance by using any of the start-up methods described in Starting Oracle HTTP Server Instances.
On UNIX systems, the Oracle HTTP Server worker processes (the processes that accept connections and handle requests) may be configured to run as a different user id than the user id used to create the instance.
Follow the directions in Starting Oracle HTTP Server Instances on a Privileged Port (UNIX Only) and configure the User directive with the desired user id. The configured user id must be in the same group as the group that owns the instance directory. The Group directive must also be configured and set to the same group id used to create the instance.
Note:
The parent process and logging processes of the Oracle HTTP Server will run as root—these processes neither accept connections nor handle requests.
If Node Manager is configured to use the SSL listener, then ensure that other users have the appropriate permissions to access the SSL trust store used by NodeMmanager so that the startComponent.sh or nmConnect commands can run successfully as a different user.
See Node Manager Overview in Administering Node Manager for Oracle WebLogic Server.
This section contains information on how to stop Oracle HTTP Server using Fusion Middleware Control and WLST. Be aware that other services might be impacted when Oracle HTTP Server is stopped.
This section includes the following topics:
In Fusion Middleware Control, you can stop Oracle HTTP Server from the Oracle HTTP Server home page. Navigate to the Oracle HTTP Server home page and do one of the following:
From the Oracle HTTP Server home page:
Select the server instance you want to stop.
Select Control then Shut Down from the Oracle HTTP Server drop-down menu on the server instance home page.
From the Target Navigation tree:
Right-click the Oracle HTTP Server component you want to stop.
Select Control.
Select Shut Down from the Control menu.
From the page header on the server instance home page, select Shut Down.
You can stop Oracle HTTP Server by using WLST. From within the scripting tool, use one of the following commands:
Note:
Node Manager must be running for these commands to work. If it is down, you will receive an error message.
serverType
is required for standalone domains. If it is not included, an error will be thrown referencing an inability to find startWebLogic
Domain | Syntax | Example |
---|---|---|
WebLogic |
shutdown('serverName') |
shutdown('ohs1') |
Standalone |
nmKill(serverName='serverName', serverType='type')Foot 1 |
nmKill(serverName='ohs1', serverType='OHS') |
Footnote 1
nmKill() will also work in a WebLogic domain.
WARNING:
If you run shutdown() without specifying any parameters, WebLogic Server will terminate and exit WLST. Oracle HTTP Server will continue running. To recover, restart WebLogic Server, launch WLST, and reconnect to the AdminServer. Then re-run the shutdown with the Oracle HTTP Server instance name.
You can stop Oracle HTTP Server instances from the command line by invoking the stopComponent
script from the host that contains the Administration Server.
Note:
You can also use this script to stop Oracle HTTP Server instances remotely. In that case, the scripts read the configuration to determine the location of the component. You must run this script from the same system as the Administration Server. See Remotely Administering Oracle HTTP Server.If you plan to use WLST, you should familiarize yourself with that tool. You should also be aware of the following restriction on WLST:
If you run a standalone version of Oracle HTTP Server, you must use the offline, or "agent", WLST commands. These commands are described in their appropriate context.
See Getting Started Using the Oracle WebLogic Scripting Tool (WLST) in Oracle® Fusion Middleware Administrator's Guide.
Restarting Oracle HTTP Server causes the Apache parent process to advise its child processes to exit after their current request (or to exit immediately if they are not serving any requests). Upon restarting, the parent process re-reads its configuration files and reopens its log files. As each child process exits, the parent replaces it with a child process from the new generation of the configuration file, which begins serving new requests immediately.
The following sections contain information on how to restart Oracle HTTP Server using Fusion Middleware Control and WLST.
In Fusion Middleware Control you restart Oracle HTTP Server from the Oracle HTTP Server home page. Navigate to the Oracle HTTP Server home page and do one of the following:
From the Oracle HTTP Server home page:
Select the server instance you want to restart. Select Control.
Click Start Up on the instance home page, or select Control then Restart from the Oracle HTTP Server drop-down menu.
From the Target Navigation tree:
Right-click the Oracle HTTP Server instance you want to restart.
Select Control.
Select Restart from the Control menu.
To restart Oracle HTTP Server by using WLST, use the softRestart()
command. From within the scripting tool, enter one of the following commands:
Note:
For the WebLogic and the Standalone domains, Node Manager must be running (that is, state is RUNNING
) for these commands to work. If it is down, you will receive an error message.
All parameters are required for standalone domains. If they are not included, an error will be thrown referencing an inability to find startWebLogic
.
The nmSoftRestart
command can also be used in WebLogic domains. To do this, you must first connect to Node Manager by using the nmConnect
command.
Domain | Syntax | Example |
---|---|---|
WebLogic |
softRestart('serverName') |
softRestart('ohs1') |
Standalone |
nmSoftRestart(serverName='name', serverType='type') |
nmSoftRestart(serverName='ohs1', serverType='OHS') |
This section contains information on how to check the status of a running Oracle HTTP Server instance. You can check this information from either Fusion Middleware Control installed as part of an Oracle Fusion Middleware infrastructure or by using WLST.
This section includes the following topics:
An up or down arrow in the top left corner of any Oracle HTTP Server page's header indicates whether the selected server instance is running. This image shows the up arrow, indicating that the server instance, in this case, ohs_2
, is running:
This image shows a down arrow, indicating that the server instance, in this case, ohs_2
, is not running:
In a WebLogic Server Domain, if you used ohs_createInstance()
to create the Oracle HTTP Server instance, its initial state (that is, before starting it) will be SHUTDOWN.
If you used the Configuration Wizard to generate the instance (both WebLogic Server Domain and standalone domain), its initial state (that is, before starting) will be UNKNOWN.
To check the status of a running Oracle HTTP Server instance by using WLST, from within the scripting tool, enter the following:
Note:
Node Manager must be running for these commands to work. If it is down, you will receive an error message. If Node Manager goes down in a WebLogic Server Domain, the state will be returned as UNKNOWN, regardless of the real state of the instance. Additionally state()
does not inform you that it cannot connect to Node Manager.
Unlike other WLST commands, state()
will not tell you when Node Manager is down so there is no way to distinguish an instance that truly is in state UNKNOWN as opposed to Node Manager simply being down.
All parameters are required for standalone domains. If they are not included, then an error will be thrown referencing an inability to find startWebLogic
.
The nmServerStatus
command can also be used in WebLogic domains. To do this, you must first connect to the Node Manager by using the nmConnect
command.
Domain | Syntax | Example |
---|---|---|
WebLogic |
state('serverName') |
state('ohs1') |
Standalone |
nmServerStatus(serverName='name', serverType='type') |
nmServerStatus(serverName='ohs1', serverType='OHS') |
Note:
This command does not distinguish between non-existent components and real components in state UNKNOWN. Thus, if you enter a non-existent instance (for example, you made a typo), a state of UNKNOWN will be returned.
You can delete an Oracle HTTP Server instance in both a WebLogic Server Domain and a standalone domain.
This section includes the following topics:
In a WebLogic Server Domain, you can use either the WLST custom command ohs_deleteInstance()
or from Fusion Middleware Control installed as part of an Oracle Fusion Middleware infrastructure. The following topics describe these procedures.
If you are in a WebLogic Server Domain, you can delete an Oracle HTTP Server instance by using the WLST custom command ohs_deleteInstance()
. When you use this command, the following happens:
The selected instance information is removed from config.xml.
All Oracle HTTP Server configuration directories and their contents are deleted; for example, OHS/instanceName and OHS/instances/instanceName. These paths refer to both the runtime and master copies of the configuration.
All logfiles associated with the deleted instance are deleted.
All state information for the deleted instance is removed.
Note:
You cannot delete an instance by using ohs_deleteInstance()
if Node Manager is down.
To delete an instance using WLST:
You cannot delete an Oracle HTTP Server instance in either an UNKNOWN or a RUNNING state.
Note:
For newly created Oracle HTTP Server instances in state UNKNOWN (for example, created with config wizard), one can start and stop the instance to move the state to SHUTDOWN. It can then be deleted successfully.
For instances in state RUNNING... first stop the instance to move it to state SHUTDOWN and then it can be deleted successfully.
To delete an Oracle HTTP Server instance by using Fusion Middleware Control:
Note:
You cannot delete a running Oracle HTTP Server instance. If the instance is running, stop it, as described in Stopping Oracle HTTP Server Instances and then proceed with the following steps.
You can delete an Oracle HTTP Server instance in a standalone domain by using the Configuration Wizard if it is not the only instance in the domain. The Configuration Wizard always requires at least one Oracle HTTP Server instance in a standalone domain; you will not be able to delete the instance if it is the only one in the domain. To delete the only instance in a standalone domain, you should instead completely remove the entire domain directory.
Deleting Oracle HTTP Server instances by using the Configuration Wizard is actually only a partial deletion (and is inconsistent with the way WebLogic Server domain performs deletion by using ohs_deleteInstance()
. See Deleting an Instance Using WLST). When you delete a standalone instance by using the Configuration Wizard, the following occurs:
Information on the specific instance is removed from config.xml, so this instance is no longer recognized as valid. When you launch the Configuration Wizard again for another update, the deleted instance will not appear.
The logs compiled for the deleted instance are left intact at: DOMAIN_HOME/servers/ohs1 (assuming your instance name was ohs1). If a new instance with the same name is subsequently created, it will inherit and continue logging to these files.
The deleted instance's configuration directories and their contents are not deleted; they remain intact at: DOMAIN_HOME/config/fmwconfig/components/OHS/instanceName and DOMAIN_HOME/config/fmwconfig/components/OHS/instances/instanceName. The only change in both directories is that the following files are renamed: httpd.conf becomes httpd.conf.bak; ssl.conf becomes ssl.conf.bak; and admin.conf becomes admin.conf.bak. This prevents the instance from being started. (If you create a new instance with the same name as the instance you deleted, this information will be overwritten, but the *.bak files will remain).
The deleted instance's state information is left intact at DOMAIN_HOME/system_components/. If a new instance of the same name is subsequently created, it will inherit the state of the old instance. Instead of starting in UNKNOWN state, it could appear as SHUTDOWN or even FAILED_NOT_RESTARTABLE.
To delete an Oracle HTTP Server instance in a standalone domain, do the following:
Shutdown all running instances (see Stopping Oracle HTTP Server Instances). Be aware the Configuration Wizard will not check the state of the Oracle HTTP Server instance so you will need to verify that all instances are indeed stopped before deletion.
If it is running, shut down Node Manager.
Launch the Configuration Wizard (see Installing and Configuring Oracle HTTP Server) and do the following:
Select Update an existing domain and select the path to the domain.
Skip both the Templates screen and the JDK Selection screen by clicking Next on each.
On the System Components screen, select the instance you want to delete and click Delete.
The selected instance is deleted.
Click Next, and, on the OHS Server screen, click Next again.
On the Configuration Summary screen, verify that the selected instance has been deleted and click Update.
On the Success screen, click Finish.
You can change the default value of the Node Manager port by using either WLST or the Oracle WebLogic Server Administration console.
This section includes the following topics:
To change the default Node Manager port number using WLST, use the custom command readDomain
to open the domain. Navigate to the directory containing Node Manager for the machine. Set the ListenPort
property, then update the domain.
... readDomain('DOMAIN_HOME') cd('/Machines/Machine_Name/NodeManager/Node_Manager_Name') set('ListenPort',9090) updateDomain() closeDomain() ...
In this example, DOMAIN_HOME
represents the root directory of the domain. Machines
and NodeManager
are directories. The Node_Manager_Name
is the name of Node Manager belonging to the Machine_Name
machine. The default Node Manager name is localmachine
. The default Machine_Name
is also localmachine
. The ListenPort
value is set to 9090.
You can remotely manage an Oracle HTTP Server instance running in a standalone environment from a collocated Oracle HTTP Server implementation running on a separate machine. Use WLST or Fusion Middleware Control to start, stop, and configure the server from the remote machine.
This section includes the following information which describes how to set up Oracle HTTP Server to run remotely:
The following instructions describe how to set up a remote environment, which will enable you to run Oracle HTTP Server installed on one machine from an installation on another. This section contains the following information:
To remotely manage Oracle HTTP Server, you must have separate hosts installed on separate machines:
A collocated installation (for this example, this installation will be called host1).
/scratch/user/work
The following steps describe how to set up an expanded domain and link it to a database on the collocated version of Oracle HTTP Server (host1):
On host1, use the pack
command to pack the domain. The pack
command creates a template archive (.jar) file that contains a snapshot of either an entire domain or a subset of a domain.
<MW_HOME>/ohs/common/bin/pack.sh -domain=path to domain -template=path to template -template_name=name -managed=true
For example:
<MW_HOME>/ohs/common/bin/pack.sh -domain=<MW_HOME>/user_projects/domains/ohs1_domain -template=/tmp/ohs1_tmplt.jar -template_name=ohs1 -managed=true
The unpack command creates a full domain or a subset of a domain used for a Managed Server domain directory on a remote machine. Use the following steps to unpack the domain you packed on host1 in Task 2: Pack the Domain on host1, on host2.
Once you have unpacked the domain created on host1 onto host2, you can use the same set of WLST commands and Fusion Middleware Control tools you would in a collocated environment to start, stop, restart, and configure the component.
To run an Oracle HTTP Server remotely, do the following:
You can now run the Oracle HTTP Server instance on host2 from the collocated implementation on host1. You can use any of the WLST commands or any of the Fusion Middleware Control tools. For example, to connect host2 to Node Manager and start the server ohs1, from host1 enter:
<MW_HOME>/ohs/common/bin/wlst.sh nmConnect('weblogic', '<password>', '<nm-host>', '<nm-port>', '<domain-name>', '<domain-directory>','ssl') nmStart(serverName='ohs1', serverType='OHS')
See Performing Basic Oracle HTTP Server Tasks for information on starting, stopping, restarting, and configuring Oracle HTTP Server components.