Thursday 21 August 2014

Integrating OAM 11G R2PS2 Webgate Impersonation Module in IIS7.5 Windows 2008 R2

Lets start the process: Just follow below steps :-)

1)  Follow Steps for Pre-requisites (Windows Server 2008 R2)

·         IIS 7.5 Server Role Configuration  
·         IIS7.5 Site Configuration -

2)  How to Perform –

·         Enabling Impersonation Module

3)  Troubleshooting Section (to be updated soon)


4) Configuring DCC Webgate in IIS 7.5-

IIS7.5 Global Site Default Configuration

Global Site Configuration Steps:

    1)      Considering IIS Server Role is already added to your Windows Server 2008 R2 Box. 
          In case not than open below mention link.

    2)     As we have added the IIS role in our Windows Server, now we need to create a site using which we will do the configuration with webgate.
    
    3)      Go to Start -> Internet Information Services (IIS) Manager

4)     Explore the localhost connection



     5)      Adding support for perl & cgi execution -> Go to Handler Mappings


  • In case you see, ISAPI.dll as disabled than enable it. Either you can enable it at global level or it can be enable per site basis as well.
  • Now we need to add the support for cgi & perl script execution. Their support can be added at global or per site level basis.
  • We are adding them at global site level.
    •  Add Script Map for .pl & .cgi support







      ·         Checking Execute Permission


Check whether execute permission is granted or not to both .cgi & .pl handlers. In case it is not, than provide it execute permission.





You are done with Global Site Configurations...........!!!!!!!!!!!


Enjoy :-)

IIS7.5 Server Role Configuration

Configuring IIS Role in Windows Server 2008 R2

   1)        Click Start -> All Programs -> Administrative Tools -> Server Manager.




   2)      In the Server Manager window, right click Roles -> Add Roles. It will open a new window “Before you Begin”


     Press Next

    3)      Select Web Server (IIS) on the Select Server Roles page


Press Next

   4)      Select the IIS services to be installed on the Select Role Services page
Add all the roles services as seen in the BELOW pictures.




     Press Next, once the desired roles are added.

5)      Add any required role services.



6)      Proceed Next, IIS is now installed with a default configuration for hosting ASP.NET on Windows Server. Click Close to complete the process.

7)      Confirm that the Web server works by using http://localhost.



8)      Now you can see that in the Server Manager -> Roles -> Web Server (IIS) is listed.

    •           And you can verify the Role Service added to it as well.



Now you are done with the IIS Server Role Configuration.............!!!!


Enjoy :-)

Using C/C++ Resolver API - DNS IP Switch Over

  Explanation:


Usually for obtaining IP Address of a remote host makes us to use gethostbyname() function call.
It actually gets the IP Address by looking up the DNS. But but…. This happens for the first time only, next time onward's it reads the IP Address from the cache i.e. maintained by “nscd”. 
Till the time it is available their the request is fulfilled. Once the cache is cleared, again DNS look up is performed.

So consider the case where our software is making gethostbyname() call & suddenly a switch over is made at DNS. But as our software is reading the IP address from the cache thus we are unaware of the switch. 
In this case it is possible that the software keeps on requesting the old IP, till the cache is not cleared & a fresh look up call is made.
To avoid such scenario, C/C++ has an inbuilt library i.e. “resolver api (libresolv.a/libresolv.so)”. 

It has the required function calls which do the DNS lookup & provide the required info like IP addresses, hostname, Start of Authority Record, Name-server’s list etc.. etc…..
This API is really powerful & useful utility. If someone has used DIG Command than one can easily relate to this as well.
All the options available with DIG, can be performed with this Resolver API as well.

Eg: This sample program prints the IP Address for the provided hostname.

#include<cstdlib>
#include<iostream>
#include<string>
#include <algorithm>

using namespace std;

int main(int argc, char **argv){ 
    u_char nsbuf[NS_PACKETSZ]; /* Response Buffer NS_PACKETSZ=512 ( maximum packet size) */
    char dispbuf[4096];         /* buffer to display the resource record */
    char ipadd[INET_ADDRSTRLEN]; /* saves the Host Address for IPv4 */
    string readall;

    ns_msg msg; /* handle for response message */
    ns_rr rr; /* expanded resource record */
    int i, j, l;

    char * hostname=argv[1];

    /*
     * Look up the records for the given domain name.
     * We expect the domain name to be a fully qualified, so
     * we use res_query(  ).  If we'd wanted the resolver search
     * algorithm, we would have used res_search(  ) instead.
     */
         //l=res_search (argv[i], ns_c_any, ns_t_a, nsbuf, sizeof (nsbuf));
        l = res_query ( hostname, /* domain name   */
                        ns_c_any,  /* Internet class records     */
                        ns_t_a,  /* Look up Host address */
                        nsbuf,  /*response buffer*/
                        sizeof (nsbuf)  /*buffer size    */
                       );

        if (l < 0) {
            perror (hostname);
        } else {

        /*
         * Initialize a handle to this response.  The handle will
         * be used later to extract information from the response.
         */

            ns_initparse (nsbuf, l, &msg);

         /* Count total answers received in the record. */
            l = ns_msg_count (msg, ns_s_an);

        for (j = 0; j < l; j++) {
        /*
         * Expand the answer section record into rr.
        */
                ns_parserr (&msg, ns_s_an, j, &rr);

                 /* fill the buffer with the record data */
                ns_sprintrr (&msg, &rr, NULL, NULL, dispbuf, sizeof (dispbuf));

/*              ns_sprintrrf(ns_msg_base(msg), ns_msg_size(msg),ns_rr_name(rr), ns_rr_class(rr), 
ns_rr_type(rr),ns_rr_ttl(rr), ns_rr_rdata(rr), ns_rr_rdlen(rr),NULL, NULL, dispbuf,sizeof(dispbuf));
              printf ("%s\n", dispbuf);
*/
                cout<<dispbuf<<endl;

        /* Get the Host IP Address */
inet_ntop(AF_INET,ns_rr_rdata(rr),ipadd,INET_ADDRSTRLEN);

//              printf("%s\n",ipadd);

                readall += ipadd;
                readall.erase(remove(readall.begin(), readall.end(), '\n'), readall.end());
                readall.append(";");
                //cout<<ipadd<<endl;

            }
        cout<<readall<<endl;
  } 

}

