Deployment Example: Single Sign-On, Load Balancing and Failover Using Sun OpenSSO Enterprise 8.0

8.1.2 Installing and Configuring the J2EE Container and J2EE Policy Agent on Protected Resource 2

Download the BEA WebLogic Server bits to the pr-2 host machine and install the application server. Additionally, download, install and configure the appropriate J2EE policy agent. Use the following list of procedures as a checklist for completing this task.

  1. To Install BEA WebLogic Server as J2EE Container 2 on Protected Resource 2

  2. To Configure BEA WebLogic Server as J2EE Container 2 on Protected Resource 2

  3. To Import the Certificate Authority Root Certificate into Application Server 2

  4. To Install the J2EE Policy Agent 2 on Application Server 2

  5. To Deploy the J2EE Policy Agent 2 Application

  6. To Start the J2EE Policy Agent 2 Application

  7. To Set Up the J2EE Policy Agent 2 Authentication Provider

  8. To Deploy the J2EE Policy Agent 2 Sample Application

  9. To Modify the J2EE Policy Agent 2 Configuration

ProcedureTo Install BEA WebLogic Server as J2EE Container 2 on Protected Resource 2

BEA WebLogic Server is the application server used as the J2EE container on Protected Resource 2.

  1. As a root user, log into the pr-2 host machine.

  2. Ensure that your system is properly patched.

    Refer to the BEA web site to make sure that your system has the recommended patches.

  3. Create a directory into which you can download the WebLogic Server bits and change into it.


    # mkdir /export/BEAWL10
    # cd /export/BEAWL10
    
  4. Download the WebLogic Server bits from http://commerce.bea.com/.

    For this deployment, we download the Solaris version.


    # ls -al
    
    total 294548
    drwxr-xr-x   2 root     root         512 Aug  7 13:23 .
    drwxr-xr-x   3 root     sys          512 Aug  7 13:16 ..
    -rw-r--r--   1 root     root     656834948 Aug  7 13:24 server100_solaris32.bin
    
  5. Run the installer.


    # ./server100_solaris32.bin
    
  6. When prompted, do the following:


    The Welcome screen is displayed.

    Click Next. 


    Accept the License agreement

    Select Yes and click Next. 


    Create a new BEA Home

    Type /usr/local/bea and click Next.


    Select "Custom"

    Click Next. 


    Deselect the following:
    - Workshop for WebLogic Platform

    Click Next. 


    Choose Product Installation Directories

    Type /usr/local/bea/weblogic10 and click Next.


    Installation Complete

    Deselect Run Quickstart and click Done.

  7. Verify that the application was correctly installed.


    # cd /usr/local/bea
    # ls -al
    
    total 90
    drwxr-xr-x   7 root     root         512 Jul 15 11:59 .
    drwxr-xr-x   4 root     root         512 Jul 15 11:58 ..
    -rwxr-xr-x   1 root     root         826 Jul 15 11:59 UpdateLicense.sh
    -rw-r--r--   1 root     root          14 Jul 15 11:59 beahomelist
    drwxr-xr-x   6 root     root         512 Jul 15 11:59 jdk150_06
    -rw-r--r--   1 root     root       12447 Jul 15 11:59 license.bea
    drwxr-xr-x   2 root     root         512 Jul 15 11:59 logs
    drwxr-xr-x   6 root     root        6656 Jul 15 11:58 modules
    -rw-r--r--   1 root     root       15194 Jul 15 11:59 registry.dat
    -rw-r--r--   1 root     root        1077 Jul 15 11:59 registry.xml
    drwxr-xr-x   4 root     root         512 Jul 15 12:01 utils
    drwxr-xr-x  10 root     root         512 Jul 15 11:59 weblogic10

ProcedureTo Configure BEA WebLogic Server as J2EE Container 2 on Protected Resource 2

After installing the bits, WebLogic Server must be configured.

Before You Begin

