Wednesday 21 January 2015

WebSphere Application Server - Some basic 101

Some notes from my own environment today, for future reading and re-use.

Note that this merely provides a basic IHS > Plugin > WAS setup, and makes no use of the WAS ND concepts, such as Deployment Manager, Managed Nodes etc.

In addition, the resulting infrastructure is NOT secure, specifically in terms of the default browser > IHS configuration being over HTTP ( port 8080 ) rather than HTTPS ( SSL/TLS ).

See What We Have Available

/opt/IBM/InstallationManager/eclipse/tools/imcl listAvailablePackages -repositories /tmp/Repo/WAS85/Base/Product,/tmp/Repo/WAS85/Base/Fixes,/tmp/Repo/WAS85/Supplements/Product/,/tmp/Repo/WAS85/Supplements/Fixes

com.ibm.websphere.ND.v85_8.5.0.20120501_1108
com.ibm.websphere.BASE.v85_8.5.5004.20141119_1746
com.ibm.websphere.BASETRIAL.v85_8.5.5004.20141119_1746
com.ibm.websphere.DEVELOPERS.v85_8.5.5004.20141119_1746
com.ibm.websphere.DEVELOPERSILAN.v85_8.5.5004.20141119_1746
com.ibm.websphere.EXPRESS.v85_8.5.5004.20141119_1746
com.ibm.websphere.EXPRESSTRIAL.v85_8.5.5004.20141119_1746
com.ibm.websphere.ND.v85_8.5.5004.20141119_1746
com.ibm.websphere.NDDMZ.v85_8.5.5004.20141119_1746
com.ibm.websphere.NDDMZTRIAL.v85_8.5.5004.20141119_1746
com.ibm.websphere.NDTRIAL.v85_8.5.5004.20141119_1746
com.ibm.websphere.APPCLIENT.v85_8.5.0.20120501_1108
com.ibm.websphere.IHS.v85_8.5.0.20120501_1108
com.ibm.websphere.PLG.v85_8.5.0.20120501_1108
com.ibm.websphere.PLUGCLIENT.v85_8.5.0.20120501_1108
com.ibm.websphere.WCT.v85_8.5.0.20120501_1108
com.ibm.websphere.APPCLIENT.v85_8.5.5004.20141119_1746
com.ibm.websphere.APPCLIENTILAN.v85_8.5.5004.20141119_1746
com.ibm.websphere.IHS.v85_8.5.5004.20141119_1746
com.ibm.websphere.IHSILAN.v85_8.5.5004.20141119_1746
com.ibm.websphere.PLG.v85_8.5.5004.20141119_1746
com.ibm.websphere.PLGILAN.v85_8.5.5004.20141119_1746
com.ibm.websphere.PLUGCLIENT.v85_8.5.5004.20141119_1746
com.ibm.websphere.PLUGCLIENTILAN.v85_8.5.5004.20141119_1746

Install WAS ND 8.5.5.4

installWAS8554.rsp

<?xml version="1.0" encoding="UTF-8"?>
<!--The "acceptLicense" attribute has been deprecated. Use "-acceptLicense" command line option to accept license agreements.-->
<agent-input acceptLicense='true'>
<server>
<repository location='/tmp/Repo/WAS85/Base/Product/'/>
<repository location='/tmp/Repo/WAS85/Base/Fixes/'/>
</server>

<profile id='IBM WebSphere Application Server V8.5' installLocation='/opt/IBM/WebSphere/AppServer'>
<data key='eclipseLocation' value='/opt/IBM/WebSphere/AppServer'/>
<data key='user.import.profile' value='false'/>
<data key='cic.selector.os' value='linux'/>
<data key='cic.selector.arch' value='x86'/>
<data key='cic.selector.ws' value='gtk'/>
<data key='cic.selector.nl' value='en'/>
</profile>

<install modify='false'> 
<offering id='com.ibm.websphere.ND.v85' version='8.5.5004.20141119_1746' profile='IBM WebSphere Application Server V8.5' features='core.feature,ejbdeploy,thinclient,embeddablecontainer,com.ibm.sdk.6_64bit' installFixes='none'/>
</install>

