Friday, November 30, 2012

OAM 11g R2 Lab 7: Change Oracle Logos in Login page and Console or Customize OAM Console

To change Oracle Logo in Login page and inside Admin Console following changes need to be made.

Login Page Logo Change: 

For Login page Oracle logo is in background image. So to change that we need to change Modify Background image(login_logo.png)

We need to modify login_logo.png under two locations: (Following are the locations under windows)


Location 1: D:\Oracle_New\Middleware\user_projects\domains\base_domain\servers\oam_server1\tmp\_WL_user\oam_server_11.1.2.0.0\dcyk8m\war\pages\images

Location 2: D:\Oracle_New\Middleware\user_projects\domains\base_domain\servers\AdminServer\tmp\_WL_user\oam_admin_11.1.2.0.0\7po8nl\war\images

Steps: 

1) Take backup of already existing image (login_logo.png) and rename it(login_logo - Copy.png).


Original Login Page background image: 




Modified Login page background image: (name it as login_logo.png)



Restart the server and try the url localhost:7001/oamconsole/ then you should see now login page

Admin Console Logo change: 


We need to change following css file:

File Location:(In Windows)  D:\Oracle_New\Middleware\user_projects\domains\base_domain\servers\AdminServer\tmp\_WL_user\oam_admin_11.1.2.0.0\7po8nl\public\adf\styles\cache

css file: fusion-desktop-hyko18-en-ltr-gecko-cmp.css

Change background image url with relative/specific or path only for logo-oracle-red.png

Original: background-image:url(logo-oracle-red.png);

I replaced it with google logo :) :

Changed: background-image:url(http://www.soft-go.com/blog/wp-content/uploads/2007/11/google_logo_small.jpg);


Restart both admin server and OAM Server and check logo after login.

Thanks !!!

Create Certificate Using Open SSL, PKCS12, CA Root Signature

Download Windows Version of OpenSSL From 

http://sourceforge.net/projects/gnuwin32/files/openssl/0.9.8h-1/openssl-0.9.8h-1-setup.exe/download?use_mirror=nchc

For Linux Open SSL use following path:

http://www.openssl.org/source/

1) Install Open SSL

2) After installation browse to OpenSSL location path (In windows C:\Program Files (x86)\GnuWin32\bin)

3) Open same path in Command Prompt.

4) Generate RSA Private Key using following command.

cmd> openssl genrsa -out iamidm.key 4096 -des3

Following Output should appear after running the command:


Loading 'screen' into random state - done Generating RSA private key, 4096 bit long modulus
...++
......................................................................................................++e is 65537 (0x10001)

Key should get created with the name iamidm.key in the location where you are running command. 

5) Generate Root Certificate using following Command:

cmd>openssl req -new -config "C:\Program Files (x86)\GnuWin32\share\openssl.cnf" -x509 -days 365 -key iamidm.key -out iamidm.crt

OUTPUT:

Loading 'screen' into random state - done
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [AU]:IN
State or Province Name (full name) [Some-State]:ANDHRA
Locality Name (eg, city) []:HYDERABAD
Organization Name (eg, company) [Internet Widgits Pty Ltd]:IAMIDM
Organizational Unit Name (eg, section) []:IAM
Common Name (eg, YOUR name) []:RAVITEJA
Email Address []:CHINNIRAVIEJA@GMAIL.COM


Certificate will be generated with 1 year validity(as we have given 365 days) and with the name iamidm.crt



6) Create Subordinate CA that is used for signature.

Generate another RSA Key.


cmd>openssl genrsa -out iamidm_sub.key 4096 -des3

output:
Loading 'screen' into random state - done
Generating RSA private key, 4096 bit long modulus
...............................................................................................................................++
.............................++
e is 65537 (0x10001)


Check output file that would have generate with the name iamidm_sub.key


Generate another certificate using above key :

cmd> openssl req -new -config "C:\Program Files (x86)\GnuWin32\share\openssl.cnf"  -key iamidm_sub.key -out iamidm_sub.csr

7) Generate Certificate now:


cmd>openssl x509 -req -days 365 -in iamidm_sub.csr -CA iamidm.crt -CAkey iamidm.key -set_serial 01 -out server.crt


OUTPUT:

Loading 'screen' into random state - done
Signature ok
subject=/C=IN/ST=ANDHRA/L=HYD/O=IAMIDM_SUB/OU=IAM/CN=RAVI/emailAddress=CHINNIRAV
ITEJA@GMAIL.COM
Getting CA Private Key


Now server.crt should get generated.

Package the keys and certs in a pkcs12 file


