This chapter provides information on getting started with Oracle HTTP Server. It discusses the procedures needed to configure and use Oracle HTTP Server in your environment.
Note:
Unless otherwise mentioned, the information in this document is applicable when Oracle HTTP Server is installed with Oracle WebLogic Server and Oracle Fusion Middleware Control. It is assumed that readers are familiar with the key concepts of Oracle Fusion Middleware, as described in the Oracle Fusion Middleware Concepts Guide and the Oracle Fusion Middleware Administrator's Guide.
For information about installing Oracle HTTP Server in standalone mode, see “Installing Oracle Web Tier in Stand-Alone Mode” in the Oracle Fusion Middleware Installation Guide for Oracle Web Tier.
This chapter includes the following sections:
You can use Fusion Middleware Control or the opmnctl
command to start, stop, and restart Oracle HTTP Server.
The Fusion Middleware Control home page shows the status of all installed components, including Oracle HTTP Server, as illustrated in the following figure:
You can determine the status of Oracle HTTP Server components using opmnctl
:
> $ORACLE_INSTANCE/bin/opmnctl status Processes in Instance: instance1 ---------------------------------+--------------------+---------+--------- ias-component | process-type | pid | status ---------------------------------+--------------------+---------+--------- webcache1 | WebCache-admin | 19556 | Alive webcache1 | WebCache | 19555 | Alive ohs1 | OHS | 7249 | Alive
When Oracle HTTP Server starts up, it writes the process ID (PID) of the parent httpd
process to the httpd.pid
file located, by default, in the following directory:
ORACLE_INSTANCE/diagnostics/logs/OHS/component_name
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.
The PidFile
directive in httpd.conf
specifies the location of the PID file.
Note:
On UNIX/Linux platforms, if you edit the PidFile
directive, you also have to edit the ORACLE_HOME/ohs/bin/apachectl
file to specify the new location of the PID file.
See Also:
PidFile directive in the Apache HTTP Server documentation.
This section describes how to start Oracle HTTP Server using Fusion Middleware Control and opmnctl
.
To start Oracle HTTP Server using Fusion Middleware Control:
Navigate to the Oracle HTTP Server home page.
Select Control from the Oracle HTTP Server menu.
Select Start Up from the Control menu.
To start all Oracle HTTP Server components in an Oracle instance using opmnctl
:
> $ORACLE_INSTANCE/bin/opmnctl startproc process-type=OHS
To start a specific Oracle HTTP Server component using opmnctl
:
> $ORACLE_INSTANCE/bin/opmnctl startproc ias-component=component_name
To get detailed information about the start process, include the verbose option with the command, as follows:
> $ORACLE_INSTANCE/bin/opmnctl verbose startproc ias-component=component_name
The following is an example of the information provided using the verbose option:
HTTP/1.1 200 OK Content-Length: 656 Content-Type: text/html Response: 1 of 1 processes started. <?xml version='1.0' encoding='WINDOWS-1252'?> <response> <opmn id="stadk58:6701" http-status="200" http-response="1 of 1 processes started."> <ias-instance id="inst1"> <ias-component id="ohs1"> <process-type id="OHS"> <process-set id="OHS"> <process id="699033550" pid="11366" status="Alive" index="1" log="/scratch/oracle/product/11110/test090306/instances/inst1/diagnostics/logs/OHS/ohs1/console~OHS~1.log" operation="request" result="success"> <msg code="0" text=""> </msg> </process> </process-set> </process-type> </ias-component> </ias-instance> </opmn> </response>
On a UNIX system the TCP/IP port numbers below 1024 are special in that only processes with root privileges are allowed to listen on those ports.
By default, Oracle HTTP Server runs as a non-root user (the user that installed Oracle Fusion Middleware). Therefore, on UNIX systems, if you plan on running Oracle HTTP Server on a privileged port (for example, port 80), you must enable Oracle HTTP Server to run as root, as follows:
Stop Oracle HTTP Server using Fusion Middleware Control, or with the following opmnctl
command:
> $ORACLE_INSTANCE/bin/opmnctl stopproc ias-component=component_name
Change to the root user.
Navigate to ORACLE_HOME/ohs/bin
and run the following commands:
chown root .apachectl chmod 6750 .apachectl
Exit as the root user.
Add or uncomment the User and Group directives in the httpd.conf
file and set them to the user and group that were used to install and configure Oracle Fusion Middleware. On the Unix operating system, ensure the user and group in the httpd.conf
file is set to the user and group who has performed the installation.
Start Oracle HTTP Server using Fusion Middleware Control, or with the following command:
> $ORACLE_INSTANCE/bin/opmnctl startproc ias-component=component_name
This section describes how to stop Oracle HTTP Server using Fusion Middleware Control and opmnctl
. Other services may be impacted when Oracle HTTP Server is stopped.
To stop Oracle HTTP Server using Fusion Middleware Control:
Navigate to the Oracle HTTP Server home page.
Select Control from the Oracle HTTP Server menu.
Select Shut Down from the Control menu.
To stop all Oracle HTTP Server components in an Oracle instance using opmnctl
:
> $ORACLE_INSTANCE/bin/opmnctl stopproc process-type=OHS
To stop a specific Oracle HTTP Server component using opmnctl
:
> $ORACLE_INSTANCE/bin/opmnctl stopproc ias-component=component_name
To get detailed information about the stop process, include the verbose option with the command, as follows:
> $ORACLE_INSTANCE/bin/opmnctl verbose stopproc ias-component=component_name
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 describe how to restart Oracle HTTP Server using Fusion Middleware Control and opmnctl
.
To restart Oracle HTTP Server using Fusion Middleware Control:
Navigate to the Oracle HTTP Server home page.
Select the Control from the Oracle HTTP Server menu.
Select Restart from the Control menu.
To restart all Oracle HTTP Server components in an Oracle instance using opmnctl
:
> $ORACLE_INSTANCE/bin/opmnctl restartproc process-type=OHS
To restart a specific Oracle HTTP Server component using opmnctl
:
> $ORACLE_INSTANCE/bin/opmnctl restartproc ias-component=component_name
To get detailed information about the start process, include the verbose option with the command, as follows:
> $ORACLE_INSTANCE/bin/opmnctl verbose restartproc ias-component=component_name
When you install Oracle Web Tier, you can choose one of the following approaches:
Install the software and configure an Oracle instance with an Oracle HTTP Server component.
Install only the software.
If you choose to install only the software, you should subsequently configure an Oracle instance by running the configuration tool (config.sh
on UNIX and config.bat
on Windows), which is located in the ORACLE_HOME
/bin
directory. For more information, see the Oracle Fusion Middleware Installation Guide for Oracle Web Tier.
In either approach, you can create additional Oracle HTTP Server components in an Oracle instance by using the opmnctl
command available in the ORACLE_INSTANCE
/bin
directory, as described in this section. Note that you cannot create Oracle HTTP Server components by using Fusion Middleware Control.
To create an Oracle HTTP Server component by using opmnctl
, run the following command:
> $ORACLE_INSTANCE/bin/opmnctl createcomponent -componentType OHS -componentName component_name
For example, to create an Oracle HTTP Server component named ohs2
, use the following command:
> $ORACLE_INSTANCE/bin/opmnctl createcomponent -componentType OHS -componentName ohs2
When you create the Oracle HTTP Server component, ports are automatically assigned. However, you can use the following parameters to specify the ports of your choice:
-listenPort
: HTTP listening port
-sslPort
: HTTPS (SSL) listening port
-proxyPort
: Proxy MBean port internally used by Oracle HTTP Server to communicate with Fusion Middleware Control
Server properties for Oracle HTTP Server can be set using Fusion Middleware Control or direct editing of the Oracle HTTP Server configuration files. You cannot specify the server properties using opmnctl
commands.
To specify the server properties using the Fusion Middleware Control:
Select Administration from the Oracle HTTP Server menu.
Select Server Configuration from the Administration menu. The Server Configuration page appears.
Enter the documentation root directory in the Document Root field that forms the main document tree visible from the Web site.
Enter the e-mail address in the Administrator's E-mail Address field that the server will includes in error messages sent to the client.
Enter the directory index in the Directory Index field. The is the main (index) page that will be displayed when a client first accesses the Web site.
Enter the user name in the Operating System User field.
This is the user name for the server, when sending and responding to requests. The user should not have privileges that allow it to access files or run programs that are for internal-use only. For example, when a request comes from Oracle Portal, Oracle HTTP Server will respond as the user defined in this field, and should have privileges to access the content in Oracle Portal. However, the user should not have privileges to access company-confidential content.
Oracle recommends that you set up a user specifically for running the server. Oracle also recommends that you do not set the user to root.
Enter the group name in the Operating System Group field. This is the group for the server, when sending and responding to requests. The user defined for Oracle HTTP Server must be a member of this group.
Oracle recommends that you set up a group specifically for running the server. Oracle also recommends that you do not set the group as root.
The Modules region is used to enable or disable modules. There are three modules that you can enable or disable: mod_perl, mod_fcgi, and mod_osso.
For instructions on configuring the mod_perl module, see "Configuring the mod_perl Module".
Create an alias, if necessary in the Aliases table. An alias maps to a specified directory. For example, to use a specific set of content pages for a group you can create an alias to the directory that has the content pages.
Review the settings. If the settings are correct, then click Apply to apply the changes. If the settings are incorrect, or you decide to not apply the changes, then click Revert to return to the original settings.
Restart Oracle HTTP Server as described in Section 4.1.4.
The server properties are saved, and shown on the Server Configuration page.
To specify the server properties using the httpd.conf
file:
Open the httpd.conf
file using either a text editor or the Advanced Server Configuration page in Fusion Middleware Control. (See Section 4.4.5, "Modifying an Oracle HTTP Server Configuration File.")
In the DocumentRoot
section of the file, enter the directory that stores the main content for the Web site. The following is an example of the syntax:
DocumentRoot "${ORACLE_INSTANCE}/config/${COMPONENT_TYPE}/${COMPOENT_NAME}/htdocs"
In the ServerAdmin
section of the file, enter the administrator's e-mail address. This is the e-mail address that will appear on client pages. The following is an example of the syntax:
ServerAdmin [email protected]
In the DirectoryIndex
section of the file, enter the directory index. This is the main (index) page that will be displayed when a client first accesses the Web site. The following is an example of the syntax:
DirectoryIndex index.html index.html.var
In the User
and Group
section of the file, enter the user name and group. The following is an example of the syntax:
User nobody Group nobody
The user name is for the server, when sending and responding to requests. The user should not have privileges that allow it to access files or run programs that are for internal-use only. For example, when a request comes from Oracle Portal, Oracle HTTP Server will respond as the user defined in this field, and should have privileges to access the content in Oracle Portal. However, the user should not have privileges to access company-confidential content.
Oracle recommends that you set up a group specifically for running the server. The user defined for Oracle HTTP Server must be a member of this group. Oracle also recommends that you do not set the group as root.
Note:
User
and Group
are relevant only when running Oracle HTTP Server as root on UNIX.
Create aliases, if needed. An alias maps to a specified directory. For example, to use a specific set of icons, you can create an alias to the directory that has the icons for the Web pages. The following is an example of the syntax:
Alias /icons/ "${ORACLE_HOME}/config/${COMPONENT_TYPE}/${COMPONENT_NAME}/icons/" <Directory "${ORACLE_HOME}/content/${COMPONENT_TYPE}/${COMPONENT_NAME}/icons/"> Options MultiViews Order allow, deny Allow from all </Directory>
Save the file.
Restart Oracle HTTP Server as described in Section 4.1.4.
This section includes the following sections:
Section 4.4.5, "Modifying an Oracle HTTP Server Configuration File"
Section 4.4.6, "Configuring the Oracle HTTP Server Environment to Use the apxs Script"
Section 4.4.8, "Updating the Configuration for OHS Instances on a Shared Filesystem"
Secure Sockets Layer (SSL) is an encrypted communication protocol that is designed to securely send messages across the Internet. It resides between Oracle HTTP Server on the application layer and the TCP/IP layer, transparently handling encryption and decryption when a secure connection is made by a client.
One common use of SSL is to secure Web HTTP communication between a browser and a Web server. This case does not preclude the use of non-secured HTTP. The secure version is simply HTTP over SSL (HTTPS). The differences are that HTTPS uses the URL scheme https
:// rather than http://
.
By default, an SSL listen port is configured and enabled using a default wallet during installation. Wallets store your credentials, such as certificate requests, certificates, and private keys.
The default wallet that is automatically installed with Oracle HTTP Server is for testing purposes only. A real wallet must be created for your production server. The default wallet is located in the ORACLE_INSTANCE
/config/OHS/
component_name
/keystores/default
directory. You can either place the new wallet in this location, or change the SSLWallet
directive in ORACLE_INSTANCE
/config/OHS/
component_name
/ssl.conf
to point to the location of your real wallet.
For the changes to take effect, you should restart the Oracle HTTP Server components as described in Section 4.1.4.
For information about configuring wallets and SSL using Fusion Middleware Control, see "Enabling SSL for Oracle HTTP Server Virtual Hosts" in the Oracle Fusion Middleware Administrator's Guide.
Multipurpose Internet Mail Extension (MIME) settings are used by Oracle HTTP Server to interpret file types, encodings, and languages. MIME settings for Oracle HTTP Server can only be set using Fusion Middleware Control. You cannot specify the MIME settings using opmnctl
commands.
The following tasks can be completed on the MIME Configuration page:
MIME type maps a given file extension to a specified content type. The MIME type is used for filenames containing an extension.
To configure a MIME type using Fusion Middleware Control, do the following:
Select Administration from the Oracle HTTP Server menu.
Select MIME Configuration from the Administration menu. The MIME configuration page appears.
Click Add Row in MIME Configuration region. A new, blank row is added to the list.
Enter the MIME type.
Enter the file extension.
Review the settings. If the settings are correct, click Apply to apply the changes. If the settings are incorrect, or you decide to not apply the changes, click Revert to return to the original settings.
Restart Oracle HTTP Server, as described in Section 4.1.4.
The MIME configuration is saved, and shown on the MIME Configuration page.
MIME encoding enables Oracle HTTP Server to determine the file type based on the file extension. You can add and remove MIME encodings. The encoding directive maps the file extension to a specified encoding type.
Select Administration from the Oracle HTTP Server menu.
Select MIME Configuration from the Administration menu. The MIME configuration page appears.
Expand the MIME Encoding region by clicking the plus sign (+) next to MIME Encoding.
Click Add Row in MIME Encoding region. A new, blank row is added to the list.
Enter the MIME encoding, such as x-gzip.
Enter the file extension, such as .gx.
Review the settings. If the settings are correct, click Apply to apply the changes. If the settings are incorrect, or you decide to not apply the changes, click Revert to return to the original settings.
Restart Oracle HTTP Server as described in Section 4.1.4.
The MIME language setting maps file extensions to a particular language. This directive is commonly used for content negotiation, in which Oracle HTTP Server returns the document that most closely matched the preferences set by the client.
Select Administration from the Oracle HTTP Server menu.
Select MIME Configuration from the Administration menu. The MIME configuration page appears.
Expand the MIME Languages region by clicking the plus sign (+) next to MIME Languages.
Click Add Row in MIME Languages region. A new, blank row is added to the list.
Enter the MIME language, such as en-US.
Enter the file extension, such as en-us.
Review the settings. If the settings are correct, click Apply to apply the changes. If the settings are incorrect, or you decide to not apply the changes, click Revert to return to the original settings.
Restart Oracle HTTP Server as described in Section 4.1.4.
The mod_perl module embeds the Perl interpreter into Oracle HTTP Server. This eliminates start-up overhead and enables you to write modules in Perl. The module is disabled, by default.
To enable the mod_perl module using Fusion Middleware Control, do the following:
Select Administration from the Oracle HTTP Server menu.
Select mod_perl Configuration from the Administration menu. The mod_perl configuration page appears.
Note:
If mod_perl has not been enabled, then you will be redirected to the Server Configuration page. Select mod_perl and click Apply to enable mod_perl. After the confirmation page has been displayed, restart Oracle HTTP Server, and then return to the mod_perl Configuration page.
Enter the switch information in the Switches field.
Enter the environment variables to be passed to the scripts in the Environment field.
Enter the required script names in the Require field.
Click Add Row to create a new row.
Configure mod_perl directives for a Location in the Perl Locations table. The Location assigns a number of rules that the server should follow when the request's URI matches the Location.
Enter the base URI for the Perl scripts in the Locations field. Just as it is the widely accepted convention to use /cgi-bin
for your mod_cgi scripts, it is also conventional to use /perl
as the base URI of the Perl scripts that are running under mod_perl.
Enter options in the Options field. The PerlOptions
directive provides fine-grained configuration by providing control over which class of Perl interpreter pool to be used. Options are enabled by prepending them with a plus sign (+) and are disabled by prepending them with a minus sign (-).
If you want to send headers, then click the Send Header check box. The PerlSendHeader
directive is for mod_perl 1.0 backwards-compatibility. When enabled, the server sends an HTTP header to the browser on every script invocation. You should disable this option for NPH (non-parsed-headers) scripts.
Enter the environment in the Environment field. The PerlSetEnv
directive allows you to specify system environment variables and pass them into your mod_perl handlers.
Enter the response handler in the Response Handler field. The PerlResponseHandler
directive tells mod_perl which callback is going to do the job.
Enter the authentication handler in the Authentication Handler field. The PerlAuthenHandler
directive is used to set the handler to verify a user's identification credentials.
Review the settings. If the settings are correct, click Apply to apply the changes. If the settings are incorrect, or you decide to not apply the changes, click Revert to return to the original settings.
Restart Oracle HTTP Server as described in Section 4.1.4.
The mod_perl module configuration is saved and shown on the mod_perl Configuration page.
Note:
If you are manually editing the mod_perl configuration instead of using Fusion Middleware Control, then all directives must be defined within the <IfModule mod_perl.c>
block of the mod_perl.conf
file. Any mod_perl related directives defined outside of this block might be ignored.
You can configure mod_wl_ohs
either by using Fusion Middleware Control or by editing the mod_wl_ohs.conf
configuration file manually.
For information about the prerequisites and procedure for configuring mod_wl_ohs to proxy requests from Oracle HTTP Server to Oracle WebLogic Server, see "Configuring the mod_wl_ohs Plug-In for Oracle HTTP Server" in Using Web Server 1.1 Plug-Ins with Oracle WebLogic server.
To modify an Oracle HTTP Server configuration file using Fusion Middleware Control, do the following:
Select Administration from the HTTP Server menu.
Select Advanced Configuration from the Administration menu item. The Advanced Server Configuration page appears.
Select the configuration file from the list, such as the httpd.conf
file.
Edit the file, as needed.
Review the settings. If the settings are correct, click Apply to apply the changes. If the settings are incorrect, or you decide to not apply the changes, click Revert to return to the original settings.
Restart Oracle HTTP Server as described in Section 4.1.4.
The file is saved and shown on the Advanced Server Configuration page.
You can use the apxs
command in the $ORACLE_HOME/ohs/bin directory to build and install Apache extension modules for Oracle HTTP Server. To be able to use the apxs command, you should configure the Oracle HTTP Server environment as follows:
Set the following environment variables from command line:
ORACLE_HOME=~/
oraHome1
ORACLE_INSTANCE=~/
oraInstance1
CONFIG_FILE_PATH=$ORACLE_INSTANCE/
config/
OHS/oraInstance1
LD_LIBRARY_PATH=$ORACLE_HOME/lib:$ORACLE_HOME/ohs/lib:$LD_LIBRARY_PATH
Where ORACLE_HOME
and ORACLE_INSTANCE
are set to the appropriate values for the customer; for example:
export ORACLE_HOME=/scratch/jjones/PS6/Middleware/Oracle_WT1 export ORACLE_INSTANCE=$ORACLE_HOME/instances/instance1 export CONFIG_FILE_PATH=$ORACLE_INSTANCE/config/OHS/ohs1 export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$ORACLE_HOME/ohs/lib:$LD_LIBRARY_PATH
You can now use the apxs from ORACLE_HOME
to build, install and configure a new module; for example, to build, install and configure a new extension module called mod_experimental, from the module's source directory, you would enter the following:
$ORACLE_HOME/ohs/bin/apxs -c mod_experimental.c $ORACLE_HOME/ohs/bin/apxs -i -a mod_experimental.c
For more information about the apxs
command, see the Apache HTTP Server documentation at http://httpd.apache.org/docs/2.0/programs/apxs.html
.
Note:
apxs is available only to Unix/Linux versions of OHS.
The Options method enables clients to determine which methods are supported by a web server. If enabled, it appears in the Allow
line of HTTP response headers.
For example, if you send a request such as:
---- Request ------- OPTIONS / HTTP/1.0 Content-Length: 0 Accept: */* Accept-Language: en-US User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Win32) Host: host123:80
you might get the following response from the web server:
---- Response --------
HTTP/1.1 200 OK
Date: Wed, 23 Apr 2008 20:20:49 GMT
Server: Oracle-Application-Server-11g/11.1.1.0.0 Oracle-HTTP-Server
Allow: GET,HEAD,POST,OPTIONS
Content-Length: 0
Connection: close
Content-Type: text/html
Some sources consider exposing the Options method a low security risk because malicious clients could use it to determine the methods supported by a web server. However, because web servers support only a limited number of methods, disabling this method will just slow down malicious clients, not stop them. In addition, the Options method may be used by legitimate clients.
If your Oracle Fusion Middleware environment does not have clients that require the Options method, you can disable it by including the following lines in the httpd.conf
file:
<IfModule mod_rewrite.c> RewriteEngine on RewriteCond %{REQUEST_METHOD} ^OPTIONS RewriteRule .* – [F] </IfModule>
Functional or performance issues may be encountered when an OHS instance is created on a shared filesystem, including NFS (Network File System). In particular, lock files or Unix sockets used by OHS may not work or may have severe performance degradation; WLS requests routed by mod_wl_ohs may have severe performance degradation due to filesystem accesses in the default configuration.
Table 4-1 provides information about the Lock file issues and the suggested changes in the httpd.conf
file specific to the operating systems.
Operating System | Description | httpd.conf changes |
---|---|---|
Linux |
Lock files are not required. The Sys V semaphore is the preferred cross-process mutex implementation. |
Change Comment out the LockFile directive (three places). |
Solaris |
Lock files are not required. The cross-process pthread mutex is the preferred cross-process mutex implementation. |
Change Comment out the LockFile directive (three places). |
Other Unix platforms |
Change the LockFile directive to point to a local filesystem (three places). |
|
Unix socket issues |
|
This section describes how to delete an Oracle HTTP Server component using opmnctl
. You cannot delete an Oracle HTTP Server component using Fusion Middleware Control.
To delete an Oracle HTTP Server component using opmnctl
:
> $ORACLE_INSTANCE/bin/opmnctl deletecomponent -componentName component_name
For example, to delete an Oracle HTTP Server component named ohs2
use the following command:
> $ORACLE_INSTANCE/bin/opmnctl deletecomponent -componentName ohs2