07 November 2006

Creating New OC4J Instances With

In the recently published OracleAS release, you may notice that we've reintroduced support for a "Create Instance" operation within Application Server Control.

The "Create Instance" operation lets you create a new OC4J instance, give it a name and allocate it to a group. No surprises.

What may suprise you is that by default, the new OC4J instance is configured to run its default-web-site in AJP mode. What this means is that if you have performed the Basic Installation type and don't have Oracle HTTP Server in the mix, you can't access the new instance from a browser.

You can observe this using the command $ORACLE_HOME/opmn/bin/opmnctl status -l which outputs all the current ports in use for an Oracle Application Server home.

Processes in Instance: oow_http_admin.localhost
ias-component | process-type | pid | status |
uid | memused | uptime | ports
OC4JGroup:colors | OC4J:red | 3728 | Alive | 18
7892744 | 68052 | 0:09:09 | jms:12601,ajp:12502,rmis:12702,rmi:12402

But no worries, it's easy to change.

In the release, we also added another new Adminstration Task to ASC to modify the "Server Properties" of an Oc4J instance. Using the "Server Properties" page you can change the protocol and port used by the default-web-site.

So what you want to do is to access the "Server Properties" page of the new OC4J instance and adjust the details of the default-web-suite so that it runs in HTTP mode using a known fixed (and free!) port.

After restarting the instance using OPMN or ASC, the new OC4J instance and applications deployed to it will be able to be accessed directly using a browser.

The "opmnctl status -l" show also now show the port being used as http:5000.

Processes in Instance: oow_http_admin.localhost
ias-component | process-type | pid | status |
uid | memused | uptime | ports
OC4JGroup:colors | OC4J:red | 6052 | Alive | 18
7892746 | 23260 | 0:00:34 | jms:12603,http:5000,rmis:12703,rmi:12403


sumit said...


Wanted to know what exactly is the difference between the ajp mode and http mode,becuase i guess in ajp mode also we need the apache server to work.
I am talking with regards to Apps R12 where a client requests is routed from the mod_oc4j to the concerned oc4j instance using the ajp protocol.

If i create a test oc4j instance and change the settings to http does that mean that it won't work.


Buttso said...

Yep you pretty much have it.

AJP13 is a binary protocol used for communicating between Apache/OHS and OC4J instances. Apache/OHS uses a module called mod_oc4j to intercept the request and send it to OC4J over AJP13. The only client of an AJP ena bled listener is mod_oc4j.

HTTP is just stock old HTTP. The client is a browser.

Anonymous said...

also you can do:
ORACLE_HOME/bin/createinstance -instanceName OC4J_instanceName -groupName groupname [-port httpPort] [-protocol protocol]

from commandline.

also. don't forget. you need to start the opmnctl as root if any one of the containers are being started in ports less than a certain range (think its 1000 or something like that). Otherwise it won't be able to obtain the port.