20 November 2006

Changing OC4J Ports in Oracle Application Server

When OC4J is part of an Oracle Application Server environment, it is managed and monitored OPMN. OPMN is a core component of Oracle Application Server and basically provides centralized process management capability.

As such, when OC4J is being managed by OPMN, the ports is uses at runtime are supplied by OPMN when it starts the instance. The port settings in the OC4J configuration files are overidden by the OPMN supplied values.

If OC4J ports need to be changed in an Oracle Application Server enviromment, then they need to be changed at the source -- the opmn.xml file -- and not in the OC4J configuration files.

There are three ways I can think of to change OPMN port entries

1. Use Application Server Control and the new Runtime Ports page that was added in the 10.1.3.1 release.

2. Use the opmnctl command

For example, to switch the default-web-site from using AJP to HTTP protocol, use this command:

>opmnctl config port update ias-component=OC4J process-type=home portid=default-web-site protocol=http

3. Manually edit opmn.xml and specify the port to use.

Now with that example, what needs to be kept in mind here is that for an Oracle Application Server installation, in most cases, the OC4J instance is running in AJP mode and Oracle HTTP Server is sitting in front of it and routing client requests.

If this is the case, and you want change the port to a value of 80, then you need to change the Oracle HTTP Server port since it is the server that is servicing end user requests and then routing them to OC4J. You don't change the OC4J port since it is servicing requests from Oracle HTTP Server.

Then just to make it a little confusing, the Oracle HTTP Server port is configured in $ORACLE_HOME/Apache/Apache/httpd.conf file and not in the opmn.xml file.

1 comment:

Anonymous said...

Hi, your blog provide lots of very vital imformation for new-user like me. Just once question, for changing port(bigger than 1024 for example 65524) , is it as the same as above?