Tuesday 4 October 2016

Saturday 1 October 2016

WebLogic 12c 12.1.3 HTTPS TLSv1.2 Only Enablement

Pre-requisite

HTTPS and TLSv1.2 Only Enablement
  • HTTPS Enablement
    • Login to the Admin Console of Weblogic Admin Server 
    • Select from left tree "base_domain -> Enviornment -> Servers"
    • Select the Server which you want to enable for HTTPS, for example "Server-1"
    • Select Tabe "Configuration -> General" and select "SSL Port Enabled" and provide a HTTPS port, for example 8082
    • Select Tabe "Configuration -> Keystores" and provide following values:
      • Keystores: Select "Customer Identity and Custom Trust"
      • Custom Identity Keystore: the path to identity jks in the machine
      • Custom Identity Keystore Type: JKS
      • Custom Identity Keystore Passphrase: the password of identity keystore
      • Confirm Custom Identity Keystore Passphrase: the password of identity keystore
      • Custom Trust Keystore: the path to trust jks in the machine
      • Custom Trust Keystore Type: JKS
      • Custom Trust Keystore Passphrase: the password of trust store keystore
      • Confirm Custom Trust Keystore Passphrase: the password of trust store keystore
    • Select Tabe "Configuration -> SSL" and provide following values:
      • Identity and Trust Locations: Keystores
      • Private Key Alias: the alias name of the identity certificate
      • Private Key Passphrase: the private key of the identity certificate
      • Confirm Private Key Passphrase: the private key of the identity certificate
    • You may do the same changes for Admin Server as well if want to do HTTPS enablement for Admin Server port.
    • Restart the Servers to take HTTPS enablement into effect, and hit the server URL with HTTPS port to verify.
  • TLSv1.2 Only Restriction
    • Select Tabe "Configuration -> Server Start" and provide following values:
      • Arguments: -Dweblogic.security.SSL.enableJSSE=true -Dweblogic.security.SSL.minimumProtocolVersion=TLSv1.2 -Dweblogic.security.SSL.allowUnencryptedNullCipher=false -Dweblogic.security.disableNullCipher=true
    • Restart the Servers
  • To restrict ciphers
    • Stop NodeManager, AdminServer and all other Servers
    • Modify config.xml
      • $cd /app/Oracle/Middleware/Oracle_Home/user_projects/domains/base_domain/config
      • $vi config.xml
      • Add following ciphers under respective Server section, for example
        • <server>
        • <name>Server-1</name>
        • <ssl>
        • <enabled>true</enabled>
        • <ciphersuite>TLS_RSA_WITH_AES_128_CBC_SHA</ciphersuite>
        • <ciphersuite>TLS_ECDH_RSA_WITH_AES_128_CBC_SHA</ciphersuite>
        • <ciphersuite>TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA</ciphersuite>
        • <ciphersuite>TLS_DHE_RSA_WITH_AES_128_CBC_SHA</ciphersuite>
        • .....
        • .....
      • Save the modification in config.xml
    • Restart NodeManager, AdminServer and respective Servers.
Thank You!

WebLogic 12c 12.1.3 JMS Distributed Queues and Topics Configuration


Pre-requisite



