The following is the second part of a six-part series on Oracle Application Server 10g administration. Each tip is excerpted from the Osborne Oracle Press book, "Oracle Application Server 10g administration handbook,"
Managing the Oracle HTTP Server
In early versions of Oracle9iAS, OHS (with a standard Apache server) was started and stopped using the httpd command located in the ORACLE_HOME/Apache/Apache/bin directory. Oracle Applicaton Server 10g (9.0.4) uses the apachectl script (located in the same directory). However, when used, it returns a warning not to use apachectl, but instead to use the $ORACLE_HOME/dcm/dcmctl script. The best way to ensure that the Application Server starts up all parts, including OHS, is to use the $ORACLE_HOME/opmn/bin/opmnctl script, passing it the startall or stopall parameters. This is because OHS is an integral part of the Application Server -- stopping just OHS will cause problems in the instance. Also, opmn monitors the processes and may restart OHS if it detects that it is down. Thus, it is recommended that the instance be brought down using opmn if you need to bring down or restart OHS from the command line. Once running, OHS is easily configured, started, or stopped using the Enterprise Manager Web site.
When OHS starts, it begins as a single parent process that writes its operating system pid in the file httpd.pid. The parent process spawns a number of child processes that are used to handle client requests. As the server runs, the parent process checks the number of idle child processes and either adds processes (if there are too few) or destroys processes (if there are too many) to ensure that the server is ready to respond instantly to a request and is not wasting server resources with too many idle processes.
When OHS starts, the configuration information is obtained from a file called httpd.conf, which is located in the $ORACLE_HOME/Apache/Apache/conf directory. On an Apache server, this file can be moved and the new location passed into the server as a startup parameter. Since OHS is started and monitored by the opmn program, the configuration file should remain where it was installed.
The httpd.conf file is discussed in detail later in this chapter. The Apache server that OHS is built on provides a basic framework and then expands its capabilities by utilizing modules. This modular structure allows the administrator to add or remove capabilities to the base server as needed.
Note: The Distributed Configuration Management utility maintains a repository of configuration data. If you manually update the configuration files, you must update the repository. To execute this update, use the command dcmctl-updateConfig-ct ohs. If you update the configuration using Enterprise Manager, the repository is automatically updated for you.
About the authors
A senior Oracle trainer with Burleson Consulting, John Garmany is also a respected Oracle expert and author and chosen by Oracle Press to write the "officially authorized edition" for the "Oracle Application Server 10g administration handbook." John also serves as a writer for DBAZine, "Oracle Internals" and has authored several popular Oracle books.
Don Burleson is one of the world's top Oracle database experts with more than 20 years of full-time DBA experience. He specializes in creating database architectures for very large online databases and he has worked with some of the world's most powerful and complex systems. Don's professional Web sites include www.dba-oracle.com and www.remote-dba.net.
This was first published in June 2004