This procedure assumes you have just completed To Install BEA WebLogic Server as J2EE Container 2 on Protected Resource 2 and are still logged into the host machine as the root user.

  1. Run the WebLogic Server configuration script.


    # cd /usr/local/bea/weblogic10/common/bin
    # ./config.sh
    
  2. When prompted, do the following:


    Select "Create a new Weblogic domain"

    Click Next. 


    Select "Generate a domain configured automatically 
    to support the following BEA products:"

    Click Next. 


    Configure Administrator Username and Password

    Enter the following and click Next. 

    • Username: weblogic

    • Password: bea10admin

    • Confirm Password: bea10admin


    Select "Prduction Mode" and "BEA Supplied JDK's" 
    (Sun SDK 1.5.0_06@/usr/local/bea/jdk150_06)

    Click Next. 


    Customize Environment and Services Settings

    Select yes and click Next.


    Configure the Administration Server

    Accept the default values and click Next. 


    Configure Managed Servers

    Select Add, enter the following values, and click Next. 

    • Name: ApplicationServer-2

    • Listen Port: 1081


    Configure Clusters

    Accept the default values and click Next. 


    Configure Machines

    Select the Unix Machine tab, then select Add, type pr-2 and click Next.


    Assign Servers to Machines

    From the left panel select AdminServer and ApplicationServer-2. From the right panel select pr-2. Click --> and then click Next.


    Review WebLogic Domain

    Click Next. 


    Create WebLogic Domain

    Add the following and click Create. 

    • Domain name: pr-2

    • Domain Location: /usr/local/bea/user_projects/domains (default)


    Creating Domain

    Click Done. 

  3. Start the WebLogic administration server.


    # cd /usr/local/bea/user_projects/domains/pr-2
    # ./startWebLogic.sh
    

    When prompted, type the following credentials.

    Username

    weblogic

    Password

    bea10admin

  4. Run the netstat command to verify that the port is open and listening.


    # netstat -an | grep 7001
    
    XXX.XX.XX.101.7001         *.*                0      0 49152      0 LISTEN
    XXX.X.X.1.7001             *.*                0      0 49152      0 LISTEN

    Note –

    You can also access the administration console by pointing a web browser to http://pr-2.example.com:7001/console.


  5. Change to the AdminServer directory.


    # cd /usr/local/bea/user_projects/domains/pr-2/servers/AdminServer
    
  6. Create a security directory and change into it.


    # mkdir security
    # cd security
    
  7. Create a boot.properties file for the WebLogic Server administration server administrator credentials.

    The administration server administrative user and password are stored in boot.properties. Application Server 2 uses this information during startup. WebLogic Server encrypts the file, so there is no security risk even if you enter the user name and password in clear text.


    # cat > boot.properties
    username=weblogic
    password=bea10admin
    
    Hit Control D to terminate the command
    
    ^D
    
  8. Restart WebLogic to encrypt the username and password in boot.properties.


    # cd /usr/local/bea/user_projects/domains/pr-2/bin
    # ./stopWebLogic.sh
    # ./startWebLogic.sh
    
  9. Start the managed servers.


    # cd /usr/local/bea/user_projects/domains/pr-2/bin
    # ./startManagedWebLogic.sh ApplicationServer-2 t3://localhost:7001
    

    You will be prompted for the administrative user credentials.

    Username

    weblogic

    Password

    bea10admin

  10. Change to the ApplicationServer-2 directory.


    # cd /usr/local/bea/user_projects/domains/pr-2/
      servers/ApplicationServer-2
    
  11. Create a security directory and change into it.


    # mkdir security
    # cd security
    
  12. Create a boot.properties file for the WebLogic Server managed server administrator credentials.

    The managed server administrative user and password are stored in boot.properties. The Application Server 2 managed server uses this information during startup. WebLogic Server encrypts the file, so there is no security risk even if you enter the user name and password in clear text.


    # cat > boot.properties
    username=weblogic
    password=bea10admin
    
    Hit Control D to terminate the command
    
    ^D
    
  13. Restart the managed server.


    # cd /usr/local/bea/user_projects/domains/ 
      pr-2/bin
    # ./stopManagedWebLogic.sh ApplicationServer-2 
       t3://localhost:7001
    # ./startManagedWebLogic.sh ApplicationServer-2 
       t3://localhost:7001
    
  14. Run the netstat command to verify that the port is open and listening.


    # netstat -an | grep 1081
    
    XXX.XX.XX.101.1081     *.*                0      0 49152      0 LISTEN
    XXX.X.X.1.1081         *.*                0      0 49152      0 LISTEN
  15. Access http://pr-2.example.com:7001/console from a web browser.

  16. Login to the BEA WebLogic Server as the administrator.

    Username

    weblogic

    Password

    bea10admin

  17. Click servers under Domain Structure —>Environment.

    On the Summary of Servers page, verify that both AdminServer (admin) and ApplicationServer-2 are running and OK.

  18. Log out of the console.

  19. Log out of the pr–2 host machine.

