Tuesday, 17 April 2012

How to Enable 1 way-SSL in Weblogic Server


Steps for configuring Inbound SSL in FMW

Scenario:
We have a Development Environment which has One Admin Server and three managed Server.
Admin Server runs on port 7001.
Managed Server1 (soa_server1) listens on port 8001
Managed Server2 (osb_server1) listens on port 8011
Managed Server3 (bam_server1) listens on port 9001

We need to configure osb_server1 to listen on ssl port 8012 using Custom Certificate to secure our webservices.
This certificate will be sent to business providers who will import it in their trusted Keystore.
Only the business partners who have this certificate imported in their trust store should be successfully able to invoke the webservice else they should get SSLHandshakeException

Steps Followed to generate a web service certificate:
1. CREATING A PRIVATE KEY IN KEY STORE:
<JAVA_HOME>\bin\keytool.exe -keystore <Path to a (new) key store> -storepass <(New) key store
password> -genkey -alias <Arbitrary Name> -keyalg RSA -dname <DN of certificate>

Concrete Example:
$ keytool -keystore  “/Oracle/Middleware/wlserver_10.3/server/lib/server_keystore.jks" -storepass "weblogic1" -genkey -alias "webservice_nexus" -keyalg RSA –dname "CN=fus@isdev,OU=webServices,OU=pkiObjects,DC=Nexus,DC=com"

2. CREATING A CERTIFICATE SIGNING REQUEST (CSR):
<JAVA_HOME>\bin\keytool.exe -keystore <Path to the key store> -storepass <Key store password>
-certreq -alias <Alias name from private key> -keypass <Password of private key> -file <Path
to CSR file to be created>

Concrete Example:
$ keytool  –keystore  "/Oracle/Middleware/wlserver_10.3/server/lib/server_keystore.jks " -storepass "weblogic1" -certreq -alias "webservice_nexus" -keypass "weblogic1" -file "/Oracle/Middleware/wlserver_10.3/server/lib /webService.csr"

3. GENERATING A CERTIFICATE:   
Submit the CSR file created in the last step to any of the trusted Certificate Authority.certificate authority will use a CSR to create your SSL certificate, but it does not need your private key. You need to keep your private key secret.
Download the certificate on the local hard drive.

4. INSTALLING WEB SERVICE CERTIFICATE IN KEY STORE:
<JAVA_HOME>\bin\keytool.exe -keystore <Path to the key store> -storepass <Key store password>
-import -alias <Alias name from private key> -keypass <Password of private key> -file <Path to
CER file containing the WSC>

Concrete Example:
$ keytool -keystore "/Oracle/Middleware/wlserver_10.3/server/lib/server_keystore.jks" -storepass "weblogic1" -import -alias "webservice_nexus" -keypass "weblogic1" -file "/Oracle/Middleware/wlserver_10.3/server/lib/Certificates/webservice_nexus.cer"

After Adding the certificate in the keystore, you can list the certificate by giving the following command:

5. LISTING THE CERTIFICATE:
<JAVA_HOME>\bin\keytool.exe –v –list -keystore <Path to the key store> -storepass <Key store password>

Concrete Example:
$ keytool –v –list –keystore server_keystore.jks 


After successful creating and adding the certificate in the keystore, we need to configure the server to use the custom keystore which we created.

  •          Login to the admin Console.
  •          Enter admin usename and password
  •          In the Home Page, go to Servers  --> osb_server1
  •          Go to keystores in the Configuration tab
o   Change the keystore to Custom Identity and Standard Java Trust
o   Enter the following details for Identity Keystore:
§  Custom Identity Keystore : /Oracle/Middleware/wlserver_10.3/server/lib/server_keystore.jks
§  Custom Identity Keystore Type: JKS
§  Custom Identity Keystore Passphrase: <password for keystore>
§  Confirm Custom Identity Keystore Passphrase: <password for keystore>
o   Save all the configurations.

  •         Now go to SSL in Configuration Tab
o   Enter the details for Private Key Alias : webservice_nexus
o   Enter the passphrase : <password for private key>
o   Go to advance, In hostname verificate make it NONE(if not already so).
o   Save all the changes made.

  •          Now go to General in Configuration Tab.
  •         Check the SSL Listen Port Enabled box
  •          SSL Listen Port should be 8012, if not enter it.
  •          Save all the changes.
  •          Finally restart the osb_server1.