Distributed JMS Queues and Topics Creation

  • Create Server: JMSManagedServer-1 
    • Select from left tree "base_domain-> Enviornment -> Servers" and click "New"
    • Provide Server name as "JMSManagedServer-1", Listen address as "<HOST-NAME-1ST-NODE", Port as "8001", select "No, this is a stand-alone server.", and Click "Finish"
    • Navigate to the JMSManagedServer-1 management page by clicking the JMSManagedServer-1 name entry in the Summary of Servers table.
    • In the general tab, select "<HOST-NAME-1ST-NODE>" in the Machine drop-down box, disable "SSL Listen Port Enabled" and Click Save.
    • In the Server Start tab, ether the following information and click save
    • Java Home as "/usr/java/jdk1.8.0_102/"
    • Java Vendor as "Oracle "
    • Arguments as 
    • -Djava.library.path=/app/Oracle/Middleware/Oracle_Home/wlserver/server/native/linux/x86_64/
  • Create Server: JMSManagedServer-2
    • Select from left tree "base_domain-> Enviornment -> Servers" and click "New"
    • Provide Server name as "JMSManagedServer-2", Listen address as "<HOST-NAME-1ST-NODE", Port as "8001", select "No, this is a stand-alone server.", and Click "Finish"
    • Navigate to the JMSManagedServer-2 management page by clicking the JMSManagedServer-2 name entry in the Summary of Servers table.
    • In the general tab, select "<HOST-NAME-2ND-NODE>" in the Machine drop-down box, disable "SSL Listen Port Enabled" and Click Save.
    • In the Server Start tab, ether the following information and click save
    • Java Home as "/usr/java/jdk1.8.0_102/"
    • Java Vendor as "Oracle "
    • Arguments as 
    • -Djava.library.path=/app/Oracle/Middleware/Oracle_Home/wlserver/server/native/linux/x86_64/
  • Create JMS Clusters 
    • Select from left tree "base_domain-> Enviornment -> Clusters" and click "New"
    • Provide name as "JMSCluster" and click "Finish"
    • Navigate to the JMSCluster management page by clicking theJMSCluster name entry in the Summary of Clusters table
    • In the "Servers" tab, add Servers "JMSManagedServer-1" and "JMSManagedServer-2" into the cluster
  • Create the JMS Servers 
    • Login to WebLogic Admin Console
    • Open web browser and hit the URL "http://<HOST-NAME>:7001/console/login/LoginForm.jsp" and enter credentials as "weblogic/Weblogic123"
    • On the left menu/navigation area, select the appropriate server domain and click to expand the Services - Messaging – JMS Servers node.
    • Click the Lock & Edit button, located near the top of the left menu.
    • On the following page, click the New button.
    • This will take you to a page where you can select a name for the JMS server. In the text box, name the server JMSServer-1.
    • Click Next.
    • Under the Select targets heading, use the drop-down box to select the name of the server where you wish to deploy the JMS server. ManagedJMSServer-1 should be the target for JMSServer-1. Click Finish.
    • To commit the change and create the JMS server, you must then click the Activate Changes button. This should create a new JMS server.
    • Complete steps above to create JMSServer-2, which should target ManagedJMSServer-2.
  • Create the JMS Module 
    • On the left menu/navigation area, select the appropriate server domain and click to expand the Services – Messaging – JMS Modules node.
    • Click the Lock & Edit button, located near the top of the left menu.
    • On the following page, click the New button.
    • This will take you to a page where you can select a name for the JMS module. In the Name text box, give the module an appropriate name.
    • Click Next.
    • Under the Targets heading, select ManagedJMSServer-1 and ManagedJMSServer-2. Click Next.
    • Click Finish.
    • Select SystemModule-1 from the JMS Modules table and select the Subdeployments tab and click the New button
    • Enter Default for the Subdeployment Name. Click Next.
    • On the Targets page, select JMSServer-1 and JMSServer-2. Click Finish
  • Create Queues and Topics
    • On the Create a New JMS System Module Resource page, Queue or Topic resource as appropriate and click Next.
    • Accept the default “round-robin” handling of the distributed JMS resources. You will enter the JMS Destination Properties on the following page. Give the distributed queue or topic an appropriate Name and JNDI Name. Following is an example: 
    • ticketRequest, ticketRequest, DistributedQueue
    • ticketResponse, ticketResponse, DistributedTopic
    • Click Next.
    • Accept the default targeting suggested by the admin console and click Finish.
    • Click the green “Activate Changes” button to ensure that the JMS resource definition is accepted and deployed by the Web Logic Server.
    • Test
    • You can verify that the JMS resources were successfully deployed by trying to connect to them with a JMS client such as Hermes JMS.


Thank You!

WebLogic 12c 12.1.3 Cluster Node Setup in Linux

Pre-requisite