ProcedureTo Import the Certificate Authority Root Certificate into Application Server 2

The CA root certificate enables the J2EE policy agent to trust the certificate from the OpenSSO Enterprise Load Balancer 2, and to establish trust with the certificate chain that is formed from the CA to the certificate.

Before You Begin

Copy the same CA root certificate used in To Install a CA Root Certificate to the OpenSSO Enterprise Load Balancer to the /export/software directory on the pr-2 host machine.

  1. As a root user, log into the pr–2 host machine.

  2. Change to the directory where the cacerts certificate store is located.


    # cd /usr/local/bea/jdk150_06/jre/lib/security.

    Tip –

    Backup cacerts before modifying it.


  3. Import ca.cer, the CA root certificate.


    # /usr/local/bea/jdk150_06/bin/keytool -import -trustcacerts 
      -alias OpenSSLTestCA -file /export/software/ca.cer 
      -keystore /usr/local/bea/jdk150_06/jre/lib/security/cacerts -storepass changeit
    
    Owner: EMAILADDRESS=nobody@nowhere.com, CN=OpenSSLTestCA, OU=Sun,
    O=Sun,L=Santa Clara, ST=California C=US
    Issuer: EMAILADDRESS=nobody@nowhere.com, CN=OpenSSLTestCA, OU=Sun,
    O=Sun,L=Santa Clara, ST=California C=US
    Serial number: 97dba0aa26db6386
    Valid from: Tue Apr 18 07:66:19 PDT 2006 until: Tue Jan 13 06:55:19
    PST 2009
    Certificate fingerprints:
    MD5: 9f:57:ED:B2:F2:88:B6:E8:0F:1E:08:72:CF:70:32:06
    SHA1: 31:26:46:15:C5:12:5D:29:46:2A:60:A1:E5:9E:26:64:36:80:E4:70
    Trust this certificate: [no] yes
    
    Certificate was added to keystore.
  4. Verify that ca.cer was successfully imported.


    # /usr/local/bea/jdk150_06/bin/keytool -list 
      -keystore /usr/local/bea/jdk150_06/jre/lib/security/cacerts 
      -storepass changeit | grep -i openssl
    
    OpenSSLTestCA, Sep 15, 2008, trustedCertEntry,
  5. Log out of the pr–2 host machine.

ProcedureTo Install the J2EE Policy Agent 2 on Application Server 2

Before You Begin

