Switching Oracle HTTP Server to Port 80

Posted by Dirk Nachbar on Sunday, March 06, 2011
If you are using the Oracle Webtier 11g (11.1.1.2.0 / 11.1.1.3.0 / 11.1.1.4.0) in your projects and specially the Oracle HTTP Server, you face normally the problem, that the Oracle HTTP Server is configured with a Listen Port of 7777 or something like this.
But endusers dont like to remember always the Port number of the Oracle HTTP Server, so the goal is to reconfigure the Oracle HTTP Server. Under a UNIX operating system you have to consider one important point for this task, all ports <1024 belongs to root and normally the Oracle Webtier is installed under a own user (normally user oracle) which don't have root privileges. So the ownership of the .apachectl binary must be changed.

Following steps must be done:
  • Shutdown your Oracle HTTP Server
  • Reconfigure the Listen Port
  • Change the .apachectl binary
  • Restart your Oracle HTTP Server and test
The first step is to shutdown the Oracle HTTP Server, this must be done with opmnctl. The binary you can find under your WebtierHome/instances/instance1/bin.
Connect as the Oracle software user (oracle) to your server

# assuming your MW_HOME is /u00/app/oracle/product/fmw-11.1.1 
export MW_HOME=/u00/app/oracle/product/fmw-11.1.1
cd $MW_HOME/Oracle_WT1/instances/instance1/bin
./opmnctl stopall


Second step is to configure the Listen Port for the Oracle HTTP Server to port 80

# assuming you are still connected as oracle user to your sevrer
cd $MW_HOME/Oracle_WT1/instances/instance1/config/OHS/ohs1
cp httpd.conf httpd.conf.save
vi httpd.conf
# Now go to the line with Listen <portnumber> (normally 777x)
# and replace the port number to port 80
Listen 80
# save the changes


The third step is to change the ownership and permissions of the .apachectl binary, this step must be done as root user:

# assuming you are connected to the server as root user
# use the MW_HOME from step 1
cd $MW_HOME/Oracle_WT1/ohs/bin
# be aware, we have to modify the hidden file .apachectl (the dot is correct) 
ls -la .apachectl
-rwxr-x--- 1 oracle oinstall 13278 Dec 17 03:54 .apachectl
chown root .apachectl
chmod 6750 .apachectl
ls -la .apachectl
-rwsr-s--- 1 root oinstall 13278 Dec 17 03:54 .apachectl

The last step is to startup your reconfigured Oracle HTTP Server, for this you must connect to your server as Oracle Software user:

cd $MW_HOME/Oracle_WT1/instances/instance1/bin
./opmnctl startall
# Then check the status with the option -l
# to see if your Oracle HTTP Server is up and
# the option -l display the used ports (see picture below)
./opmnctl status -l



The final test is, startup your browser and point to your Oracle HTTP Server