Using Fusion Middleware Control to Create Virtual Hosts Using Fusion Middleware Control to Configure Virtual Hosts

Managing Connectivity 6-7 ■ Server Configuration – Configure basic virtual host properties, such as document root directory, installed modules, and aliases. See Section 4.3.1, Using Fusion Middleware Control to Specify Server Properties. ■ MIME Configuration – Configure MIME settings, which are used by Oracle HTTP Server to interpret file types, encodings, and languages. Section 4.4.2, Configuring MIME Settings. ■ Log Configuration – Configure access logs that will record all requests processed by the virtual host. The logs contain basic information about every HTTP transaction handled by the virtual host. See Section 7.2, Configuring Oracle HTTP Server Logs. ■ mod_perl Configuration – Configure the mod_perl module to embed the Perl interpreter into the virtual host, thereby eliminating startup overhead and enabling you to write modules in Perl. This module is disabled, by default. See Section 4.4.3, Configuring the mod_perl Module. ■ SSL Configuration – For instructions on configuring SSL using Fusion Middleware Control, see Enabling SSL for Oracle HTTP Server Virtual Hosts in the Oracle Fusion Middleware Administrators Guide. ■ mod_wl_ohs Configuration – Configure the mod_wl_ohs module to allow requests to be proxied from an Oracle HTTP Server to Oracle WebLogic Server. See Section 4.4.4, Configuring the mod_wl_ohs Module. 7. Review the settings on each configuration page. If the settings are correct, click OK to apply the changes. If the settings are incorrect, or you decide to not apply the changes, click Cancel to return to the original settings. 8. Restart Oracle HTTP Server. See Section 4.1.4 . 6-8 Oracle Fusion Middleware Administrators Guide for Oracle HTTP Server 7 Managing Oracle HTTP Server Logs 7-1 7 Managing Oracle HTTP Server Logs Oracle HTTP Server generate log files containing messages that record all types of events, including startup and shutdown information, errors, warning messages, access information on HTTP requests, and additional information. This chapter describes how to find information about the cause of an error and its corrective action, to view and manage log files to assist in monitoring system activity and to diagnose problems. This chapter includes the following sections: ■ Section 7.1, Introducing Server Logs ■ Section 7.2, Configuring Oracle HTTP Server Logs ■ Section 7.3, Log Directives for Oracle HTTP Server ■ Section 7.4, Viewing Oracle HTTP Server Logs

7.1 Introducing Server Logs

There are two types of logs for Oracle HTTP Server: ■ Error logs, which record server problems. ■ Access logs, which record which components and applications are being accessed and by whom. You can view Oracle Fusion Middleware log files using either Fusion Middleware Control or a text editor. The log files for Oracle HTTP Server are located in the following directory: ORACLE_INSTANCE diagnosticslogsOHSohs_name Note: 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 Administrators Guide. For information about installing Oracle HTTP Server in standalone mode, see “Installing Oracle Web Tier Without Oracle WebLogic Server” in the Oracle Fusion Middleware Installation Guide for Oracle Web Tier. 7-2 Oracle Fusion Middleware Administrators Guide for Oracle HTTP Server

7.1.1 About Error Logs

Oracle HTTP Server enables you to choose the format in which you want to generate log messages. You can choose to generate log messages in the legacy Apache message format, or use Oracle Diagnostic Logging ODL to generate log messages in text or XML-formatted logs, which complies with Oracle standards for generating error log messages. By default, Oracle HTTP Server error logs use ODL for generating diagnostic messages. It provides a common format for all diagnostic messages and log files, and a mechanism for correlating the diagnostic messages from various components across Oracle Fusion Middleware. The default name of the error log file is ohs_name.log.

7.1.2 About Access Logs

Access logs record all requests processed by the server. The logs contain basic information about every HTTP transaction handled by the server. The access log contains the following information: ■ Host name ■ Remote log name ■ Remote user and time ■ Request ■ Response code ■ Number of transferred bytes The default name of the access log file is access_log.

7.1.2.1 Log Format

You can specify the information to include in the access log, and the manner in which it is written. The default format is the Common Log Format CLF. The CLF format contains the following fields: host ident authuser date request status bytes ■ host: This is the client domain name or its IP number. Use h to specify the host field in the log. ■ ident: If IdentityCheck is enabled and the client system runs identd, this is the client identity information. Use i to specify the client identity field in the log. ■ authuser: This is the user ID for the authorized user. Use a to specify the authorized user field in the log. ■ date: This is the date and time of the request in the daymonthyear:hour:minute:second format. Use t to specify date and time in the log. ■ request: This is the request line, in double quotes, from the client. Use r to specify request in the log. See Also: For information about searching and viewing log files, see Oracle Fusion Middleware Administrators Guide Managing Oracle HTTP Server Logs 7-3 ■ status: This is the three-digit status code returned to the client. Use s to specify the status in the log. If the request will be forwarded from another server, use s to specify the last server in the log. ■ bytes: This is the number of bytes, excluding headers, returned to the client. Use b to specify number of bytes in the log. Use i to include the header in the log.

7.1.3 About Log Rotation

It is important to have log files periodically rotated on a moderately busy server. Oracle HTTP Server supports two types of log rotation policies: size-based and time-based. You can configure both error log and access log to use either one of these two rotation polices. In addition to the rotatelogs binary from Apache, Oracle HTTP Server comes with another rotation binary called odl_rotatelogs, which provides all the functionality of rotatelogs binary plus the extra functionality of log retention. By default, Oracle HTTP Server uses odl_rotatelogs for both error and access logs. odl_ rotatelogs takes the following arguments: odl_rotatelogs [-u:utc offset in seconds] LOGFILENAME {size based rotation options OR time based rotation options} ■ Size-based rotation options: maxFileSizeM [allFilesSizeM] For example, when configured as 10M 70M, the rotation will happen whenever log file reaches 10MB in size, and a total of 70MB is allowed for all log files a maximum of 7010=7 log files will be retained. ■ Time-based rotation options: frequency in sec [retentionTime in sec] [startTime in YYYY-MM-DDThh:mm:ss] For example, when configured as 43200 604800 2009-05-08T10:53:29, the rotation will happen every 43200 seconds that is, 12 hours, rotated log files will be retained for maximum of 604800 seconds 7 days, starting from May 5, 2009 at 10:53:29

7.2 Configuring Oracle HTTP Server Logs

You can use Fusion Middleware Control to configure error and access logs. The following logging tasks can be set from the Log Configuration page: ■ Using Fusion Middleware Control to Configure Error Logs ■ Using Fusion Middleware Control to Configure Access Logs

7.2.1 Using Fusion Middleware Control to Configure Error Logs

To configure an error log for Oracle HTTP Server using Fusion Middleware Control, do the following: 1. Navigate to the Oracle HTTP Server home page.

2. Select Log Configuration from the Administration menu.

The Log Configuration page is displayed, as shown in the following figure. See Also: Access Log in the Apache Server documentation.