<preference name='com.ibm.cic.common.core.preferences.eclipseCache' value='/opt/IBM/IMShared'/>
<preference name='com.ibm.cic.common.core.preferences.connectTimeout' value='30'/>
<preference name='com.ibm.cic.common.core.preferences.readTimeout' value='45'/>
<preference name='com.ibm.cic.common.core.preferences.downloadAutoRetryCount' value='0'/>
<preference name='offering.service.repositories.areUsed' value='true'/>
<preference name='com.ibm.cic.common.core.preferences.ssl.nonsecureMode' value='false'/>
<preference name='com.ibm.cic.common.core.preferences.http.disablePreemptiveAuthentication' value='false'/>
<preference name='http.ntlm.auth.kind' value='NTLM'/>
<preference name='http.ntlm.auth.enableIntegrated.win32' value='true'/>
<preference name='com.ibm.cic.common.core.preferences.preserveDownloadedArtifacts' value='true'/>
<preference name='com.ibm.cic.common.core.preferences.keepFetchedFiles' value='false'/>
<preference name='PassportAdvantageIsEnabled' value='false'/>
<preference name='com.ibm.cic.common.core.preferences.searchForUpdates' value='false'/>
<preference name='com.ibm.cic.agent.ui.displayInternalVersion' value='false'/>
<preference name='com.ibm.cic.common.sharedUI.showErrorLog' value='true'/>
<preference name='com.ibm.cic.common.sharedUI.showWarningLog' value='true'/>
<preference name='com.ibm.cic.common.sharedUI.showNoteLog' value='true'/>
</agent-input>


/opt/IBM/InstallationManager/eclipse/tools/imcl -input installWAS8554.rsp -acceptLicense

Installed com.ibm.websphere.ND.v85_8.5.5004.20141119_1746 to the /opt/IBM/WebSphere/AppServer directory.

Install IHS / Plugin 8.5.5.4

installIHS8554.rsp

<?xml version="1.0" encoding="UTF-8"?> 
<agent-input>
<server> 
<repository location='/tmp/Repo/WAS85/Supplements/Product/'/>
<repository location='/tmp/Repo/WAS85/Supplements/Fixes/'/>
</server>
<profile id='IBM HTTP Server V8.5' installLocation='/opt/IBM/HTTPServer'> 
<data key='eclipseLocation' value='/opt/IBM/HTTPServer'/> 
<data key='user.import.profile' value='false'/> 
<data key='cic.selector.os' value='linux'/> 
<data key='cic.selector.ws' value='gtk'/> 
<data key='cic.selector.arch' value='x86'/> 
<data key='user.ihs.allowNonRootSilentInstall' value='true'/> 
<data key='user.ihs.http.server.service.name' value='none'/> 
<data key='user.ihs.httpPort' value='8080'/> 
<data key='user.ihs.installHttpService' value='false'/> 
<data key='cic.selector.nl' value='en'/> 
</profile> 
<profile id='Web Server Plug-ins for IBM WebSphere Application Server V8.5' installLocation='/opt/IBM/WebSphere/Plugins'> 
<data key='eclipseLocation' value='/opt/IBM/WebSphere/Plugins'/> 
<data key='user.import.profile' value='false'/> 
<data key='cic.selector.os' value='linux'/> 
<data key='cic.selector.ws' value='gtk'/> 
<data key='cic.selector.arch' value='x86'/> 
<data key='cic.selector.nl' value='en'/> 
</profile> 
<install modify='false'> 
<offering id='com.ibm.websphere.IHS.v85' version='8.5.5004.20141119_1746' profile='IBM HTTP Server V8.5' features='core.feature,arch.64bit' installFixes='none'/> 
<offering id='com.ibm.websphere.PLG.v85' version='8.5.5004.20141119_1746' profile='Web Server Plug-ins for IBM WebSphere Application Server V8.5' features='core.feature,com.ibm.jre.6_64bit' installFixes='none'/> 
</install> 
<preference name='com.ibm.cic.common.core.preferences.eclipseCache' value='/opt/IBM/IMShared'/> 
<preference name='com.ibm.cic.common.core.preferences.connectTimeout' value='30'/> 
<preference name='com.ibm.cic.common.core.preferences.readTimeout' value='45'/> 
<preference name='com.ibm.cic.common.core.preferences.downloadAutoRetryCount' value='0'/> 
<preference name='offering.service.repositories.areUsed' value='true'/> 
<preference name='com.ibm.cic.common.core.preferences.ssl.nonsecureMode' value='false'/> 
<preference name='com.ibm.cic.common.core.preferences.http.disablePreemptiveAuthentication' value='false'/> 
<preference name='http.ntlm.auth.kind' value='NTLM'/> 
<preference name='http.ntlm.auth.enableIntegrated.win32' value='true'/> 
<preference name='com.ibm.cic.common.core.preferences.preserveDownloadedArtifacts' value='true'/> 
<preference name='com.ibm.cic.common.core.preferences.keepFetchedFiles' value='false'/> 
<preference name='PassportAdvantageIsEnabled' value='false'/> 
<preference name='com.ibm.cic.common.core.preferences.searchForUpdates' value='false'/> 
<preference name='com.ibm.cic.agent.ui.displayInternalVersion' value='false'/> 
<preference name='com.ibm.cic.common.sharedUI.showErrorLog' value='true'/> 
<preference name='com.ibm.cic.common.sharedUI.showWarningLog' value='true'/> 
<preference name='com.ibm.cic.common.sharedUI.showNoteLog' value='true'/> 
</agent-input>