2nd Node Setup
  • Create 2nd or Remote Weblogic Node
  • Login to the Admin Console of Weblogic Admin Server (running in Node1)
  • Select from left tree "base_domain -> Enviornment -> Machines" and click "New"
  • Provide name as "<HOST-NAME-OF-2ND-NODE>" and Os as "Unix", and click "Next"
  • Select Type as "Plain", Address as "<HOST-NAME-OF-2ND-NODE>", Port as "5556" and click "Finish"
  • Install Weblogic Server (Do not have to create Domain here) following the same steps followed for 1st Node:
    • Connect via SSH CLI to 2nd Node
    • Create weblogic user and group
      • $groupadd -g 1000 weblogic
      • $useradd -u 1100 -g weblogic weblogic
      • $passwd weblogic (give password as weblogic)
    • Create weblogic installation directory
      • $mkdir /app
      • $chown -R weblogic:weblogic /opt/oracle
      • $chmod -R 775 /app
    • Download Weblogic 12c (12.1.3) installable
      • Download Weblogic Server 12.1.3 from Oracle Support Site: fmw_12.1.3.0.0_wls.jar
    • Install Weblogic 12.1.3
      • Verify Java 8 is installed
        • $which java
        • $java -version
    • Perform installation of Weblogic 12.1.3
      • Add the following entries into /home/weblogic/.bash_profile file:
        • export MW_HOME=/app/Oracle/Middleware/Oracle_Home/
        • export WLS_HOME="${MW_HOME}/wlserver"
        • export WL_HOME="${WLS_HOME}"
        • # Set to appropriate JAVA_HOME.
        • export JAVA_HOME=/usr/java/jdk1.8.0_91
        • export JAVA_OPTIONS="-Djava.security.egd=file:/dev/./urandom"
        • PATH=$PATH:$HOME/bin:$JAVA_HOME/bin
        • export PATH
      • Connect o Machine via VNC Client (make sure VNCServer is running in the box)
      • From VNC Client go to Shell prompt
      • Switch to weblogic user
        • $su - weblogic
      • Run the Installer from the directory where weblogic installer jar is copied
        • $java -jar fmw_12.1.3.0.0_wls.jar
      • You will get pre-requisite check warnings, make sure all checks are passed (except for 256 color warning in which case you can proceed with 'y')
      • Let all defaults values (like inventory location, installation location, installation type) to be selected except installation path which you can specify as under /app
      • You may Uncheck the check box where it is asked to get information on security updates
      • After installation it would prompt for domain creation, say No
  • Note: we did not create domain in the 2nd Node
  • From the 1st Primary Node create a teamplate.jar 
    • SSL CLI to 1st Node and switch to webloigc user
    • $cd /app/Oracle/Middleware/Oracle_Home/oracle_common/common/bin
    • $./pack.sh -managed=true -domain="/app/Oracle/Middleware/Oracle_Home/user_projects/domains/base_domain" -template=midtiertemplate.jar -template_name="midtiertemplate"
    • This will create a midtiertemplate.jar in the path /app/Oracle/Middleware/Oracle_Home/oracle_common/common/bin
  • Use template created from 1st Node to install it in 2nd Node 
  • SSH to 2nd Node and switch to weblogic User
  • copy template from 1st Node to 2nd Node 
    • $cd /app/Oracle/Middleware/Oracle_Home/oracle_common/common/bin
    • $scp root@<HOST-NAME-OF-1ST-NODE>:/app/Oracle/Middleware/Oracle_Home/oracle_common/common/bin/midtiertemplate.jar .
  • $./unpack.sh -domain="/app/Oracle/Middleware/Oracle_Home/user_projects/domains/base_domain" -template="/app/Oracle/Middleware/Oracle_Home/oracle_common/common/bin/midtiertemplate.jar"
  • Check for successful message in the command prompt
  • Register this 2nd Machine NodeManager with 1st Machine 
    • SSH to 2nd Machine and switch to weblogic user
    • $su - weblogic
    • $cd /app/Oracle/Middleware/Oracle_Home/oracle_common/user_projects/domains/base_domain/bin/
    • $. setDomainEnv.sh
    • java weblogic.WLST 
    • A new prompt will come:
    • >>connect('weblogic','Weblogic123','t3://<HOST-NAME-OF-1ST-NODE>:7001')
    • >>nmEnroll('/app/Oracle/Middleware/Oracle_Home/user_projects/domains/base_domain/','/app/Oracle/Middleware/Oracle_Home/user_projects/domains/base_domain/nodemanager/')
    • >>exit()
  • Start the NodeManager in 2nd Machine 
    • $cd /app/Oracle/Middleware/Oracle_Home/user_projects/domains/base_domain
    • $nohup ./bin/startNodeManager.sh &
  • check the nohup log for successful startup 
  • If any issues, please check the nodemanager.properties file and correct the hostname.
  • Verify it from 1st Node 
    • Login to Admin Console UI of 1st Machine
    • Go to Machines -> 2nd Machine
    • Go to Tab Monitoring and check "Reachable" state for confirmation.
Thank You!

WebLogic 12c 12.1.3 Installation and Configuration in Linux

Pre-requisite
  • Java 8 installed 
  • VNC Server installed (to be able to run WebLogic installer GUI)

