In this third part of a series that focuses on managing OC4J and configuring J2EE applications, we look at how to configure the OC4HJ server. It is excerpted from chapter eight of the Oracle 10g Application Server Exam Guide, written by Sam Alapati (McGraw-Hill; ISBN: 0072262710).
The Web site–related XML files configure ports, protocols, and Web contexts for the OC4J Web site, and are in the following format:
The web-site.xml file contains the Web site configuration information, including the following:
Host name, IP addresses, and listener ports
Default Web application for the site
Settings for user Web applications
Here’s a typical web-site.xml file:
<?xml version="1.0" standalone='yes'?> <!DOCTYPE web-site PUBLIC "OracleAS XML Web-site" "http://xmlns.oracle.com/ias/dtds/web-site-9_04.dtd"> <web-site host="localhost" port="3302" protocol="ajp13" display-name="My Java Web Site" cluster-island="1" > <web-site port="3302" protocol="ajp13" display-name="My Java Web Site"> <!--The default web-app for this site, bound to the root--> <default-web-app application="default" name="defaultWebApp" root="/j2ee" /> <web-app application="default" name="dms" root="/dmsoc4j" access-log="false" /> <access-log path="../log/default-web-access.log" /> </web-site>
exam watch: The web-site.xml file is the OC4J Web server configuration file.
Here are the key elements of the web-site-xml file:
web-site The name of your Web site.
host The name of the server hosting the Web server.
display-name A user-friendly Web site name.
default-web-app The default Web application.
name The name of the WAR file for the application, minus its .war extension.
port The Oracle HTTP Server forwards requests over the AJP listening port defined here. The OPMN configuration contains information about the range of AJP ports that can be used.
protocol The protocol used is AJP1.3, which is the Apache Jserver Protocol, used by mod_oc4j running on the Oracle HTTP Server (which is based on the Apache Web server), to communicate with the OC4J instance.
root The value for this attribute is /j2ee in our example; note that this must match the value specified for the Oc4jMount command in the oc4j.conf file. The root variable shows the root context for the application off your Web site. If your Web site is http://myhost:7777/j2ee, you initiate your application by going to http://myhost:7777/j2ee/testapp (testapp is the name of your J2EE application).
access-log Name of the log where access information is logged.
Please check back next week for the continuation of this article.