Set JAVA_HOME to /usr/local/bea/jdk150_06.

  1. As a root user, log into the pr-2 host machine.

  2. Stop the WebLogic Server 2 administration server and the WebLogic Server 2 managed server.


    # cd /usr/local/bea/user_projects/domains/pr-2/bin
    # ./stopManagedWebLogic.sh ApplicationServer-2 t3://localhost:7001
    # ./stopWebLogic.sh
    
  3. Create a directory into which you will download the J2EE policy agent bits and change into it.


    # mkdir /export/J2EEPA2
    # cd /export/J2EEPA2
    
  4. Create a text file that contains a password for the Agent Profile created during installation.

    The J2EE Policy Agent installer requires this.


    # cat > agent.pwd
    
    j2eeagent2
    
    Hit Control D to terminate the command
    
    ^D
    
  5. Create a text file that contains the Agent Administrator password.

    This text file should contain the password of the OpenSSO Enterprise administrator (by default, amadmin).


    # cat > agentadm.pwd
    
    ossoadmin
    
    Hit Control D to terminate the command
    
    ^D
    
  6. Download the J2EE policy agent bits for WebLogic Server from http://www.sun.com/download/index.jsp.


    # ls -al
    
    total 18824
    drwxr-xr-x   2 root     root         512 Jul 17 16:02 .
    drwxr-xr-x   8 root     root         512 Jul 17 15:58 ..
    -rw-r--r--   1 root     root          11 Jul 17 15:59 agent.pwd
    -rw-r--r--   1 root     root           9 Jul 17 16:01 agentadm.pwd
    -rw-r--r--   1 root     root     9623704 Jul 17 16:02 weblogic_v10_agent_3.zip
    
  7. Unpack the J2EE policy agent bits.


    # unzip weblogic_v10_agent_3.zip
    
  8. Run the J2EE policy agent installer.


    # cd /export/J2EEPA2/j2ee_agents/weblogic_v10_agent/bin
    # chmod 755 agentadmin
    # ./agentadmin --custom-install
    
  9. When prompted, provide the following information.

    The following information is to configure the J2EE Policy Agent against the OpenSSO Enterprise secure port.


    Please read the following License Agreement carefully:

    Press Enter to continue. Continue to press Enter until you reach the end of the License Agreement and the installer's Welcome page is displayed. 


    Enter startup script location.

    Enter /usr/local/bea/user_projects/domains/pr-2/bin/startwebLogic.sh


    Enter the WebLogic Server instance 
    name: [AdminServer]

    Enter the name of the WebLogic Server instance secured by the agent ApplicationServer-2


    Enter the WebLogic home directory: 
    [/usr/local/bea/wlserver_10.0]

    Enter /usr/local/bea/weblogic10.


    OpenSSO Enterprise 
    URL

    Enter the URL where OpenSSO Enterprise is running (including the URI): https://lb-2.example.com:1081/opensso


    Is the agent being deployed on a Portal domain [false]

    Accept the default value. 


    Agent URL:

    Enter the URL where the policy agent is running (including the URI): http://pr-2.example.com:1081/agentapp


    Enter the Encryption Key 
    [+Yr3K4K1/lWFe4H17SBHMNIUzLNRut7H]:

    Accept the default value. 


    Enter the Agent Profile Name:

    j2eeagent-2


    Enter the path to the password file:

    Enter the path to a file that contains the password to be used for identifying the policy agent: /export/J2EEPA2/agent.pwd.


    Note –

    A warning message is displayed regarding the existence of the agent profile.



    This Agent Profile does not exist in 
    OpenSSO Enterprise. 
    Will it be created by the installer? (Agent 
    Administrator name and password are required) 
    [true]:

    Accept the default value to create the Agent Profile during installation. 


    Enter the Agent Administrator's name:

    Enter amadmin


    Enter the path to the password file 
    that contains the password of Agent Administrator:

    Enter /export/J2EEPA2/agentadm.pwd


    -----------------------------------------------
    SUMMARY OF YOUR RESPONSES
    -----------------------------------------------
    Startup script location :
      /usr/local/bea/user_projects/domains/
      pr-2/bin/startWebLogic.sh
    WebLogic Server instance name : 
      ApplicationServer-2
    WebLogic home directory : 
      /usr/local/bea/weblogic10
    OpenSSO Server  URL : 
      https://lb-2.example.com:1081/opensso
    Agent Installed on Portal domain : false
    Agent URL : 
      http://pr-2.example.com:1081/agentapp
    Encryption Key : 
      +Yr3K4K1/lWFe4H17SBHMNIUzLNRut7H
    Agent Profile name : j2eeagent-2
    Agent Profile Password file name : 
      /export/J2EEPA2/agent.pwd
    Agent Profile will be created right now 
      by agent installer : true
    Agent Administrator : amadmin
    Agent Administrator's password file 
      name : /export/J2EEPA2/agentadm.pwd
    
    Verify your settings and decide from 
    the choices below:
    1. Continue with Installation
    2. Back to the last interaction
    3. Start Over
    4. Exit
    Please make your selection [1]:

    Accept the default value. 


    -----------------------------------------------
    SUMMARY OF AGENT INSTALLATION
    -----------------------------
    Agent instance name: Agent_001
    Agent Bootstrap file location:
    /export/J2EEPA2/j2ee_agents/
      weblogic_v10_agent/Agent_001/
      config/FAMAgentBootstrap.properties
    Agent Configuration file location
    /export/J2EEPA2/j2ee_agents/
      weblogic_v10_agent/Agent_001/
      config/FAMAgentConfiguration.properties
    Agent Audit directory location:
    /export/J2EEPA2/j2ee_agents/
      weblogic_v10_agent/Agent_001/logs/audit
    Agent Debug directory location:
    /export/J2EEPA2/j2ee_agents/
      weblogic_v10_agent/Agent_001/logs/debug
    
    Install log file location:
    /export/J2EEPA2/j2ee_agents/
      weblogic_v10_agent/installer-logs
      /audit/custom.log

    Accept the default value. 

    When the installer is finished, a new file is in the bin directory called setAgentEnv_ApplicationServer-2.sh.

  10. Modify the startup script setDomainEnv.sh to reference setAgentEnv_ApplicationServer-2.sh using the following sub procedure.


    Tip –

    Backup setDomainEnv.sh before you modify it.


    1. Change to the bin directory.


      # cd /usr/local/bea/user_projects/domains/pr-2/bin
      
    2. Insert the following line at the end of setDomainEnv.sh.


      . /usr/local/bea/user_projects/domains/pr-2/
      bin/setAgentEnv_ApplicationServer-2.sh
    3. Save setDomainEnv.sh and close the file.

  11. Change permissions for setAgentEnv_ApplicationServer-2.sh.


    # chmod 755 setAgentEnv_ApplicationServer-2.sh
    
  12. Start the WebLogic Server administration server and managed instance.


    # ./startWebLogic.sh &
    # ./startManagedWebLogic.sh ApplicationSever-2 t3://localhost:7001
    

    Watch for startup errors.

  13. Verify that the J2EE Policy Agent 2 was successfully created on the server using the following sub-procedure.

    1. Access https://osso-1.example.com:1081/opensso/console from a web browser.

    2. Log in to the OpenSSO Enterprise console as the administrator.

      User Name:

      amadmin

      Password:

      ossoadmin

    3. Under the Access Control tab, click / (Top Level Realm).

    4. Click the Agents tab.

    5. Click the J2EE tab.

      j2eeagent-2 is displayed under the Agent table.

    6. Click j2eeagent-2.

      The j2eeagent-2 properties page is displayed.

    7. Log out of the OpenSSO Enterprise console and close the browser.

  14. Remove the password files.


    # cd /export/J2EEPA2
    # rm agent.pwd
    # rm agentadm.pwd
    
  15. Log out of the pr-2 host machine.

