r18 - 2016-09-29 - 11:16:47 - StevenBeardYou are here: TWiki >  Deployment Web > DeploymentInstallingUpgradingAndMigrating > CreateIHSPLUGINFORLIBERTYPROFILE

Creating The IHS Plugin for Liberty Profilenew.png

Authors: MikeDelargy

Build basis: 6.0.1, 6.0.2

The following article is an example of how you can configure a Reverse Proxy Server using Plug-ins with Liberty Profile.
More information on Generating Plug-ins for Liberty Profile can be found here: Liberty Profile Plugin

Requirements

In order to create and configure the IHS plugin, you will need to also install:
  • IBM HTTP Server (IHS)
  • Web Server Plug-ins for IBM WebSphere Application Server
  • IBM SDK (or JDK)

And you will need to:
  • Create a Keystore File for IHS
  • Create a Password Stash File for IHS Keystore
  • Create a Certificate for IHS
  • Create a Keystore File for Liberty Plugin Config
  • Create a Password Stash File for Plugin Config Keystore
  • Export a signer certificate from the Liberty Server and import it into a keystore

Install Each of the Components.

Install IBM HTTP Server, IBM SDK, and Web Server Plug-ins for IBM WebSphere Application Server
  • Install each of these tools according to the corresponding installation documentation.
  • In our example, we will be installing each of them in the following directory: C:\IBM\
  • Your installation directory may be different and will require you to make corresponding path changes.

Our Installation Paths for each component will be:
    IBM HTTP Server (IHS)
           C:\IBM\HTTPServer
   WebSphere Plugins 
          C:\IBM\WebSphere\Plugins\
   IBM SDK
          C:\IBM\Java
   CLM Tools
           C:\IBM\clm601\JazzTeamServer\

Create a Keystore and Certificate using Ikeyman for the IHS server

New Key Database

  • Locate and start ikeyman
    ikeyman2.png


  • Create a new Key Database File

ikeyman.png


New Keystore

  • Select Key database type CMS
  • Give a name to your keystore. (Our example: IHS_KEY.kdb)
  • Enter a path for your keystore Recommendation: Put this in the bin directory of the HTTPServer (You will need to remember this for later for the httpd.conf file)
  • Click OK

new_ihs_key.png


  • Enter a password (and confirm)
  • Check the box for the Stash Password to a file
  • Recommendation: Do not put an expiration date. If you do, you will need to create a new stash file when this expires.)

stach_password.png

New Self Signed Certificate for the IHS Keystore

  • Create a new Self Signed Certificate

new_certificate_button.png

  • Enter in information about the server
    (We are using 'default' as our certificate name)
  • Enter the WebServer Name (Our server name is 'rhayama')
  • Change the expiration to 3650 (This will avoid coming back in a year to do this again.)

new_certificate_1.png


Verify the default certificate was created.

verify_default_cert.png



Create a Keystore and Certificate using Ikeyman for the web server Plugin.

Best Practice is to use a separate keystore for the IHS server and the plugin config file.

New Directory for the plugin config information



Prior to creating the new Key Database for the plugin config file, create a new directory in your WebSphere Plugins directory. (This is on the IHS server)
As noted above, our plugin install path is: C:\IBM\WebSphere\plugins
We want to create a new directory for our plugin config file.
We will call our new directory WebServer1 and create it in C:\IBM\WebSphere\plugins\config
As seen:

create_webserv1_dir.png



Export Signer Certificate


We need to get a certificate from our Liberty Server.

  • Start ikeyman on the Liberty Server.


(If your IHS server is on a different server then your Liberty Server, you can use the ikeyman that comes with the CLM installation.
In our installation, it is located here: C:\IBM\clm602\JazzTeamServer\server\jave\jre\bin\ikeyman)


  • In ikeyman, select open



open_kestore2.png

  • Select Key File type JKS
  • At the bottom, select Files of Type All Files


key_db_type_jks.png

  • Navigate to the Liberty Profile keystore
  • C:\IBM\clm601\JazzTeamServer\server\liberty\servers\clm\resources\security\ibm-team-ssl.keystore


ratl_keystore.png

  • The password is ibm-team


  • On the right side, select Extract Certificate