/opt/IBM/InstallationManager/eclipse/tools/imcl -input installIHS8554.rsp -acceptLicense

Installed com.ibm.websphere.IHS.v85_8.5.5004.20141119_1746 to the /opt/IBM/HTTPServer directory.
Installed com.ibm.websphere.PLG.v85_8.5.5004.20141119_1746 to the /opt/IBM/WebSphere/Plugins directory.

Create WAS Profile

 /opt/IBM/WebSphere/AppServer/bin/manageprofiles.sh -create -hostName ucd61.uk.ibm.com -applyPerfTuningSetting standard -profileName AppSrv01 -adminUserName wasadmin -adminPassword passw0rd -enableAdminSecurity true -nodeName ucd61 -cellName wastest -serverName server1 -profilePath /opt/IBM/WebSphere/AppServer/profiles/AppSrv01 -templatePath /opt/IBM/WebSphere/AppServer/profileTemplates/default

INSTCONFSUCCESS: Success: Profile AppSrv01 now exists. Please consult /opt/IBM/WebSphere/AppServer/profiles/AppSrv01/logs/AboutThisProfile.txt for more information about this profile.

Start Server

/opt/IBM/WebSphere/AppServer/profiles/AppSrv01/bin/startServer.sh server1

ADMU0116I: Tool information is being logged in file
           /opt/IBM/WebSphere/AppServer/profiles/AppSrv01/logs/server1/startServer.log
ADMU0128I: Starting tool with the AppSrv01 profile
ADMU3100I: Reading configuration for server: server1
ADMU3200I: Server launched. Waiting for initialization status.
ADMU3000I: Server server1 open for e-business; process id is 31328

Federate IHS

federateIHS.sh

export profilePath=/opt/IBM/WebSphere/AppServer/profiles
export dmgrProf=AppSrv01
export dmgrHost=`hostname`
export dmgrSoapPort=8880
export wasUser=wasadmin
export wasPass=passw0rd
export wasInstallDir=/opt/IBM/WebSphere/AppServer 
export webServerName=webserver1 
export ihsInstallDir=/opt/IBM/HTTPServer 
export httpsPort=8443
export plgInstallDir=/opt/IBM/WebSphere/Plugins 
export nodeName=ihsNode1
export hostName=`hostname` 

${profilePath}/${dmgrProf}/bin/wsadmin.sh -lang jacl -host $dmgrHost -port $dmgrSoapPort  -user ${wasUser} -password ${wasPass} -f ${wasInstallDir}/bin/configureWebserverDefinition.jacl ${webServerName} IHS ${ihsInstallDir} ${ihsInstallDir}/conf/httpd.conf ${httpsPort} MAP_ALL ${plgInstallDir} unmanaged ${nodeName} ${hostName} linux 8083 ${wasUser} ${wasPass} 


./federateIHS.sh

