Monday, 6 July 2009

Changing Grid Control Management Console to HTTPS/Port 443



How to change the management port of Oracle Enterprise Manager Central Console to 443

Documentation Reference

http://docs.huihoo.com/oracle/docs/B16240_01/doc/em.102/b16242/postinstall_config.htm#i1025742


http://download-west.oracle.com/docs/cd/B14099_19/core.1012/b13995/ports.htm#BABHCHGA




Ports in use after a default installation

To check which ports are in use by Enterprise Manager check:
$ORACLE_HOME/install/portlist.ini

It will probably look like this:

[Ports]
Oracle HTTP Server port = 7777
Oracle HTTP Server Listen port = 7778
Oracle HTTP Server SSL port = 8250
Oracle HTTP Server Listen (SSL) port = 4444
Java Object Cache port = 7000
Oracle Notification Server Request port = 6003
Oracle Notification Server Local port = 6101
Oracle Notification Server Remote port = 6201
ASG port = 7890
Application Server Control RMI port = 1850
Oracle HTTP Server Diagnostic port = 7200
Log Loader port = 44000
DCM Discovery port = 7100
Oracle Management Agent Port = 1157
Application Server Control port = 1156
Web Cache HTTP Listen port = 7777
Web Cache HTTP Listen (SSL) port = 8250
Web Cache Administration port = 9400
Web Cache Invalidation port = 9401
Web Cache Statistics port = 9402
Enterprise Manager Central Console Port = 4889
Enterprise Manager Central Console Secure Port = 1159




Start by setting your environment right...

export ORACLE_HOME=/u01/app/oracle/product/10.2.0/oms10g
export PATH=$ORACLE_HOME/bin:$PATH
export LD_LIBRARY_PATH=/u01/app/oracle/product/10.2.0/oms10g/lib


Changeing from 1159 to 443...

In a unix environment there is only root that are able to run services on ports below portnumber 1024. So we need to grant root some access rights on apache to be abel to use 443.


oracle01# cd /u01/app/oracle/product/10.2.0/oms10g/Apache/Apache/bin
oracle01# chown root .apachectl
oracle01# chmod 6750 .apachectl
oracle01# ls -la |grep apache
-rwx------ 1 oracle oinstall 12743 Jun 25 12:14 apachectl
-rwsr-s--- 1 root oinstall 1716966 Aug 5 2005 .apachectl
-rwx------ 1 oracle oinstall 12218 Jun 23 2005 apachectl.tmp

Check the port currently in use

oracle01# cat /u01/app/oracle/product/10.2.0/oms10g/install/portlist.ini |grep "Secure Port"
Enterprise Manager Central Console Secure Port = 1159

oracle01$ netstat -lntp|grep 1159
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
tcp 0 0 0.0.0.0:1159 0.0.0.0:* LISTEN 6479/httpd



Stop oms (Oracle Management Service)

oracle01$ emctl stop oms
Oracle Enterprise Manager 10g Release 3 Grid Control
Copyright (c) 1996, 2007 Oracle Corporation. All rights reserved.
Oracle Management Server is Down

Stop Oracle Application Server Web Services

oracle01$ $ORACLE_HOME/opmn/bin/opmnctl stopall
opmnctl: stopping opmn and all managed processes...

Use your favorite text editor and replace all instances of 1159 with 443 in ”$ORACLE_HOME/sysman/config/httpd_em.conf”.


Update your config

oracle01$ /u01/app/oracle/product/10.2.0/oms10g/dcm/bin/dcmctl updateconfig -ct ohs


Use your favorite text editor and replace all instances of 1159 with 443 in ”$ORACLE_HOME/sysman/config/emoms.properties”


Change the secure port

oracle01$ type emctl
emctl is hashed (/u01/app/oracle/product/10.2.0/oms10g/bin/emctl)
oracle01$ emctl secure oms -secure_port 443
Oracle Enterprise Manager 10g Release 3 Grid Control
Copyright (c) 1996, 2007 Oracle Corporation. All rights reserved.
Enter Enterprise Manager Root Password :
Enter Agent Registration password :
OPMN processes successfully stopped... Done.
Securing central oms... Started.
Checking Repository... Done.
Checking Em Key... Done.
Checking Repository for an existing Enterprise Manager Root Key... Done.
Fetching Root Certificate from the Repository... Done.
Generating Registration Password Verifier in the Repository... Done.
Generating Oracle Wallet Password for Enterprise Manager OMS... Done.
Generating Oracle Wallet for Enterprise Manager OMS... Done.
Generating Oracle Wallet for iAS HTTP Server... Done.
Updating HTTPS port in emoms.properties file... Done.
Generating HTTPS Virtual Host for Enterprise Manager OMS... Done.
Securing central oms... Ended.
OPMN processes successfully restarted... Done.

(Enterprise Manager Root Password er det same som passordet som Agent Registration Password.)

Update your config

oracle01$ /u01/app/oracle/product/10.2.0/oms10g/dcm/bin/dcmctl updateconfig -ct ohs