cmd>openssl pkcs12 -export -out iamidm_sub.p12 inkey iamidm_sub.key -in server.crt -chain -CAfile iamidm.crt

Loading 'screen' into random state - done

Enter Export Password:
Verifying - Enter Export Password:


iamidm_sub.p12 will get generated. 

Thanks !!

OHS Reverse Proxy for Weblogic with out SSL

In Windows:

  • Go to path where mod_wl_ohs.conf location. (Example path in windows: D:\Oracle_New\Middleware\Oracle_WT1\instances\instance1\config\OHS\ohs_new)

Update the parameters as follows: (Remove all # codes as they are comments)

<IfModule weblogic_module>
      WebLogicHost weblogic hostname
      WebLogicPort weblogic port
      Debug ON
      WLLogFile /tmp/weblogic.log
      MatchExpression *.jsp
</IfModule>


<Location /console>
      SetHandler weblogic-handler
      PathTrim /console
      PathPrepend /console
      ErrorPage  http://www.myweblogic.com:7001/noconsolepage.html
</Location>
  • Restart OHS Server using opmnctl.bat/opmnctl.sh (in linux) (Path in windows: D:\Oracle_New\Middleware\Oracle_WT1\instances\instance1\bin)

Restart Commands: (go to above path and use following commands)

1) opmnctl.bat stopall

2) opmnctl.bat startall

3) opmnctl.bat status (check Status)

Try the url: localhost:7777/console and weblogic console should be displayed. :) 




Thanks !!! 

Wednesday, November 28, 2012

OAM 11G R2 Lab 6: Webgate for IIS 7.x in 32 Bit Windows

IIS Server need following webgate

64 Bit Components:(if 64bit)

Oracle_Access_Manager10_1_4_3_0_Win64_ISAPI_WebGate.exe

32 Bit Components: 

Oracle_Access_Manager10_1_4_3_0_Win32_ISAPI_WebPass
Oracle_Access_Manager10_1_4_3_0_Win32_ISAPI_Policy_Manager
Oracle_Access_Manager10_1_4_3_0_Win32_ISAPI_WebGate

Webpass and Policy Manager required for old versions of OAM.

Go to Path: C:\Windows\System32\inetsrv\config, take backup of applicationHost.config file and remove  from the file and save it. 

Add IIS6 Management Compatibility under Management Tools under Add Service Role for IIS Server in Server Manager.

Run Installer Oracle_Access_Manager10_1_4_3_0_Win32_ISAPI_WebGate and

->select path where to install while installing.

-> Select Mode of Security.

-> Provide Webgate id and other details and make sure that your access manager server is running.


WebGate ID: Agent name which is already created in OAM console.
Password for WebGate: Any Password
Access Server ID: Any Name
Host Name: Host name of access server.
Port Number: OAM proxy-port, default value 5575 .(Can be checked in proxy of OAMConsole-> System Configuration -> Server Instance)


For Proceed with Automatic update of IIS Configuration select Yes.

Click Next, Next and Finish.

Note: Open IIS Server Manger and click on ISAPI Filter and Point OracleWebgate to correct path C:\Program Files\NetPoint\Webgate\access\oblix\apps\webgate\bin\webgate.dll

Restart IIS Server and try accessing any URL.

Unprotect/Remove Webgate temporarily for iis: If you want to unprotect just remove isapi filter pointing to webgate.dll which makes it unprotected/Webgate dont work for IIS.

Thanks !!!

Tuesday, November 6, 2012

Basic Web services and Building sample Web service in Eclipse (Java)

Webservice is some program interface, which uses SOAP protocol for communication. Using soap, you can communicate with any program, no matter on which language it is written.

What are Web Services?


  • Web services are application components
  • Web services communicate using open protocols
  • Web services are self-contained and self-describing
  • Web services can be discovered using UDDI
  • Web services can be used by other applications
  • XML is the basis for Web services


Advantages and Disadvantages of Webservice:

http://social.msdn.microsoft.com/Forums/en-US/asmxandxml/thread/435f43a9-ee17-4700-8c9d-d9c3ba57b5ef


What is WSDL?
  • WSDL is an XML-based language for locating and describing Web services.
  • WSDL stands for Web Services Description Language
  • WSDL is based on XML
  • WSDL is used to describe Web services
  • WSDL is used to locate Web services
  • WSDL is a W3C standard
What is SOAP?

SOAP is an XML-based communication protocol and encoding format for inter-application communication. Originally conceived by Microsoft and Userland software, it has evolved through several generations; the current spec is version, SOAP 1.2, though version 1.1 is more widespread. The W3C's XML Protocol working group is in charge of the specification. SOAP is widely viewed as the backbone to a new generation of cross-platform cross-language distributed computing applications, termed Web Services.