Monday, 27 February 2012

How to Change/Update Password for AIA 11.1.1.4

If you are reading this, then you probably have gone through our previous POST.


When we change or update the weblogic Administrator Password, we need to update the AIA password as well because AIA installation is done on SOA which uses weblogic Password to Connect to SOA Server.

In the Oracle Guide they have mentioned two approaches to change the password.

First one did not work for me.

Let me discuss what actually worked.

Please follow the below steps exactly to successfully change or update the password for AIA:


  1. First, make sure that you have XManager installed if you have a remote server as we will be needing GUI.
  2. Go to the following location:
    AIA_HOME/util/UpdateStore
  3. Run the below command:
    ant -f $AIA_HOME/util/updateStore.xml updateStore -DAdminUsername=weblogic -DAminPassword=<the 'weblogic' user's password>
    Here 
    DAdminUsername is the weblogic Admin username(old username)
    and 
    DAminPassword is the weblogic Admin password(old password)
  4. A GUI window will pop up, there please enter the user id and password and then the XPATH for the password from the AIAInstallProperties.xml (i.e. /properties/fp/server/password)
    When the process is complete you should see the encrypted password in the AIAInstallProperties.xml file:
    <username>weblogic</username>
    <password>[C@29c58e</password>
  5. Repeat step 3 till all the weblogic password's are encrypted in the AIAInstallProperties.xml file.

Please let us know if you face any issues while updating the AIA password.





Wednesday, 15 February 2012

How To Change Weblogic Admin User's password

Often we have situation when we want to change the weblogic administrator's password. We give the default password while installation and later it becomes a problem to change it.

This is the situation which we faced in our development server.

Our server setup is such as, we have an Admin Server and three managed server(osb,bam,soa) on it.
It is a single node setup. Domain name is admin_domain

Follow the below steps to change the weblogic password:
  1. Login to the Oracle 11g Adminintration Console with the weblogic username and password,
    Navigate to    Secuity Realms-->myRealms(realm name)-->Migration(tab)-->Export(tab)
    Here please provide a Directory location for “Export Directory on Server:” TextBox (Example: /tmp)
    Click on “Save” button…you will find that in the Directory which you have specified you will get :

    DefaultAuthenticator.dat
    DefaultCredentialMapper.dat
    exportIndex.dat
    XACMLAuthorizer.dat
    XACMLRoleMapper.dat
  2. Now Shut Down all the servers which are running.
  3. Take the backup of Domain Directory.
  4. Navigate to the bin folder in the domain directory. i.e $Middleware_Home/user_projects/domain/admin_domain/bin
  5. Execute setDomainEnv.sh file in the command prompt. Make sure weblogic.jar is present in ClassPath.
  6. Navigate to  $Middleware_Home/user_projects/domain/admin_domain/security.
  7. Just for the safety take the backup of DefaultAuthenticatorInit.ldift file, because in the next step we are going to create new file "DefaultAuthenticatorInit.ldift"
    mv  DefaultAuthenticatorInit.ldift  DefaultAuthenticatorInit.ldift.bkup
  8. In the same directory give the following command :
    java weblogic.security.utils.AdminAccount newAdminUser newAdminPassword .           
    (make sure to give the '.' at the end)
    Here, newAdminUser -->the new user you want instead of weblogic
    newAdminPassword-->the new Password which is required to authenticate the Admin user
  9. Navigate to the  following path $Middleware_Home/user_projects/domain/admin_domain/servers/AdminServer/security. Here update the boot.properties file with the new username and password.
  10. Repeat step 9 for all the managed servers.
  11. Take the backup of the following directory  $Middleware_Home/user_projects/domain/admin_domain/servers/AdminServer/data/
    mv data data_bkup
  12. Time to Start the Admin Server.As we have already made an entry in the boot.properteis file, it will not ask for user name and password.
  13. Login to Admin Console by giving the new user name and password.
  14. Import the users and groups back by navigating to :
     Secuity Realms-->myRealms(realm name)-->Migration(tab)-->Import(tab)

    Provide the folder name (/tmp) where we have stored the above files.
    DefaultAuthenticator.dat
    DefaultCredentialMapper.dat
    exportIndex.dat
    XACMLAuthorizer.dat
    XACMLRoleMapper.dat
  15.  Now Go To,
    Home-->Domain-->Security(tab)
    In the advance section, give the new node manager username and password.
    After successfully completing these steps you should be able to change Weblogic Username's password.
  16. If you have AIA also installed on SOA, you need to follow some additional steps for AIA to change AIA password.
    Will cover that in separate POST.
    Enjoy :)