Start oms

oracle01$ emctl start oms
Oracle Enterprise Manager 10g Release 3 Grid Control
Copyright (c) 1996, 2007 Oracle Corporation. All rights reserved.
opmnctl: opmn is already running
Starting HTTP Server ...
Oracle Management Server Already Started.
oracle01$ emctl status oms
Oracle Enterprise Manager 10g Release 3 Grid Control
Copyright (c) 1996, 2007 Oracle Corporation. All rights reserved.
Oracle Management Server is Up.

Check that the new port 443 is in use

oracle01$ netstat -lntp |grep 443
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
tcp 0 0 0.0.0.0:443 0.0.0.0:* LISTEN -

Check your Management Agent

oracle01$ /u01/app/oracle/product/10.2.0/agent10g/bin/emctl status agent
Oracle Enterprise Manager 10g Release 5 Grid Control 10.2.0.5.0.
Copyright (c) 1996, 2009 Oracle Corporation. All rights reserved.
---------------------------------------------------------------
Agent Version : 10.2.0.5.0
OMS Version : 10.2.0.3.0
Protocol Version : 10.2.0.3.0
Agent Home : /u01/app/oracle/product/10.2.0/agent10g
Agent binaries : /u01/app/oracle/product/10.2.0/agent10g
Agent Process ID : 2184
Parent Process ID : 2158
Agent URL : https://oracle01.myserv.com:3872/emd/main/
Repository URL : https://oracle01.myserv.com:1159/em/upload
Started at : 2009-06-25 14:51:08
Started by user : oracle
Last Reload : 2009-06-25 15:16:16
Last successful upload : 2009-06-30 13:23:43
Total Megabytes of XML files uploaded so far : 214.06
Number of XML files pending upload : 22
Size of XML files pending upload(MB) : 0.32
Available disk space on upload filesystem : 90.33%
Last attempted heartbeat to OMS : 2009-06-30 13:35:34
Last successful heartbeat to OMS : 2009-06-30 13:24:04
---------------------------------------------------------------
Agent is Running and Ready

This is still using the old port 1159. So we need to change it...


Stop the agent

oracle01$ /u01/app/oracle/product/10.2.0/agent10g/bin/emctl stop agent
Oracle Enterprise Manager 10g Release 5 Grid Control 10.2.0.5.0.
Copyright (c) 1996, 2009 Oracle Corporation. All rights reserved.
Stopping agent ... stopped.

Use your favorite text editor and replace all instances of 1159 with 443 in ” $ORACLE_HOME/sysman/config/emd.properties”

$ORACLE_HOME is your agent_home (usually something like:
/u01/app/oracle/product/10.2.0/agent10g)

Delete old logs and upload files

oracle01$ rm /u01/app/oracle/product/10.2.0/agent10g/sysman/emd/upload/*
oracle01$ rm /u01/app/oracle/product/10.2.0/agent10g/sysman/emd/state/*

rm: cannot remove `/u01/app/oracle/product/10.2.0/agent10g/sysman/emd/state/storage': Is a directory

Start agent

oracle01$ /u01/app/oracle/product/10.2.0/agent10g/bin/emctl start agent Oracle Enterprise Manager 10g Release 5 Grid Control 10.2.0.5.0.
Copyright (c) 1996, 2009 Oracle Corporation. All rights reserved.
Starting agent ..... started.
oracle01$ /u01/app/oracle/product/10.2.0/agent10g/bin/emctl status agent
Oracle Enterprise Manager 10g Release 5 Grid Control 10.2.0.5.0.
Copyright (c) 1996, 2009 Oracle Corporation. All rights reserved.
---------------------------------------------------------------
Agent Version : 10.2.0.5.0
OMS Version : 10.2.0.3.0
Protocol Version : 10.2.0.3.0
Agent Home : /u01/app/oracle/product/10.2.0/agent10g
Agent binaries : /u01/app/oracle/product/10.2.0/agent10g
Agent Process ID : 8864
Parent Process ID : 8838
Agent URL : https://oracle01.myserv.com:3872/emd/main/
Repository URL : https://oracle01.myserv.com:443/em/upload
Started at : 2009-06-30 13:38:14
Started by user : oracle
Last Reload : 2009-06-30 13:38:14
Last successful upload : 2009-06-30 13:38:24
Total Megabytes of XML files uploaded so far : 6.00
Number of XML files pending upload : 7
Size of XML files pending upload(MB) : 5.24
Available disk space on upload filesystem : 90.33%
Last successful heartbeat to OMS : 2009-06-30 13:38:17
---------------------------------------------------------------
Agent is Running and Ready


Test communication between agent and server by doing a manual upload of the agent

oracle01$ /u01/app/oracle/product/10.2.0/agent10g/bin/emctl upload agent
Oracle Enterprise Manager 10g Release 5 Grid Control 10.2.0.5.0.
Copyright (c) 1996, 2009 Oracle Corporation. All rights reserved.
---------------------------------------------------------------
EMD upload completed successfully

No comments: