In this third part of a five-part article, you'll learn how to manage the Oracle HTTP Server (OHS) from the command line, how to monitor the OHS, and more. It is excerpted from chapter five of the book Oracle 10g Application Server Exam Guide, written by Sam Alapati (McGraw-Hill, 2006; ISBN: 0072262710).
CERTIFICATION OBJECTIVE 5.02: Managing the Oracle HTTP Server
You can manage the Oracle HTTP Server through the Application Server Control, or with the help of command-line tools.
Managing from the Command Line
The two command-line tools you use to manage OHS are opmnctl and dcmtl. You can start, restart, and stop the Oracle HTTP Server along with the rest of the OracleAS components using the opmnctl utility, or just the Oracle HTTP Server by itself. Here's how you start and stop the OHS server using the opmnctl command-line utility, which is located in the $ORACLE_HOME/opmn/bin directory:
You can also use the dcmtl utility to configure the Oracle HTTP Server instance.
exam watch: Always use the opmnctl command-line tool to start, stop, and restart the Oracle HTTP Server to avoid potential problems caused by the inability of the configuration infrastructure to communicate with server processes. You shouldn't use the apachectl utility to manage the OHS.
Using the Application Server Control to Manage OHS
You can view the status and a brief performance report of the Oracle HTTP Server in the Application Server home page, shown in Figure 5-2. To get to the home page of the Oracle HTTP Server, go to the System Components table of the relevant OracleAS instance and click the HTTP_Server link. From the HTTP Server home page, you can click links to view the status metrics, module metrics, and the response/load metrics. You can also view the error log for the HTTP Server by clicking the Error Log link.
Go to the System Components table section of the Application Server Control to find where you can start, stop, and restart the OHS server. You can also stop and start the OHS using the Stop All and Start All buttons on the Application Server Control home page.
You can use the Application Server Control to conveniently manage the OHS and modify the default configuration settings. You've already seen how you can start, stop, and restart the OHS Server using the Application Server Control. Let's briefly examine the various OHS management features in the Application Server Control.
Figure 5-2. The Oracle HTTP Server Home Page
Editing the httpd.conf File
You can edit the httpd.conf file by following these steps:
On the Application Server home page, select Oracle HTTP Server from the System Components table and click the HTTP_Server link.
On the HTTP Server home page, click the Administration tab.
Click the Advanced Server Properties link in the HTTP_Server Administration page.
In the Advanced Properties page, click the httpd.conf link, to edit that file.
Figure 5-3 shows the Advanced Server Properties page. You can view and modify several OHS configuration files from this page, including the httpd.conf file and the oracle_apache.conf file, which helps configure the Oracle-specific HTTP parameters.
Although you can modify the httpd.conf file manually, the advantage in editing the file using Application Server Control is that the configuration changes are effected immediately, because the OHS server is automatically bounced when you
Figure 5-3. The Advanced Server Properties Page
modify the configuration. Also remember that if you do decide to manually edit the httpd.conf file, be sure to issue the following dcmtl command at the command line:
$ dcmtl updateconfig -v
When you issue this command, the Metadata Repository is updated with the configuration changes you make by manually editing the httpd.conf file. The-- v option gives you detailed information (verbose) about the results of executing the command. Make sure that you execute the dcmtl command in the appropriate OracleAS instance home directory. You can't guarantee that you're issuing the command in the right environment by merely setting the ORACLE_HOME environment variable. You must be in the correct ORACLE_HOME location to make sure you're running the command for the appropriate instance.