Complie & Link: g++ socket.cpp -o socket_pgm /usr/lib64/libresolv.a 

 Execute: ./socket_pgm <hostname>
               ./socket_pgm www.google.com



More Info: man resolver


Enjoy............. :-)

Friday 1 August 2014

Configure Simple Mode Communication for OAM 11G R2PS2


Let's Start................

Open the oamconsole (http://<host.domain:7001>/oamconsole)

1) Go to Server Instances:


2) Open your Server Instance:




3) Change the Mode to Simple Mode:



      3.a) Apply the changes:




4) Go to Access Manager Settings:





      4.a) Provide the Global Passphrase:


        4.b) Apply the changes


5) Now Go to SSO Agents:


    5.a) Open your SSO Agent



 
     5.b) Change the Mode to Simple


    5.c) Apply the changes.

6) Restart the managed server.

7) Now we need to copy the artifacts generated in <MW_HOME>/user_projects/domains/base_domain/output/<webgate_profile_name>/

    a) cwallet.sso
    b) ObAccessClient.xml 
    c) password.xml 
   
   Copy them to the config folder of Webgate instance directory i.e.
<MW_HOME>/Oracle_WT1/instances/<instance_name>/config/OHS/ohs1/webgate/config
above path is for non windows server.
For Windows Server (say IIS) - C:\oracle\product\11.1.1\<webgate_instance_name>\config\

8) Similarly copy aaa_cert.pem & aaa_key.pem files to simple folder in Webgate instance config folder.

9) Restart the Web Server Instance.


 Your Simple Mode Security Communication is configured & ready to use.

For detailed information you can refer to following link:


Enjoy ............... :-)


Saturday 19 July 2014

Creating Service Accounts for SharePoint 2013 on Windows Server 2012 R2

This post is a part of the series Integrating SharePoint 2013 with OAM 11g R2PS2 so i hope you have followed the steps mentioned their.

Q- Why is their need to create Service Accounts before installing SQL Server 2012 & SharePoint?
Ans- The reason for this is, we will be using these accounts references in their configurations steps.

As of now we have setup our AD on Windows Server 2012 R2, so we will use it for accounts creation.

Before we start 2 things we must know, i.e. 

  • We will be creating 2 users, one for SQL Server 2012 setup & other one for SharePoint 2013.
  • The user for SQL Server will be having admin rights, while the sharepoint user will be w/o it.


Let's Start the process..............................


Create User Account for SQL Server 2012 Setup :-


1) First log in to your host machine with the user you have created Create User Account



 2) Once your are logged into your system, Go to Server Manager -> Tools. Select Active Directory Users & Computer Option.


3) Active Directory Users & Computers: Using this program we will be adding service accounts aka users in our AD.

  Select Users option in your left pane, on selecting it users existing in your AD will be displayed.

4) Create User with Admin Rights: This user will be required for SQL Server 2012 Configuration.
Right click the "Administrator" User already created, and click copy.



 Once you have clicked copy, it will open an add user window. 



6) Create User - Now provide user log in name, i used "sqlAdminAcc" name for admin user that will be used in SQL Server Config.



    Press Next -> Now provide password for the user & remember select "Password Never Expires" radio button.



    Press Next -> It will ask you to confirm the details. If all is well, press finish.



7) Your User is created.............



    Right Click the newly created user i.e. "sqlAdminAcc" and click "Properties".



   Hey, did you noticed that this user is member of "Administrator Group" ....... So we are done.....!!!!


Create User Account for SharePoint SetUp:


1) You are already logged into the host machine and Active Directory User & Computers program is running.




2) Create a New User:



    Click Users on the left Pane. Right click Users -> Select New -> Choose User option

3) Enter User Details:-



     Provide login name -> "
spFarm". This is the user i will be using for SharePoint Setup Configuration.



    Press Next -> Provide Password Details



   
Note: Remember to select "Password Never Expires" radio button and untick "User must change password at next logon".

    Press Next -> You will be asked to confirm the created user details. If all is well, press finish.


4)
Congrats you have successfully created the user..............




Now we will proceed to
Install & Configure SQL Server 2012 on Windows Server 2012 R2

Enjoy :-)