ProcedureTo Deploy the J2EE Policy Agent 2 Application

The agent application is a housekeeping application bundled with the binaries and used by the agent for notifications and other internal functionality. This application must be deployed to the agent-protected web container using the same URI that was supplied during the agent installation process. For example, during the installation process, if you entered /agentapp as the deployment URI for the agent application, use that same context path in this procedure.

  1. Access http://pr-2.example.com:7001/console from a web browser.

  2. Log in to the WebLogic Server console as the administrator.

    Username

    weblogic

    Password

    bea10admin

  3. Under Domain Structure, click Deployments.

  4. On the Summary of Deployments page, in the Change Center, click Lock & Edit.

  5. Under Deployments, click Install.

  6. On the Install Application Assistant page, click the pr-2.example.com link.

  7. In the field named Location: pr-2.example.com, click the root directory.

  8. Navigate to /export/J2EEPA2/j2ee_agents/weblogic_v10_agent/etc, the application directory.

  9. Select agentapp.war and click Next.

  10. In the Install Application Assistant page, choose Install this deployment as an application and click Next.

  11. In the list of Servers, mark the checkbox for ApplicationServer-2 and click Next.

  12. In the Optional Settings page, click Next.

  13. Click Finish.

  14. On the Settings for agentapp page, click Save.

  15. In the Change Center, click Activate Changes.

ProcedureTo Start the J2EE Policy Agent 2 Application

Before You Begin

This procedure assumes that you have just completed To Deploy the J2EE Policy Agent 2 Application and are still logged in to the WebLogic Server console as the administrator.

  1. In the WebLogic Server console, on the Settings for agentapp page, click Deployments.

  2. On the Summary of Deployments page, mark the agentapp checkbox and click Start > Servicing all requests.

  3. On the Start Application Assistant page, click Yes.


    Tip –

    If you encounter a JavaScript error, start the WebLogic Server instance and perform the steps again.


ProcedureTo Set Up the J2EE Policy Agent 2 Authentication Provider

Before You Begin