extract_cert.png

  • Accept the default location


open_signer_cert.png

  • Click Okay and verify your certificate was created



verify_signer_cert_created.png

  • Copy this certificate into the WebServer1 directory you created above. (On the IHS Server)


copy_cert_to_webserver1.png



  • You can now close ikeyman on the Liberty Server.


New Key Database



Now we will return to Ikeyman on the IHS server. Ikeyman should still be up. If it is not, then start it again.

  • Select Key database type CMS
  • Give a name to your keystore. (Our example: plugin-key.kdb)
  • Enter a path for your keystore Recommendation: Put this in the directory you just created: C:\IBM\WebSphere\plugins\config\WebServer1
  • Click OK


New_plugin-key_kdb.png

  • Enter a password (and confirm)
  • Check the box for the Stash Password to a file
  • Recommendation: Do not put an expiration date. If you do, you will need to create a new stash file when this expires.


stach_password.png

Import Jazz Signer Certificate


(Instead of creating a certificate like we did for IHS, we will use the exported signer certificate from the Liberty server.)

  • Now import the signer certificate from Liberty Server


  • In the middle of the page, you should see Personal Certificate


option_personal_cert.png

  • change this to Signer Certificate:


change_option_signer_cert.png

  • Select the Add button and navigate to the WebServer1 directory that you copied the cert.arm into in the preceding step.


(It should be in the C:\WebSphere\Plugins\config\WebServer1 Directory)

Add_button.png

  • When the box comes up, navigate to the cert.arm file.


open_signer_cert.png

  • You will enter a label. Choose default


enter_label_webserver1.png

  • You should see a message that you successfully imported the certificate.


succesfully_import_cert.png

You should now be ready to create the plugin config file



Create the Plug-in Config file

  • To create the Plug-in Config for Liberty Profile, your Liberty Server must be running.

  • Run Jconsole
C:\IBM\Java70\bin\jconsole

  • Because we are running on the same system, we can connect to a local process.
    jconsole_start.png


  • Select the ws-server.jar --batch-file start clm process and click Connect
    jconsole_connection.png


  • Select the MBeans Tab
    mbeans_tab.png


  • Select the WebSphere:name=com.ibm.ws.jmx.mbeans.generatePluginConfig MBean located in the WebSphere directory.
    webshere_generate_plugin.png


  • Expand the Operations and click the generatePluginConfig


generate_plugin_config.png

You must enter two parameters, P1 and P2

  • P1: For P1, enter the path for your plugin on the IHS server. (This is the same directory you put your Liberty Keystore in. C:\IBM\WebSphere\Plugins\)
  • P2: For P2, enter the WebServer name (We will use WebServer1 )



webserver1_redo.png

  • On the Top Right, click the generatePluginConfig button