Installation & Configuration Steps
  • Create weblogic user and group
    • $groupadd -g 1000 weblogic
    • $useradd -u 1100 -g weblogic weblogic
    • $passwd weblogic (give password as weblogic)
  • Create weblogic installation directory
    • $mkdir /app
    • $chown -R weblogic:weblogic /opt/oracle
    • $chmod -R 775 /app
  • Download Weblogic 12c (12.1.3) installable
    • Download Weblogic Server 12.1.3 from Oracle Support Site: fmw_12.1.3.0.0_wls.jar
  • Install Weblogic 12.1.3
    • Verify Java 8 is installed
      • $which java
      • $java -version
  • Perform installation of Weblogic 12.1.3
    • Add the following entries into /home/weblogic/.bash_profile file:
      • export MW_HOME=/app/Oracle/Middleware/Oracle_Home/
      • export WLS_HOME="${MW_HOME}/wlserver"
      • export WL_HOME="${WLS_HOME}"
      • # Set to appropriate JAVA_HOME.
      • export JAVA_HOME=/usr/java/jdk1.8.0_91
      • export JAVA_OPTIONS="-Djava.security.egd=file:/dev/./urandom"
      • PATH=$PATH:$HOME/bin:$JAVA_HOME/bin
      • export PATH
    • Connect o Machine via VNC Client (make sure VNCServer is running in the box)
    • From VNC Client go to Shell prompt
    • Switch to weblogic user
      • $su - weblogic
    • Run the Installer from the directory where weblogic installer jar is copied
      • $java -jar fmw_12.1.3.0.0_wls.jar
    • You will get pre-requisite check warnings, make sure all checks are passed (except for 256 color warning in which case you can proceed with 'y')
    • Let all defaults values (like inventory location, installation location, installation type) to be selected except installation path which you can specify as under /app
    • You may Uncheck the check box where it is asked to get information on security updates
    • After installation it would prompt for domain creation, say Yes 
    • Give the Domain path as /app/Oracle/Middleware/Oracle_Home/user_projects/domains/base_domain/ 
    • and select all default options except selecting the "Production Mode" when asked for installation mode to have run Weblogic in production licensed mode
    • Provide Username password as "weblogic:Weblogic123"
    • Finish Domain Creation Wizard and come out of (exit) VNC Client
    • Start NodeManager and Admin Server
    • Login to Machine via SSH Client
    • Switch to weblogic user
      • $su - weblogic
    • Start NodeManager
      • $cd /app/Oracle/Middleware/Oracle_Home/user_projects/domains/base_domain
      • $nohup ./bin/startNodeManager.sh &
    • Verify at nohup.out log for successful start of NodeManager.
    • In case any issues you face with startup please check if hostname and ports and secureLister=false are correctly configured in nodemanager.properties file
    • /app/Oracle/Middleware/Oracle_Home/user_projects/domains/base_domain/nodemanager/nodemanager.properties
    • ****Note that we have installed Weblogic with Production Mode which requires username and password to be entered while starting the servers to by pass username and password ask and start server in backrgound***
    • Manully create boot.properties for Admin Server
      • $cd /app/Oracle/Middleware/Oracle_Home/user_projects/domains/base_domain/servers/AdminServer
      • $mkdir scecurity
      • $cd security
      • $vi boot.properties with following values
        • username=weblogic
        • password=Webloigc123
    • Start Weblogic Server
      • $cd /app/Oracle/Middleware/Oracle_Home/user_projects/domains/base_domain/bin
      • $nohup ./startWebLogic.sh &
    • Open web browser and hit the URL "http://<HOST-NAME>:7001/console/login/LoginForm.jsp" and enter credentials as "weblogic/Weblogic123"
    • If you are able to see the login page and login, it confirms installation is successful
    • Configuration of Weblogic
    • Create Machines 
    • Select from left tree "base_domain -> Enviornment -> Machines" and click "New"
    • Provide name as "<HOST-NAME>" and Os as "Unix", and click "Next"
    • Select Type as "Plain", Address as "<HOST-NAME>", Port as "5556" and click "Finish"
    • Create Servers 
    • Select from left tree "base_domain -> Enviornment -> Servers" and click "New"
    • Provide Server name as "Server-1", Listen address as "<HOST-NAME>", Port as "8080", select "No, this is a stand-alone server.", and Click "Finish"
    • Navigate to the Server-1 management page by clicking the Server-1 name entry in the Summary of Servers table.
    • In the general tab, select "<HOST-NAME>" in the Machine drop-down box, disable "SSL Listen Port Enabled" and Click Save.
    • In the Server Start tab, ether the following information and click save
      • Java Home as "/usr/java/jdk1.8.0_91/"
      • Java Vendor as "Oracle"
      • Arguments as 
      • -Xms1024m -Xmx3076m -Djava.library.path=/app/Oracle/Middleware/Oracle_Home/wlserver/server/native/linux/x86_64/
    • Start Server-1
    • Select from left tree "base_domain -> Enviornment -> Servers" and then select Server-1 and start