This procedure assumes that you have just completed To Start the J2EE Policy Agent 2 Application and are still logged in to the WebLogic Server console as the administrator.

  1. In the WebLogic Server console, on the Summary of Deployments page, under Domain Structure, click Security Realms.

  2. On the Summary of Security Realms page, click Lock & Edit.

  3. Click the myrealm link.

  4. On the Settings for myrealm page, click the Providers tab.

  5. Under Authentication Providers, click New.

  6. On the Create a New Authentication Provider page, provide the following information and click OK.

    Name:

    Agent-2

    Type:

    Select AgentAuthenticator from the drop down list.

    Agent-2 is now included in the list of Authentication Providers.

  7. In the list of Authentication Providers, click Agent-2.

  8. In the Settings for Authentication Providers page, verify that the Control Flag is set to OPTIONAL.

  9. In the navigation tree near the top of the page, click Providers.

  10. In the list of Authentication Providers, click DefaultAuthenticator.

  11. In the Settings for DefaultAuthenticator page, set the Control Flag to OPTIONAL and click Save.

  12. In the navigation tree near the top of the page, click Providers again.

  13. In the Change Center, click Activate Changes.

  14. If indicated by the console, restart the servers.

    1. Log out of the WebLogic Server console.

    2. As a root user, log into the pr–2 host machine.

    3. Restart the administration server and the managed instance.


      # cd /usr/local/bea/user_projects/domains/pr-2/bin
      # ./stopManagedWebLogic.sh ApplicationServer-2 t3://localhost:7001
      # ./stopWebLogic.sh
      # ./startWebLogic.sh
      # ./startManagedWebLogic.sh ApplicationServer-2 t3://localhost:7001
      
    4. Log out of the pr–2 host machine.

ProcedureTo Deploy the J2EE Policy Agent 2 Sample Application

  1. Access Application Server 2 at http://pr-2.example.com:7001/console.

  2. Log in to the WebLogic Server console as the administrator.

    Username

    weblogic

    Password

    bea10admin

  3. On the Change Center, click Lock & Edit.

  4. Under Domain Structure, click Deployments.

  5. Under Deployments, click Install.

  6. On the Install Application Assistant page, click the pr-2.example.com link.

  7. In the list for Location: pr-2.example.com, click the root directory.

  8. Navigate to the application directory (/export/J2EEPA2/j2ee_agents/weblogic_v10_agent/sampleapp/dist), select agentsample.ear and click Next.

  9. In the Install Application Assistant page, choose Install this deployment as an application and click Next.

  10. In the list of Servers, mark the checkbox for ApplicationServer-2 and click Next.

  11. On the Optional Settings page, click Next to accept the default settings.

  12. On the Review Your Choices page, click Finish.

    The Target Summary section indicates that the module agentsample will be installed on the target ApplicationServer-2.

  13. On the Settings for agentsample page, click Save.

  14. On the Settings for agentsample page, click Activate Changes.

  15. Under Domain Structure, click Deployments.

  16. In the Deployments list, mark the checkbox for agentsample and click Start > Servicing All Requests.

  17. On the Start Application Assistant page, click Yes.

    The state of the deployment changes from Prepared to Active.

  18. Log out of the Application Server 2 console.

ProcedureTo Modify the J2EE Policy Agent 2 Configuration

The J2EE policy agent can operate in local or centralized mode. The centralized option was selected during the custom installation of the agent. Centralized agent configuration stores agent configuration data in a data store managed by OpenSSO Enterprise. In this deployment, J2EE policy agents are configured in centralized mode meaning that any configuration changes must be made using the OpenSSO Enterprise server. For more information, see Centralized Agent Configuration in Sun OpenSSO Enterprise 8.0 Technical Overview.

  1. Access https://osso-1.example.com:1081/opensso/console from a web browser.

  2. Log in to the OpenSSO Enterprise console as the administrator.

    User Name:

    amadmin

    Password:

    ossoadmin

  3. Under the Access Control tab, click / (Top Level Realm).

  4. Click the Agents tab.

  5. Click the J2EE tab.

    j2eeagent-2 is displayed under the Agent table.

  6. Click j2eeagent-2.

    The j2eeagent-2 properties page is displayed.

  7. Click the Miscellaneous tab.

    The Miscellaneous properties page is displayed.

  8. Provide the user name of the Application Server administrator in the Bypass Principal List and click Add.

    Enter weblogic to ensure that the administrator will be authenticated against WebLogic itself and not OpenSSO Enterprise.

  9. Click Save.

  10. Exit the console and close the browser.