WASX7209I: Connected to process "server1" on node ucd61 using SOAP connector;  The type of process is: UnManagedProcess
WASX7303I: The following options are passed to the scripting environment and are available as arguments that are stored in the argv variable: "[webserver1, IHS, /opt/IBM/HTTPServer, /opt/IBM/HTTPServer/conf/httpd.conf, 8443, MAP_ALL, /opt/IBM/WebSphere/Plugins, unmanaged, ihsNode1, ucd61.uk.ibm.com, linux, 8083, wasadmin, passw0rd]"
 
Input parameters: 
 
   Web server name             - webserver1 
   Web server type             - IHS 
   Web server install location - /opt/IBM/HTTPServer 
   Web server config location  - /opt/IBM/HTTPServer/conf/httpd.conf 
   Web server port             - 8443 
   Map Applications            - MAP_ALL 
   Plugin install location     - /opt/IBM/WebSphere/Plugins 
   Web server node type        - unmanaged 
   Web server node name        - ihsNode1 
   Web server host name        - ucd61.uk.ibm.com 
   Web server operating system - linux 
   IHS Admin port              - 8083 
   IHS Admin user ID           - wasadmin 
   IHS Admin password          - passw0rd 
   IHS service name            - "" 
  
Found node with matching hostname. Using existing node ucd61 
 
Node definition ucd61 already exists.
 
Creating the web server definition for webserver1 on node ucd61.
Parameters for administering IHS web server can also be updated using wsadmin script or admin console.
Web server definition for webserver1 is created.
 
Start computing the plugin properties ID.
Plugin properties ID is computed.
 
Start updating the plugin install location.
Plugin install location is updated.
 
Start updating the plugin log file location.
Plugin log file location is updated.
 
Start updating the RemoteConfigFilename location.
Plugin remote config file location is updated.
 
Start updating the RemoteKeyRingFileName location.
Plugin remote keyring file location is updated.
 
Start saving the configuration.
 
Configuration save is complete.
 
Computed the list of installed applications.
 
Processing the application DefaultApplication.
Get the current target mapping for the application DefaultApplication.
Computed the current target mapping for the application DefaultApplication.
Start updating the target mappings for the application DefaultApplication.
ADMA5075I: Editing of application DefaultApplication started.
ADMA5058I: Application and module versions are validated with versions of deployment targets.
ADMA5005I: The application DefaultApplication is configured in the WebSphere Application Server repository.
ADMA5005I: The application DefaultApplication is configured in the WebSphere Application Server repository.
ADMA5005I: The application DefaultApplication is configured in the WebSphere Application Server repository.
ADMA5005I: The application DefaultApplication is configured in the WebSphere Application Server repository.
ADMA5113I: Activation plan created successfully.
ADMA5011I: The cleanup of the temp directory for application DefaultApplication is complete.
ADMA5076I: Application DefaultApplication edited successfully. The application or its web modules may require a restart when a save is performed.
Target mapping is updated for the application DefaultApplication.
 
Processing the application ivtApp.
Get the current target mapping for the application ivtApp.
Computed the current target mapping for the application ivtApp.
Start updating the target mappings for the application ivtApp.
ADMA5075I: Editing of application ivtApp started.
ADMA5058I: Application and module versions are validated with versions of deployment targets.
ADMA5005I: The application ivtApp is configured in the WebSphere Application Server repository.
ADMA5005I: The application ivtApp is configured in the WebSphere Application Server repository.
ADMA5005I: The application ivtApp is configured in the WebSphere Application Server repository.
ADMA5005I: The application ivtApp is configured in the WebSphere Application Server repository.
ADMA5113I: Activation plan created successfully.
ADMA5011I: The cleanup of the temp directory for application ivtApp is complete.
ADMA5076I: Application ivtApp edited successfully. The application or its web modules may require a restart when a save is performed.
Target mapping is updated for the application ivtApp.
 
