Skip Headers

Oracle® HTTP Server Administering a Standalone Deployment Based on Apache 2.0 10g Release 3 (10.1.3) B25777-01 |
| Home | Solution Area | Contents | Index

Previous | Next |

# 4 Managing Server Processes

This chapter provides an overview of the Oracle HTTP Server processes, and provides information on how to regulate, and monitor these processes.

Topics discussed are:

- Oracle HTTP Server Processing Model

- Handling Server Processes

- Configuring the Number of Processes and Connections

- Running Oracle HTTP Server as Root

- Security Considerations

- Getting Information about Processes

Documentation from the Apache Software Foundation is referenced when applicable.

Note: Readers using this guide in PDF or hard copy formats will be unable to access third-party documentation, which Oracle provides in HTML format only. To access the third-party documentation referenced in this guide, use the HTML version of this guide and click the hyperlinks.

## 4.1 Oracle HTTP Server Processing Model

Once Oracle HTTP Server is started, the system is ready to listen for and respond to http(s) requests. The request processing model on UNIX differs from that on Windows.

On UNIX, there is a single parent process that manages multiple child processes. The child processes are responsible for handling requests. The parent process brings up additional child processes as necessary, based on configuration. Although the server has the ability to dynamically bring up additional child processes, it is best to configure the server to start enough children initially so that requests can be handled without having to spawn more child processes.

On Windows, there is a single parent process and a single child process. The child process creates threads that are responsible for handling client requests. The number of threads created is static and can be configured.

## 4.2 Handling Server Processes

By default, on UNIX, the main httpd parent process and child processes are configured to run as the user who installed Oracle Application Server. The User and Group directives are used to set the privileges for the child processes. These directives are ignored if you are not running as `root`. The child processes must be able to read all the content that will be served.

- Group

- User

### 4.2.1 Group

Specifies the group under which the server answers requests. Run the standalone server as `root` to use this directive. It is recommended that you create a new group for running the server. This is applicable to UNIX only.

For example: `Group myorg`

See Also: "`Group` directive" in the Apache Server documentation.

### 4.2.2 User

Specifies the user ID to which the server answers requests. Run the standalone server as `root` to use this directive.You should have privileges to access files that are available for everyone, and should not be able to execute code which is not meant for httpd requests. It is recommended that you set up a new user for running the server. This is applicable to UNIX only.

For example: `User jdoe`

See Also: "`User` directive" in the Apache Server documentation.

## 4.3 Configuring the Number of Processes and Connections

The following directives tune the performance of Oracle HTTP Server by configuring how clients requests are processed. They are located in the "Global Environment" of the `httpd.conf` file.

See Also: "httpd.conf File Structure"

- StartServers

- ThreadsPerChild

- MaxClients

- MaxRequestsPerChild

- MaxSpareServers

- MinSpareServers

### 4.3.1 StartServers

Sets the number of child server processes created when Oracle HTTP Server is started. The default is 5. This is applicable to UNIX only.

Usage: `StartServers 5`

See Also: "`StartServers` directive" in the Apache Server documentation.

### 4.3.2 ThreadsPerChild

Controls the maximum number of child threads handling requests. The default is 50. This is applicable to Windows only.

Usage: `ThreadsPerChild 50`

See Also: "`ThreadsPerChild` directive" in the Apache Server documentation.

### 4.3.3 MaxClients

Limits the number of requests that can be dealt with at one time. The default and recommended value is 150. This is applicable to UNIX only.

Usage: `MaxClients 150`

See Also: "`MaxClients` directive" in the Apache Server documentation.

### 4.3.4 MaxRequestsPerChild

Controls the number of requests a child process handles before it dies. If you set the value to 0, which is the default, then the process will never die.

On Windows, it is recommended that this be set to 0. If it is set to a non-zero value, when the request count is reached, the child process exits, and is respawned, at which time it re-reads the configuration file. This can lead to unexpected behavior if you have modified a configuration file, but are not expecting the changes to be applied yet.

Usage: `MaxRequestsPerChild 0`

See Also: "`MaxRequestsPerChild` directive" in the Apache Server documentation.

### 4.3.5 MaxSpareServers

Sets the maximum number of idle child server processes. An idle process is one which is running, but not handling a request. The parent process kills off idle child processes that exceed the value set for this directive. The default is 20. This is applicable to UNIX only.

Usage: `MaxSpareServers 20`

See Also: "`MaxSpareServers` directive" in the Apache Server documentation.

### 4.3.6 MinSpareServers

Sets the minimum number of idle child server processes. An idle process is one which is running but not handling a request. The parent process will create new children at the maximum rate of one process per second if there are fewer processes running. The default is 5. This is applicable to UNIX only.

Usage: `MinSpareServers 5`

See Also: "`MinSpareServers` directive" in the Apache Server documentation.

## 4.4 Running Oracle HTTP Server as Root

On UNIX, if you want to run on ports less than 1024, then you will have to run as `root`.

In order to run Oracle HTTP Server as `root`, perform the following steps:

1. Stop Oracle HTTP Server using the following command:

       ORACLE_HOME/opmn/bin> opmnctl [verbose] stopproc ias-component=HTTP_Server

2. Change to root user.

3. Navigate to `ORACLE_HOME``/ohs/bin` and execute the following command:

       chown root .apachectl
       chmod 6750 .apachectl

4. Exit `root`.

5. Restart Oracle HTTP Server using the following command:

       ORACLE_HOME/opmn/bin> opmnctl [verbose] restartproc ias-component=HTTP_Server

## 4.5 Security Considerations

For additional security on UNIX, you can change the user to "nobody". Be sure that the child processes can accomplish their tasks as the user "nobody". Change all static content, such as the `ORACLE_HOME``/ohs/htdocs` directory on UNIX or `ORACLE_HOME``\ohs\htdocs` on Windows, so that all the files are readable, but ideally not writable by the user "nobody". Also, verify that all the CGI and FastCGI programs can be run by user "nobody".

Finally, given that the cached content might contain sensitive data, the final contents of the file-system cache should be protected. So, although Oracle HTTP Server might run as "nobody", access to the system as this user should be well-protected.

## 4.6 Getting Information about Processes

There are several ways to monitor Oracle HTTP Server processes.

1. Use the performance monitor on Windows, or the `ps` utility on UNIX.

   See Also: Oracle Application Server Performance Guide and your operating system documentation for more information.

2. Use mod_status for server status. By default, it is available from localhost only.