Thank You!

Wednesday 4 May 2016

Weblogic 12c 12.2.1 installation in Oracle Red Hat Linux 6.7

Installation & Configuration Steps

  • Verify Virtual Machine Details
    • Ensure you have the SSH root credentials to the VM
      • root@<HOST-NAME>
    • Verify HW details
      • $cat /proc/cpuinfo
      • $free -m
    • Verify OS details via following commands:
      • $cat /etc/oracle-release
        • Red Hat Enterprise Linux Server release 6.7 (Santiago)
      • $cat /etc/redhat-release
        • Oracle Linux Server release 6.7
      • $uname -a
        • Linux <HOST-NAME> 3.8.13-44.1.1.el6uek.x86_64 #2 SMP Wed Sep 10 06:10:25 PDT 2014 x86_64 x86_64 x86_64 GNU/Linux
  • Create weblogic user and group
    • $groupadd -g 1000 weblogic
    • $useradd -u 1100 -g weblogic weblogic
    • $passwd weblogic (give password as weblogic)
  • Create weblogic installation directory
    • $mkdir /opt/oracle
    • $chown -R weblogic:weblogic /opt/oracle
    • $chmod -R 775 /opt/oracle
  • Download Weblogic 12c (12.2.1) installable
  • Install Weblogic 12c
    • Verify Java 8 is installed
      • $which java
      • $java -version
        • Java(TM) SE Runtime Environment (build 1.8.0_91)
    • Perform Silent installation of Weblogic 12c
      • Add the following entries into /home/weblogic/.bash_profile file:
        export MW_HOME=/opt/oracle/middleware
        export WLS_HOME="${MW_HOME}/wlserver"
        export WL_HOME="${WLS_HOME}"
        # Set to appropriate JAVA_HOME.
        export JAVA_HOME=/usr/java/jdk1.8.0_91
        export JAVA_OPTIONS="-Djava.security.egd=file:/dev/./urandom"
        PATH=$PATH:$HOME/bin:$JAVA_HOME/bin
        export PATH

      • Switch to weblogic user
        • $su - weblogic
      • Create directory /opt/oracle
        • $mkdir /opt/oracle/middleware
      • Copy weblogic installer zip from /root to /opt/oracle folder and unpack it
      • Create response file "wls.rsp" ($vi wls.rsp) and put following entries:
        [ENGINE]
        Response File Version=1.0.0.0.0
        [GENERIC]
        ORACLE_HOME=/opt/oracle
        INSTALL_TYPE=WebLogic Server
      • Run the Quick Installer
        • $java -jar fmw.....jar ORACLE_HOME=/opt/oracle/middleware -silent -responseFile /opt/oracle/wls.rep
  • Create Domain
    • Connect to machine via VNC Clinet
    • Run the domain creation script
      • $. /opt/oracle/middleware/oracle_common/common/bin/config.sh
      • Give the Domain path as /opt/oracle/middleware/user_projects/domains/MyDomain and select all default options
      • Provide Username password as "weblogic:weblogic"
  • Start the Admin Server
    • Come back to SSH CLI mode on VM
    • $su - weblogic
    • $cd /opt/oracle/middleware/user_projects/domains/MyDomain
    • $nohup ./startWebLogic.sh &
    • Open web browser and hit the URL "http://<HOST-NAME>:7001/console/login/LoginForm.jsp" and enter credentials as "weblogic/weblogic"
    • Go to Enviornment -> Servers -> AdminServer -> General Tab -> Change Listen Port from 7001 to 7000.
    • Go to AdminServer -> Control Tab -> Stop the Server
    • Start the Server again: 
      • $cd /opt/oracle/middleware/user_projects/domains/MyDomain
      • $nohup ./startWebLogic.sh &
      • Open web browser and hit the URL "http://<HOST-NAME>:7000/console/login/LoginForm.jsp" and enter credentials as "weblogic/weblogic"
  • Create Machines
    • Select from left tree "MyDomain -> Enviornment -> Machines" and click "New"
    • Provide name as "licremmt04" and Os as "Unix", and click "Next"
    • Select Type as "Plain", Address as "<HOST-NAME>", Port as "5556" and click "Finish"
  • Create Servers
    • Create Server: MyServer-1
      • Select from left tree "MyDomain -> Enviornment -> Servers" and click "New"
      • Provide Server name as "MyServer-1", Listen address as "<HOST-NAME>", Port as "8080", select "No, this is a stand-alone server.", and Click "Finish"
      • Navigate to the MyServer-1 management page by clicking the MyServer-1 name entry in the Summary of Servers table.
      • In the general tab, select "<HOST-NAME>" in the Machine drop-down box, disable "SSL Listen Port Enabled" and Click Save.
      • In the Server Start tab, ether the following information and click save
        • Java Home as "/usr/java/jdk1.8.0_91/"
        • Java Vendor as "Oracle"
        • Arguments as 
          -Xms1024m -Xmx3076m -Djava.library.path=/opt/oracle/middleware/wlserver/server/native/linux/x86_64/
    • Start the Servers
      • kill all running java processes using $killall java
      • Make the Server to NodeManager communication non-SSL
        • $vi /opt/oracle/middleware/user_projects/domains/MyDomain/nodemanager/nodemanager.properties
          • Have change as: SecureListener=false
      • Start the NodeManager
        • Set NodeManager Path:
          • $vi /opt/oracle/middleware/wlserver/server/bin/startNodeManager.sh
          • Set value: NODEMGR_HOME="${WL_HOME}/../user_projects/domains/MyDomain/nodemanager"
          • come out from vi editor
        • $nohup ./startNodeManager.sh &
      • Start the AdminServer
        • $cd /opt/oracle/middleware/user_projects/domains/MyDomain
        • $nohup ./startWebLogic.sh &
      • Start all Servers
        • Open Web Browser and login to Admin Conole: http://<HOST-NAME>:7000/console/login/LoginForm.jsp
        • Select from left tree "MyDomain -> Enviornment -> Servers"
        • Select the following Server, go to its management page, click on "Control" tab and click on "Start" button at the bottom:
          • MyServer-1