Processing the application query.
Get the current target mapping for the application query.
Computed the current target mapping for the application query.
Start updating the target mappings for the application query.
ADMA5075I: Editing of application query started.
ADMA5058I: Application and module versions are validated with versions of deployment targets.
ADMA5005I: The application query is configured in the WebSphere Application Server repository.
ADMA5005I: The application query is configured in the WebSphere Application Server repository.
ADMA5005I: The application query is configured in the WebSphere Application Server repository.
ADMA5005I: The application query is configured in the WebSphere Application Server repository.
ADMA5113I: Activation plan created successfully.
ADMA5011I: The cleanup of the temp directory for application query is complete.
ADMA5076I: Application query edited successfully. The application or its web modules may require a restart when a save is performed.
Target mapping is updated for the application query.
 
Start saving the configuration.
 
Configuration save is complete.

Add WAS Plugin to IHS

echo "LoadModule was_ap22_module "/opt/IBM/WebSphere/Plugins/bin/64bits/mod_was_ap22_http.so"" >> /opt/IBM/HTTPServer/conf/httpd.conf
echo "WebSpherePluginConfig /opt/IBM/WebSphere/Plugins/config/webserver1/plugin-cfg.xml" >> /opt/IBM/HTTPServer/conf/httpd.conf


Generate WAS Plugin

/opt/IBM/WebSphere/AppServer/profiles/AppSrv01/bin/wsadmin.sh -lang jython -user wasadmin -password passw0rd

AdminControl.invoke('WebSphere:name=PluginCfgGenerator,process=server1,platform=common,node=ucd61,version=8.5.5.4,type=PluginCfgGenerator,mbeanIdentifier=PluginCfgGenerator,cell=wastest,spec=1.0', 'generate', '[/opt/IBM/WebSphere/AppServer/profiles/AppSrv01/config wastest ucd61 webserver1 false]', '[java.lang.String java.lang.String java.lang.String java.lang.String java.lang.Boolean]')

AdminControl.invoke('WebSphere:name=PluginCfgGenerator,process=server1,platform=common,node=ucd61,version=8.5.5.4,type=PluginCfgGenerator,mbeanIdentifier=PluginCfgGenerator,cell=wastest,spec=1.0', 'propagate', '[/opt/IBM/WebSphere/AppServer/profiles/AppSrv01/config wastest ucd61 webserver1]', '[java.lang.String java.lang.String java.lang.String java.lang.String]')

AdminConfig.save()
quit

Add WAS Virtual Host for IHS

/opt/IBM/WebSphere/AppServer/profiles/AppSrv01/bin/wsadmin.sh -lang jython -user wasadmin -password passw0rd

cellID=AdminControl.getCell() 
AdminConfig.create('HostAlias', AdminConfig.getid('/Cell:'+cellID+'/VirtualHost:default_host/'), '[[hostname "*"] [port "8080"]]') 
AdminConfig.save() 
quit 


Restart WAS

 /opt/IBM/WebSphere/AppServer/profiles/AppSrv01/bin/stopServer.sh server1 -user wasadmin -password passw0rd

ADMU0116I: Tool information is being logged in file
           /opt/IBM/WebSphere/AppServer/profiles/AppSrv01/logs/server1/stopServer.log
ADMU0128I: Starting tool with the AppSrv01 profile
ADMU3100I: Reading configuration for server: server1
ADMU3201I: Server stop request issued. Waiting for stop status.
ADMU4000I: Server server1 stop completed.

/opt/IBM/WebSphere/AppServer/profiles/AppSrv01/bin/startServer.sh server1

ADMU0116I: Tool information is being logged in file
           /opt/IBM/WebSphere/AppServer/profiles/AppSrv01/logs/server1/startServer.log
ADMU0128I: Starting tool with the AppSrv01 profile
ADMU3100I: Reading configuration for server: server1
ADMU3200I: Server launched. Waiting for initialization status.
ADMU3000I: Server server1 open for e-business; process id is 31328

Restart IHS

/opt/IBM/HTTPServer/bin/apachectl -f /opt/IBM/HTTPServer/conf/httpd.conf -k stop
/opt/IBM/HTTPServer/bin/apachectl -f /opt/IBM/HTTPServer/conf/httpd.conf -k start

Test IHS


Test IHS > Plugin > WAS






Job done :-)

No comments:

Visual Studio Code - Wow 🙀

Why did I not know that I can merely hit [cmd] [p]  to bring up a search box allowing me to search my project e.g. a repo cloned from GitHub...