(At the end of the article is information on the 'generateDefaultPluginConfig" option instead of the "generatePluginConfig")


click_generate_plugin.png


  • You should get a message that the Method was successfully invoked
    method_invoked.png


  • You should now see your plugin config file

* This will be created on your Liberty Server in the same directory as the Liberty server.xml file. (Our example: C:\IBM\clm601\JazzTeamServer\server\liberty\servers\clm)

plugin_created.png


  • You will need to copy this over to your IHS server and place in the directory we created for it earlier. (Our example: C:\IBM\WebSphere\Plugins\config\WebServer1)


  • You can open the plugin config file and verify the contents. You should see something similar to this snippet:

  

<?xml version="1.0" encoding="UTF-8"?><!--HTTP server plugin config file for WebServer1 generated on 2016.05.17 at 16:14:49 PDT-->
<Config ASDisableNagle="false" AcceptAllContent="false" AppServerPortPreference="HostHeader" ChunkedResponse="false" FIPSEnable="false" IISDisableNagle="false" IISPluginPriority="High" IgnoreDNSFailures="false" RefreshInterval="60" ResponseChunkSize="64" SSLConsolidate="false" TrustedProxyEnable="false" VHostMatchingCompat="false">
   <Log LogLevel="Error" Name="C:\IBM\WebShere\Plugins\logs\WebServer1\http_plugin.log"/>
   <Property Name="ESIEnable" Value="true"/>
   <Property Name="ESIMaxCacheSize" Value="1024"/>
   <Property Name="ESIInvalidationMonitor" Value="false"/>
   <Property Name="ESIEnableToPassCookies" Value="false"/>
   <Property Name="PluginInstallRoot" Value="C:\IBM\WebShere\Plugins"/>
<!-- Configuration generated using httpEndpointRef=defaultHttpEndpoint-->
<!-- The default_host contained only aliases for endpoint defaultHttpEndpoint.
    The generated VirtualHostGroup will contain only configured web server ports:
      webserverPort=80
      webserverSecurePort=443 -->
   <VirtualHostGroup Name="default_host">
      <VirtualHost Name="*:80"/>
      <VirtualHost Name="*:443"/>
   </VirtualHostGroup>
   <ServerCluster CloneSeparatorChange="false" GetDWLMTable="false" IgnoreAffinityRequests="true" LoadBalance="Round Robin" Name="WebServer1_default_node_Cluster" PostBufferSize="0" PostSizeLimit="-1" RemoveSpecialHeaders="true" RetryInterval="60">
      <Server CloneID="8192ea2e-0dc3-4d34-9766-dc7240d46b43" ConnectTimeout="5" ExtendedHandshake="false" MaxConnections="-1" Name="default_node_WebServer1" ServerIOTimeout="900" WaitForContinue="false">
         <Transport Hostname="192.168.199.254" Port="9080" Protocol="http"/>
         <Transport Hostname="192.168.199.254" Port="9443" Protocol="https">
            <Property Name="keyring" Value="keyring.kdb"/>
            <Property Name="stashfile" Value="keyring.sth"/>
            <Property Name="certLabel" Value="LibertyCert"/>
         </Transport>
      </Server>


Changes to the Plugin Config File

You will need to make some changes to this xml file to match your environment.

Examine the contents of the XML file and look for the following line:

   <Log LogLevel="Error" Name= ************

Verify that this entry matches the directory you created for your Liberty plugin
<Log LogLevel="Error" Name="C:\IBM\WebShere\Plugins\logs\WebServer1\http_plugin.log"/>

You will also need to make changes to the Plugin config file regarding the Keystore / Certificate you will be creating in the next step
            <Property Name="keyring" Value="keyring.kdb"/>  
            <Property Name="stashfile" Value="keyring.sth"/> 
            <Property Name="certLabel" Value="LibertyCert"/> 

Modify this to match the certificate information you created for liberty plugin.
  • Example Windows
            <Property Name="keyring" Value="C:\IBM\WebSphere\Plugins\config\WebServer1\plugin-key.kdb"/>  
            <Property Name="stashfile" Value="C:\IBM\WebSphere\Plugins\config\WebServer1\plugin-key.sth"/> 
            <Property Name="certLabel" Value="default"/> 
  • Example Linux
            <Property Name="keyring" Value="/opt/IBM/WebSphere/Plugins/config/WebServer1/plugin-key.kdb"/>  
            <Property Name="stashfile" Value="/opt/IBM/WebSphere/Plugins/config/WebServer1/plugin-key.sth"/> 
            <Property Name="certLabel" Value="default"/> 




Modify the httpd.conf File

SSL Module

  • Search for the following:
LoadModule ibm_ssl_module modules/mod_ibm_ssl.so
Uncomment it out and add the following:
  • The Port you will be listening on (port 443 is the default)
  • The virtual host name ( a * means accept all traffic coming in on port 443)
  • The path to your Key file (created above)
  • The path to the stash file (created above)



EXAMPLE

LoadModule ibm_ssl_module modules/mod_ibm_ssl.so
Listen 0.0.0.0:443
## IPv6 support:

<VirtualHost *:443>
SSLEnable
SSLProtocolDisable SSLv2 SSLv3
 KeyFile C:\IBM\HTTPServer\bin\IHS__key.kdb
 SSLStashFile C:\IBM\HTTPServer\bin\IHS_key.sth
</VirtualHost>

Plugin Location

At the bottom of the httpd.conf file, enter in the path to the plugin file as well as the path to the ap22 module
  • Windows

LoadModule was_ap22_module "C:\IBM\WebSphere\Plugins\bin\32bits\mod_was_ap22_http.dll"
WebSpherePluginConfig "C:\IBM\WebSphere\Plugins\config\WebServer1\plugin-cfg.xml"

  • Linux

LoadModule was_ap22_module "/opt/IBM/WebSphere/Plugins/bin/32bits/mod_was_ap22_http.so"
WebSpherePluginConfig "/opt/IBM/WebSphere/Plugins/config/WebServer1/plugin-cfg.xml"


Restart IHS Server

You have now completed the Proxy configuration for Liberty Profile



*OPTIONAL INFORMATION*


Generate Plugin Options

In the mbean, there are two plugin options:
  • generateDefaultPluginConfig
  • generatePluginConfig

The generateDefaultPluginConfig operation generates the plugin-cfg.xml file
However, if you choose this option, you will have to manually enter this information to each corresponding entry in the Plugin config file.

The generatePluginConfig operation is used to customize installation root directory on the WebServer (IHS Server) and Web Server name before you generate the plugin-cfg.xml file. (There are two parameter files with this option)
Parameters for GeneratePluginConfig:

  • P1 is the "installation root directory
  • P2 is the "Application server name"


Enterprise Deployments and Multiple Liberty Profiles

IHS can only recognize one plugin file. When you have a distributed deployment, you need to merge the plugin files into a single plugin. This can be accomplished either manually or with the Plugin Merge Tool.

  • Plugin Merge Tool

Run the pluginCfgMerge script to merge the plug-in configurations together into a single file, like this:
pluginCfgMerge.bat plugin-cfg1.xml plugin-cfg2.xml plugin-cfg3.xml merged-plugin-cfg.xml

(On linux, the command is pluginCFgMerge.sh)
More information on this tool can be found here: How to create a merged plug-in config for multiple Liberty Profile Servers

Troubleshooting

  • Test IHS (without clm) Go directly to your proxy server (stem of your Public URI)
First try without ssl:
http://My_proxy_server

Then try with ssl:
https://My_proxy_server

If it does not work without ssl, have you started your proxy server?
If it works for non ssl but fails for ssl, then there is a problem with your certificate.

  • Connectivity to CLM
IHS cannot get to your Application server if you cannot get to your application server.
Try to get to your Application server by "bypassing" the IHS server.
In your browser, go to:
https://your_AppServer:<port>/jts/admin
example:
https://my_clm:9443/jts/admin

If you cannot get directly to your Application server, is CLM Running?
If you can go directly to your Application server, but not through your proxy server, check your IHS log for errors. Typically this is a problem with the certificate from the Application server.

Look at the Plugin.log (The path is noted in your Plugin-cfg.xml file>
If you get an error similar to the following:

 
ERROR: lib_security: logSSLError: str_security (gsk error 408): GSK_ERROR_BAD_KEYFILE_PASSWORD
[Tue Apr 5 11:42:03 2010] 00001750 00000bec - ERROR: lib_security: initializeSecurity: Failed to initialize GSK environment
[Tue Apr 5 11:42:03 2010] 00001750 00000bec - ERROR: ws_transport: transportInitializeSecurity: Failed to initialize security
[Tue Apr 5 11:42:03 2010] 00001750 00000bec - ERROR: ws_server: serverAddTransport: Failed to initialize security

The problem is possibly:
  • You have a bad Keystore / Certificate / Stash file
If this is the problem, recreate the Keystore / Certificate / Stash file

  • You have not modified both the httpd.conf and Plugin-cfg.xml file with the correct information
Verify your information is correct

  • You have an old certificate in your browser
Open your browser, delete your old certificate, clear your cache, restart the servers. (Don't just restart the services, actually restart the servers)
When you try connecting you will have to re-import the certificate.

Related topics: Deployment web home, Deployment web home

External links:

Additional contributors: TWikiUser, TWikiUser

Edit | Attach | Printable | Raw View | Backlinks: Web, All Webs | History: r18 < r17 < r16 < r15 < r14 | More topic actions
 
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Contributions are governed by our Terms of Use. Please read the following disclaimer.
Ideas, requests, problems regarding the Deployment wiki? Create a new task in the RTC Deployment wiki project