Thank You!

Tuesday 26 April 2016

Weblogic 11g installation in Oracle Red Hat Linux 6.7

Objective

  • Installing Weblogic 11g (10.3.6) into Oracle Red Hat Linux 6.7 VM.



Installation Steps
  • Verify Virtual Machine Details
    • Ensure you have the SSH root credentials to the VM
    • Verify HW details
      • $cat /proc/cpuinfo
      • $free -m
    • Verify OS details via following commands:
§  $cat /etc/oracle-release
Red Hat Enterprise Linux Server release 6.7 (Santiago)
§  $cat /etc/redhat-release
Oracle Linux Server release 6.7
§  $uname -a
Linux <HOSTNAME> 3.8.13-44.1.1.el6uek.x86_64 #2 SMP Wed Sep 10 06:10:25 PDT 2014 x86_64 x86_64 x86_64 GNU/Linux
  • Create weblogic user and group
    • $groupadd -g 1000 weblogic
    • $useradd -u 1100 -g weblogic weblogic
    • $passwd weblogic (give password as weblogic)
  • Create weblogic installation directory
    • $mkdir /usr/local/bea
    • $chown -R weblogic:weblogic /usr/local/bea
    • $chmod -R 775 /usr/local/bea
  • Download Weblogic 11g (10.3.6) installable
  • Install Weblogic 11g
    • Verify Java 8 is installed
      • $which java
§  $java -version
Java(TM) SE Runtime Environment (build 1.8.0_45-b14)       
    • Perform Silent installation of Weblogic 11g
§  Add the following entries into /home/weblogic/.bash_profile file:
export MW_HOME=/usr/local/bea
export WLS_HOME=$MW_HOME/wlserver_10.3
export WL_HOME=$WLS_HOME
# Set to appropriate JAVA_HOME.
export JAVA_HOME=/usr/java/jdk1.8.0_45/
export JAVA_OPTIONS="-Djava.security.egd=file:/dev/./urandom"
PATH=$PATH:$HOME/bin:$JAVA_HOME/bin
export PATH
      • Switch to weblogic user
        • su - weblogic
      • Create silent installation response file
        • $vi silent.xml