Wednesday, 1 February 2012

Fusion Middleware Administrator Interview Questions


Weblogic Interview Questions:

Based on personal experience we are sharing some of the Interview Questions for Fusion Middleware Adminstration. 
  • What is the difference between 10g and 11g
  • What is the role of mds in fmw
  • What are the main components of fmw and their usage in brief
  • Explain the procedure for installation of ofmw components in a cluster environment
  • What is Node Manager
  • What is Path of Node Manager home and how to start node manager
  • How to know if the node manager is running or not
  • script to connect to the node manager and start the admin and managed servers and print the server status
  • Concept of Server Migration
  • What is the use of Admin Console in a domain
  • How to start the node manager as an operating system service
  • questions on JVM and heap size
  • How to start the admin server from the secondary node in a cluster
  • syntax of nmConnect and nmEnroll
  • What is a SOA composite
  • Path of the server related log files
  • What is synchronus and asynchronus process in BPEL
  • Basic commands in solaris like checking the CPU usage RAM consumption
  • Have you worked on weblogic patching and if yes how does it go on
  • Basic questions on database
  • List the various adapters used
  • What is the difference between Prod mode and Dev mode

Tuesday, 24 January 2012

Configuring Node Manager for High Availability of Servers

Node Manager is a WebLogic Server utility that enables you to start, shut down, and restart Administration Server and Managed Server instances from a remote location. Although Node Manager is optional, it is recommended if your WebLogic Server environment hosts applications with high availability requirements.

A Node Manager process can automatically monitor, shutdown, and restart only those Managed Servers that it started. It cannot provide these services for Managed Servers booted directly from the command line.

Configure the Node Manager to connect to the Weblogic domain:
If you are connecting the node manager to the domain for the first time, the Admin Server of the domain should be up and running.
To start the Admin Server, Navigate to the below location:

$ cd MWHOME/user_projects/domains/soa_domain/bin
To start the server, give the below command:

$ ./startWebLogic.sh &

This would start the Admin Server as a background process. The Admin Server would be started once the console shows “Running Mode”
  • Once the Admin Server is started, open a new session in order to connect to the domain through the Node Manager
  • Navigate to “MWHOME/wlserver_10.3/common/bin”

Run the wlst.sh as shown below




  • The next step is to connect to the domain on which the Admin Server is up and running. To connect to the domain please use the syntax as below:
    •  connect('weblogic','<password>','t3://<host name>:<Port on which admin server is running>')
  • After connecting to the Admin Server, we need to enroll the domain with the nodemanager. To enroll the node manager use the below syntax:
    • nmEnroll('<path to the domain>')

Procedure to start and stop the servers:
  • Once the domain is enrolled with the node manager, the next step is to start/stop the servers using the wlst and node manager
  • To connect to the node manager, follow the below steps:
    • Navigate to MWHOME/ wlserver_10.3/common/bin
  • Run the wlst.sh
  • Use the below syntax to connect to the node manager
    • nmConnect('weblogic','<password>','<host name>','<node manager port no.>','<domain name>','<path to the domain>')
After successfully connecting to the node manager, we will be able to start/stop the servers.
We can use various commands to manage the servers using wlst and node manager as mentioned below:

1.       nmServerStatus('<Server Name>'):This would display the current status of the server as:

  • Running
  • Shutdown
  • Failed Not Restartable
  • Unknown
2.  nmStart('<Server Name>') : This would start the server.

3.  nmKill('<Server Name>'): This would shutdown the server.

In this way we can configure Node Manager for high availabilty of weblogic server.
We can even write Custom Scripts using python/jython which is supported in weblogic for managing server.