Thursday, April 2, 2015

How to Install APACHE 2.2.x on Oracle Linux

+++ Install APACHE 2.2.x on Oracle Linux +++

1. Navigate to http://httpd.apache.org/docs/2.2/install.html and download the Apache server.

2. File downloaded httpd-2.4.10.tar.gz

   $ gzip -d httpd-NN.tar.gz
   $ tar xvf httpd-NN.tar
   $ cd httpd-NN

3. APR utilities for Apache

Navigate : /home/oracle/Desktop/OIAM/Apache/httpd-2.4.10/srclib/apr-util-1.5.4

# Build and install apr 1.2
cd srclib/apr
./configure --prefix=/home/app/Apache-2.4.10/

make
make install

# Build and install apr-util 1.2
cd ../apr-util
./configure --prefix=/usr/local/apr-util-httpd/ --with-apr=/usr/local/apr-httpd/
make
make install

# Configure httpd
cd ../../
./configure --with-apr=/usr/local/apr-httpd/ --with-apr-util=/usr/local/apr-util-httpd/


./configure --with-apr=/home/oracle/Desktop/OIAM/Apache/httpd-2.4.10/srclib/apr-1.5.1 --with-apr-util=/home/oracle/Desktop/OIAM/Apache/httpd-2.4.10/srclib/apr-util-1.5.4


>>> OPTION - II <<<


1. Following the link: http://www.dba-oracle.com/t_gogala_easyphp_apache_linux.htm

2. Download the httpd-2.2.27.tar.gz

3. Create the apache-2.2.27 folder in /home/app

4. [oracle@iam-dev apache-2.2.27]$ tar -zxvf httpd-2.2.27.tar.gz

5. [oracle@iam-dev httpd-2.2.27]$ ./configure --prefix=/home/app/apache-2.2.27/ --with-included-apr

6. [oracle@iam-dev httpd-2.2.27]$ su -

7. Important path to notice: make[1]: Leaving directory `/home/app/apache-2.2.27/httpd-2.2.27

8. [root@iam-dev ~]# mkdir /opt/apache-2.2.27
[root@iam-dev ~]# cd /home/app/apache-2.2.27/httpd-2.2.27
[root@iam-dev httpd-2.2.27]# pwd
/home/app/apache-2.2.27/httpd-2.2.27

9. run # make install

10. To check whether Apache installs successfull, navigate to /home/app/apache-2.2.27/bin
then apachectl start

Ref. Links: https://issues.apache.org/bugzilla/show_bug.cgi?id=42089
            http://stackoverflow.com/questions/9541460/httpd-could-not-reliably-determine-the-servers-fully-qualified-domain-name-us

=== Apache Services check ===
> netstat -nlp | grep 80

If it's used then navigate to httpd.conf file and eidt ServerName to host:9090 (instead of 80)

./apachectl - k start

service httpd start

+++ TROUBLE SHOOTING +++

1. mkdir: cannot create directory `/opt/apache-2.2.29': Permission denied

Add user 'oracle' in httpd.conf and try


https://www.google.com/search?q=Apache+webgate+download&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:unofficial&client=firefox-a&safe=active&gws_rd=ssl

OAM-Protect Apache index.html

++ Assuming you have APACHE server installed ++
[http://vishkrishna.blogspot.com/2015/04/how-to-install-apache-22x-on-oracle.html]

++ Installing Webgate on Apache Server ++

1. Navigate to
/home/oracle/Your_Installers

2. My Middleware home - /home/app/Middleware/Apache22_WebgateR2PS2_Home

3. [oracle@iam-dev Middleware]$ mkdir -p /home/app/Middleware/wg_instance4Apache22

4. Deploy WebGate with ./deployWebGateInstance.sh 

5. Setting Environment Variables
[oracle@iam-dev deployWebGate]$ export LD_LIBRARY_PATH=/home/app/Middleware/Apache22_WebgateR2PS2_Home/webgate/apache/lib


6. Login as ROOT
and navigate to /home/app/Middleware/Apache22_WebgateR2PS2_Home/webgate/apache/tools/setup/InstallTools

[root@iam-dev InstallTools]# sudo ./EditHttpConf -f /home/app/apache-2.2.29/conf/httpd.conf -w /home/app/Middleware/wg_instance4Apache22 -oh /home/app/Middleware/Apache22_WebgateR2PS2_Home -ws apache
The web server configuration file was successfully updated
/home/app/apache-2.2.29/conf/httpd.conf has been backed up as /home/app/apache-2.2.29/conf/httpd.conf.ORIG


7. Now, you could see the difference between original httpd conf and previous httpd conf files;

>
> include  "/home/app/apache-2.2.29/conf/webgate.conf"
\ No newline at end of file
[root@iam-dev InstallTools]#

8. Register the Webgate as 'oracle' user
/home/app/Middleware/Oracle_IDM1/oam/server/rreg/input

[oracle@iam-dev input]$ pwd
/home/app/Middleware/Oracle_IDM1/oam/server/rreg/input
[oracle@iam-dev input]$ cp /home/app/Middleware/Oracle_IDM1/oam/server/rreg/input/OAM11GRequest.xml /home/app/Middleware/Oracle_IDM1/oam/server/rreg/input/OAM11GRequest-Apache.xml

=Start OAM Managed server and run below webgate registration command=

[oracle@iam-dev rreg]$ bin/oamreg.sh inband input/OAM11GRequest-Apache.xml

== Below Success Output ==
------------------------------------------------
Welcome to OAM Remote Registration Tool!
Parameters passed to the registration tool are:
Mode: inband
Filename: /home/app/Middleware/Oracle_IDM1/oam/server/rreg/input/OAM11GRequest-Apache.xml
Enter admin username:weblogic
Username: weblogic
Enter admin password:        
Do you want to enter a Webgate password?(y/n):
n
Do you want to import an URIs file?(y/n):
n

----------------------------------------
Request summary:
OAM11G Agent Name:RREG_OAM11G
Base URL:http://iam-dev:9090
URL String:RREG_HostId11G
Registering in Mode:inband
Your registration request is being sent to the Admin server at: http://iam-dev:7001
----------------------------------------

Apr 01, 2015 12:21:09 PM oracle.security.jps.util.JpsUtil disableAudit
INFO: JpsUtil: isAuditDisabled set to true
Inband registration process completed successfully! Output artifacts are created in the output folder.

== Copy Artifacts ==
Copy cwallet.sso and ObAccessClient.xml from the below path
[root@iam-dev RREG_OAM11G]# pwd
/home/app/Middleware/Oracle_IDM1/oam/server/rreg/output/RREG_OAM11G
To WebGate Instance
/home/app/Middleware/wg_instance4Apache22/webgate/config



== Trouble Shooting ==
1. Error 500/Oracle Access Manager Operation error/URL Not found
 >> 
Login to OAM admin console and Add agent name into 'Hostidentifier'