§  Add following entries
<?xml version="1.0" encoding="UTF-8"?>
<bea-installer>
<input-fields>
<data-value name="BEAHOME" value="/usr/local/bea" />
<data-value name="WLS_INSTALL_DIR" value="/usr/local/bea/wlserver_10.3" />
<data-value name="COMPONENT_PATHS"
value="WebLogic Server/Core Application Server|WebLogic Server/Administration Console|WebLogic Server/Configuration Wizard and Upgrade Framework|WebLogic Server/Web 2.0 HTTP Pub-Sub Server|WebLogic Server/WebLogic JDBC Drivers|WebLogic Server/Third Party JDBC Drivers|WebLogic Server/WebLogic Server Clients|WebLogic Server/WebLogic Web Server Plugins|WebLogic Server/UDDI and Xquery Support|Oracle Coherence/Coherence Product Files" />
<data-value name="INSTALL_NODE_MANAGER_SERVICE" value="yes" />
<data-value name="NODEMGR_PORT" value="5556" />
<data-value name="INSTALL_SHORTCUT_IN_ALL_USERS_FOLDER" value="no"/>
<data-value name="LOCAL_JVMS" value="/usr/java/jdk1.8.0_45"/>
</input-fields>
</bea-installer>
      • Start the silent installation
        • $java -Xmx1024m -jar wls1036_generic.jar -mode=silent -silent_xml=silent.xml
        • Make sure installation completes successfully without any error.
        • Verify installation via following steps
          • $. $WLS_HOME/server/bin/setWLSEnv.sh
§  $java weblogic.version
WebLogic Server 10.3.6.0  Tue Nov 15 08:52:36 PST 2011 1441050 
  • urandom change for faster startup of Weblogic Servers
o    Make sure following entry exist in /home/weblogic/.bash_profile file:
export JAVA_OPTIONS="-Djava.security.egd=file:/dev/./urandom"
  • Install VNC Server for GUI based Domain creation wizard
    • $yum install tigervnc-server
    • $vi /etc/sysconfig/vncservers
    • $su - weblogic
    • $vncpasswd
    • $chkconfig vncserver on
    • $service vncserver on
    • $service iptables stop
    • Verify you are able to connect via VNC client in your desktop
  • Create Domain and Configure Machine, Server & Other details
    • Connect to VM via VNC Client
    • Run the domain creation wizard
      •  $/usr/local/bea/utils/quickstart/quickstart.sh
      • Select "Getting started with WebLogic Server 10.3.6"
      • Select "Create a new WebLogic domain" and click "Next"
      • Select "Generate a domain configured automatically to support the following products:" and click "Next"
      • Enter the domain name as "AppTier" and click "Next"
      • Enter Name as "weblogic" and password as "Avaya123" and click "Next"
      • Select "Sun SDK 1.8.0_45 @ /usr/java/jdk1.8.0_45" and click "Next"
      • Select "Administration Server" and click "Next"
      • Click "Create"
      • Once progress completes, Ctrl+C to end the domain wizard.
      • Close the VNC client
    • Start the Admin Server
      • Come back to SSH CLI mode on VM
      • $su - weblogic
      • $cd /usr/local/bea/user_projects/domains/AppTier
      • $nohup ./startWebLogic.sh &
      • Open web browser and hit the URL "http://<HOST-NAME>:7000/console/login/LoginForm.jsp" and enter credentials as "weblogic/Avaya123"
    • Create Machines
      • Select from left tree "AppTier -> Enviornment -> Machines" and click "New"
      • Provide name as "<HOST-NAME>" and Os as "Unix", and click "Next"
      • Select Type as "Plain", Address as "<HOST-NAME>", Port as "5556" and click "Finish"
    • Create Servers
      • Create Server: Server-1
        • Select from left tree "AppTier-> Enviornment -> Servers" and click "New"
        • Provide Server name as "Server-1", Port as "8080", select "No, this is a stand-alone server.", and Click "Finish"
§  Navigate to the Server-1 management page by clicking the Server-1 name entry in the Summary of Servers table.
§  In the general tab, select "<HOST-NAME>" in the Machine drop-down box, disable "SSL Listen Port Enabled" and Click Save.
§  In the Server Start tab, ether the following information and click save
§  Java Home as "/usr/java/jdk1.8.0_45/"
§  Java Vendor as "Sun"
§  Arguments as 
-DIAM_MID_TIER=1 -Xms1024m -Xmx3076m -XX:MaxPermSize=512m -Djava.library.path=/usr/local/bea/wlserver_10.3/server/native/linux/x86_64 -Dweblogic.webservice.verbose=true
      • Start the Servers
      • kill all running java processes using $kill -9 <PID list space seprated>
      • Make the Server to NodeManager communication non-SSL
        •  $vi /usr/local/bea/wlserver_10.3/common/nodemanager/nodemanager.properties
