Changing the port at Which OC4J applications listen to (to 80) May 1, 09

At one customer site, we had installed Oracle application Server 10.1.3.1 to run our oracle ADF applications

After the default installation, the port available by default is 7780. Therefore, deployed application can be invoked using this port. A typical request would be

http://servername:7780/context_name/faces/index.jspx


The customer then requested that we only use port 80 rather than 7780

Unlike standalone OC4J, the Request for the application goes through Apache, therefore, if we need to change the port to something else, it is the Apache port that needs to be changed and not the OC4J port. The apache engine will communicate internally with the Oc4J port (which is traditionally = 8888)

Background:

Through metalink search, we found DOC ID  564570.1  which states the following

In the configuration file default-web-site.xml (or http-web-site.xml, this depends on which file is referenced for the web site from server.xml) add a "host" attribute to the element <web-site> like this:

<web-site xmlns:xsi="..."
 xsi:noNamespaceSchemaLocation="..."
 protocol="http"
 host="127.0.0.1"
 port="8888"
 display-name="OC4J 10g (10.1.3) Default Web Site"
 schema-major-version="10"
 schema-minor-version="0">

 

However, this does not seem to be the solution in our case, because as I said in the beginning, we not really interested in changing the OC4J port, because our installation is not truly standalone, it is the Apache that we need to change

 

Therefore, attention should now go to the   httpd.conf   file which as you all know is located in

$HOME/Apache/Apache/conf

 Edit the httpd.conf file and file the Port and listen directive to 80 or (81)

 # Port: The port to which the standalone server listens. For

# ports < 1024, you will need httpd to be run as root initially.

#

# This port is used when starting without SSL

Port 80

Listen 80

 Start the services again and Surprise Surprise, the http wont start!

 

This is another issue know to Apache:- All services that operate on ports < 1024 are protected services and need to be run as super user.

 What to do?

 You need to locate the file called   .apachectl   (not that there is a dot as a prefix) and change its permission so that it runs as root

 #Chown root .apatchctl

#Chmod  6750 .apatchctl

 When you do ls l, you will find the following

 [oracle@asdb bin]$ ls -l .apachectl

-rwsr-s---  1 root dba 1703780 Sep 18  2006 .apachectl

[oracle@asdb bin]$

 

NOTE:   at this point, you need to understand that both port 80 and 8888 are listening,  port 80 for Apache and port 8888 for OC4J

Your request will go to 80, then http thorough the mod_oc4j extension will communicate with oc4j through 8888.

 To find if services are using the port alreadly

You can use

 Netstat na|grep 8888

Netstat na|grep 80