Service Requester:
 
Service Requester can be considered as Client which request service.

Service Provider: 

Service Provider can be considered as Server which provides service for the Client. 

Creating Web Service in Eclipse: 

Step 1: 

Download Eclipse IDE from the following link and install it: 


Step 2: 

Download Tomcat Core zip from http://tomcat.apache.org/download-60.cgi and Unzip to some folder in your system.

Example Path: D:\Dump\apache-tomcat-6.0.36\apache-tomcat-6.0.36

Step 3: 

Download Axis 2 from http://apache.techartifact.com/mirror//axis/axis2/java/core/1.6.2/axis2-1.6.2-bin.zip , unzip to some folder in your system: 

Example Path: D:\Dump\axis2-1.6.2-bin\axis2-1.6.2

Step 4: 

Start Eclipse and create Workspace: 

Create Run Time for Tomcat server: 

In Eclipse

Open Window -> Preferences -> Server -> Runtime Environments -> Click Add

Select Apache Tomcat v6.0 and click Next

 Provide Tomcat unzip location for Tomcat Installation directory and click Finish.


Apache Tomcat v6.0 should appear in Server Runtime Environments:


Step 5: Creating a bottom up JAVA bean Web service and Web service client using Axis2 WTP Tools 

Open Window -> Preferences -> Web Services -> Axis2 Preferences

provide axis 2 unzip path for Axis 2 Runtime Location(as shown in figure below): 



Step 6: 

In Eclipse File -> New -> Other -> Dynamic Web Project -> 


Click Next

->Provide 

Project name: WebServiceServer

Target Runtime: Apache Tomcat v6.0




Click Finish

Step 7: 

WebServiceServer should appear in work space:


Open Java Resources -> Under Src create new java class and name it as RequestHandler.java


Under RequestHandler.java provide following Code: 

package tdc.test.server;

import java.util.Date;
import java.text.SimpleDateFormat;

public class RequestHandler {

public String reverseYourName(String name){
return new StringBuffer(name).reverse().toString();
}
public String getCurrentDate(){
Date date=new Date();
SimpleDateFormat dateFormat=new SimpleDateFormat("dd-MMMM-yyyy h:mm a");
return dateFormat.format(date);
}
}

Figure: 



Make sure that Class file got generate for this file.

Step 8: 

Right click on RequestHandler.java and select Web services -> Create Web Service (As shown in figure below) 


Step 9: 

Select Server runtime as Tomcat v6.0 Server

web Server runtime as Apache Axis 2

as we have already configured those two run times. Click Finish


Step 10: 

Following files need to be created. 

Right Click on WebServiceServer -> Run As -> Run on Server after that click Finish. 



Output: it should display following page: 


Step 11: 

Test if Web service server got created properly or not using following URL: 

http://localhost:8080/WebServiceServer/services/RequestHandler?wsdl

Output: should display xml file format as shown in figure



Step 12: Now we are going to Create Client

For creating client we are going to create normal Java Project:


 Project Name: WebServerClient and click Finish.


Step 13: 

Copy Wsdl file from other project (WebServiceServer) and paste it inside src as shown in figure. 


Step 14: 
Right Click on RequestHandeler.wsdl file and select Webservice -> Generate Client



It should create following files as shown in image below: 



Step 15: 

Create a java class in Client Java Project (WebServerClient) with the name ServiceRequester.java



Step 16:

Keep following code inside ServiceRequester.java which calls webservice we have created: 

package tdc.test.client;

import java.rmi.RemoteException;
import javax.xml.rpc.ServiceException;
import tdc.test.server.RequestHandler;
import tdc.test.server.RequestHandlerServiceLocator;


public class ServiceRequester {

public static void main(String args[]) throws ServiceException,RemoteException{
RequestHandlerServiceLocator locator=new RequestHandlerServiceLocator();
RequestHandler requestor=locator.getRequestHandler();
String currentDate=requestor.getCurrentDate();
String reverseName=requestor.reverseYourName("Techdemocracy");
System.out.println("Current Date: "+currentDate);
System.out.println("Reverse Name: "+reverseName);
}
}

Image: 



Run java Class ServiceRequester.java and see the ouput it will contact Server (Web Service) and displays output: 

output: 

Current Date and Reverse name provided..


Note: Before running java class make sure that Application server is running and following URL is working: http://localhost:8080/WebServiceServer/services/RequestHandler?wsdl


Thanks !!!! 

Other Posts