SecureListener=false
      • Start the NodeManager
        • $cd /usr/local/bea/wlserver_10.3/server/bin
        • $nohup ./startNodeManager.sh &
      • Start the AdminServer
        • $cd /usr/local/bea/user_projects/domains/AppTier
        • $nohup ./startWebLogic.sh &
      • Start the Server
        • Open Web Browser and login to Admin Conole: http://<HOST-NAME>:7000/console/login/LoginForm.jsp
        • Select from left tree "AppTier-> Enviornment -> Servers"
        • Select the Server Server-1, go to the management page, click on "Control" tab and click on "Start" button at the botton
    • Verify installation
      • Check number of java processes
        • $ps -eaf | grep java
          • You must see 5 java processes against following:
            • Node Manager
            • Admin Server
            • Server-1 Server
  • HTTPS Enablement for Node Manager and Servers
    • TBD: Will have new Post created for it.



Troubleshooting Steps
  • Weblogic Installation and Configuration
    • Silent installation throws error
      • Make sure silent.xml is constructed correctly, the values in "COMPONENT_PATHS" should be correct, better copy-paste the entries captured here.
    • Weblogic start is too slow
      • Make sure the following steps is performed correctly
        • urandom change for faster startup of Weblogic Servers
    • Servers not able to start, failing on communication with NodeManager
      • Check the NodeManager logs for the errors, if SSL error then you may try setup first on non-SSL communication by following the steps mentioned under Make the Server to NodeManager communication non-SSL mentioned above.



Thank You!

Sunday 21 February 2016

Handling Browser F5 Refresh in JSF

Problem
If a Web Page had a POST action submitted last and a User clicks the Browser F5 button or initiates a Browser refresh action, it cause the last action to be re-submitted, it could be a problem in your application as it would re-submit the previous POST request to the server. 
Solution
While there could be many solution to handle it at various levels, in this post I am trying to capture various methods we can use while using JSF as Frontend UI technology. Each method is suitable for a specific use-case:

  1. Method-1
    <navigation-rule>
    <from-view-id>/views/submitaction.xhtml</from-view-id>
    <navigation-case>
    <from-outcome>success</from-outcome>
    <to-view-id>/views/successConfirmation.xhtml</to-view-id>
    <redirect/>
    </navigation-case>
    </navigation-rule>
  2. Method-2
    <h:commandButton value="send" action="done?faces-redirect=true" />

  3. Method-3
    If the requirement is to move from the original page to the same page after form submission. Ex.
    //In the Baking Bean have this code to return the String outcome:
    String viewId = FacesContext.getCurrentInstance().getViewRoot().getViewId();
    return viewId + "?faces-redirect=true";

  4. Method-4  (if you want objects to survive redirection)
    For JSF1.2: By implementing PhaseListener:


Thanks!

Friday 22 January 2016

What if you forgot Java Keystore Password?

Objective:

To show how one can recover from a situation when a Java Keystore password is forgotten.

Solution:

  1. Let say you have a keystore with name 'myTrustStore.jks' and forgot the store password.
  2. The only way to recover is then to create a duplicate keystore (with new store password) where all the certs from original trustore can be copied as is into the new keystore.
  3. Here is usage of Java Keytool command which can help here:
    [root@hots~]$keytool -importkeystore -srckeystore myTrustStore.jks -destkeystore myTrustStoreCopy.jks -deststorepass pass123
    Enter source keystore password:
    ***************** WARNING WARNING WARNING *****************
    * The integrity of the information stored in the srckeystore*
    * has NOT been verified! In order to verify its integrity, *
    * you must provide the srckeystore password. *
    ***************** WARNING WARNING WARNING *****************

    Entry for alias xxxxx successfully imported.
    Entry for alias yyyy successfully imported.
    Entry for alias zzzz successfully imported.
    ...
    ...
    Import command completed: X entries successfully imported, 0 entries failed or cancelled
  4. As you see in example above when asked the source keystore password one can hit the 'ENTER' key and ignore it, and the keytool will still be able to copy the certs to a new keystore.

Thank You!