[important]You can use the tutorial as a guide for IHS 7 as well.[/important]
IHS 6 is free to download from IBM and at the time of writing the URL immediately below can be used to locate the IHS downloads.
http://www-01.ibm.com/software/webservers/httpservers/
You will need to register if you do not already have an IBM website ID. This is a requirement to download IHS.
Select the appropriate installation Platform that you require. In this case we require Linux.
At the time of the writing of this mini article, the IBM HTTP Server (IHS) is currently at version 7.0.0.0. We will not need to upgrade IHS for this exercise; you can search http://www.webspheretools.com
for my article on how to upgrade IHS.
Download IHS and un-tar into the root of the WebSphere binaries you used to install WebSphere ND.
Note: You may find that depending on how you got WebSphere ND binaries that you may already have a version of IHS, it is ok for you to use that version.#
We are going to install IHS using the Graphical Installation Wizard.
Once you have downloaded ihs tar file upload it to your Linux server and un-tar the folders as mentioned above.
Installing IHS
My binaries are located: /var/apps/IHS6_Install/IHS_6.1.0.0
./install
Note: If ./install does not work, this is because you are using Centos and By default, CentOS 5 has the SE Linux feature set to “enforcing”, this may not be the what you want, you can disable SE Linux temporarily by using the following command.
usr/sbin/setenforce 0
Tip: You can edit the IHS installation script to not redirect the Java Console (DONT_REDIRECT=true) and thus you will be able to see errors in the installation process for example
Error loading: /var/apps/IHS6_Install/IHS_6.1.0.0/JDK/jre.pak/repository/package.java.jre/java/jre/bin/libj9thr23.so: cannot restore segment prot after reloc: Permission denied
The error shown above is an example or SE Linux enforcing which is stopping the installation process.
Click Next and Accept license, the Next again until you come to the screen where you can chose the installation location.
/var/apps/ihs6
I have chosen to leave the default ports.
I use wasadmin/wasadmin for the IHS administration password. We will need to remember these settings if we choose to later administer IHS from the Administration Console.
On the Setup HTTP Server Administration Server screen we do not wish to configure a IBM HTTP Administration server.
Click Next until you get a summary screen, if you are happy with the configuration, click next again and the wizard will start to install IHS.
One the install is finished we will start and stop IHS to ensure that it is running properly.
My installation of IHS is located at: /var/apps/ihs6/bin
Type the following command to start IHS
./apachectl start
Uou should now be able to navigate to port 80 and see the IBM HTTP Server welcome screen by typing in the following URL: http://<hostname>/
For example: http://192.168.0.1/
If you see the welcome screen as shown below, then we know IHS is installed ok.
We can now stop IHS, by issuing the command:
./apachectl stop
Note: If you want to be thorough you can view the logs in the <ihs_root>/logs folder to see if there are any errors.
We are now ready to install the Websphere Plugin, so we can have our traffic hitting port 80 and IHs along with the Plugin, will workload manage our requests across our servers.
Downloading the Websphere Plugin
http://www.ibm.com/developerworks/downloads/ws/was
There is a link on this landing page to the Websphere Plugin downloads page.
I have chosen to use the 6.1 Plug-in:
http://www14.software.ibm.com/webapp/download/preconfig.jsp?id=2007-04-04+07:24:09.250653R&S_TACT=105AGX10&S_CMP=LP
The download is called: trial_plugins_linux.ia32.tar.gz
Type the following commands
gunzip trial_plugins_linux.ia32.tar.gz tar -xvf trial_plugins_linux.ia32.tar
We can now navigate into the plugins folder and run the graphical installer.
I extracted by installation to: /var/apps/Plugin_Install/plugin
./install
Tip: As with the IBM HTTP Server install script you can edit the plugin install script to not redirect the console as it is installing so you can see potential installation errors as they are happening.
Tip: I recommend downloading and applying the latest fix pack for IHS.
http://www-01.ibm.com/support/docview.wss?rs=180&uid=swg24023190
You will require the latest fix pack installer
http://www-01.ibm.com/support/docview.wss?rs=180&uid=swg24020446
You can search http://www.webspheretools.com
for tips on how to install and run a the new update installer and how to upgrade IHS.
Click Next, until you come to the Web Server Configuration page as shown below
Select IBM HTTP Server v6 or V6.1
Our installation of IHS is on the same machine as WebSphere, so we can select WebSphere Application Server machine (local)
On the next screen we can type the location of where the Plugin will be installed. It is a common practice to install the Plugin into <ihs_root>/Plugins for example: /var/apps/ihs6/Plugins . Click Next to continue.
In the next screen we type in or browse for the location of WebSphere
This is so the Plugin wizard can detect where the WebSphere plugin-cfg.xml is located. I have chosen /var/apps/wasnd7 which is where my Websphere root is. Click Next.
On the next screen we are asked which profile we wish to configure with the Plugin, we will use the Deployment Manager.
On the next screen we point the Plugin wizard to the location of the IHS conf directory so it can modify the httpd.conf file.
In my example I have used <ihs_root>/conf/httpd.conf for example /var/apps/ihs6/conf/httpd.conf
On the Next screen we get to choose the location of the plugin-cfg.xml file. Now since after this install we are going to set up a WebServer in the admin console so we can set this later, for now just leave it as it is so we can tell what part of the httpd.conf is being altered.
/var/apps/ihs6/Plugins/config/webserver1/plugin-cfg.xml
Click Next until the Wizard starts the Plugin installation.
When the installation process has completed, we need to look at the httpd.conf file and see what changes the installation has made.
As you can see by this snippet below which was taken from my httpd config file, that the Plugins module has been added and also the location of the plugin-cfg.xml file.
LoadModule was_ap20_module /var/apps/ihs6/Plugins/bin/mod_was_ap20_http.so </span><span style="font-family: Times New Roman; font-size: 12pt;"> </span><span style="font-family: Arial; font-size: 13pt;">WebSpherePluginConfig /var/apps/ihs6/Plugins/config/webserver1/plugin-cfg.xml
Configuring a Web Server Definition
We are now going to re-log into the WebSphere admin console and add a new Web server definition.
Log into the Administrative Console and navigate to the Server Types category of the Servers section in the Right-Hand side panel and click Web Servers as shown below.
Click New as shown below to create a new web server definition.
On the next page type “webserver1″ into the Server name field and then click Next.
Click “Next” again to skip the IHS template page. On the next page you will be required to fill in some information about the location of IHS and the Plugin. As you can see below, I have filed in the appropriate locations. Make sure that you set ours accordingly to our installations earlier in the article.
Click “Next” until the wizard is complete, and then ensure that the new web server definition is saved and persisted.
Once saved, you will be taken to a list of web servers as shown below.
Click on the websever1 link so we can inspect the actual configuration.
Click on Plugin properties to review the settings. As you can see in the image below, the web server knows where the Plugin needs to be propagated. This needs to match with what is in IHS as seen above when we evaluated the httpd.conf. Please ensure that the path/location is correct. Each time we make a change to our Cluster/app Servers, we need to propagate the WebSphere plugin-cfg.xml file over to IHS and restart IHS.
We now need to evaluate the virtual host configuration of the WebSphere Web Container. To change virtual host configuration, click on the virtual hosts link of the Environment section located with the Right-Hand-Side panel of the admin console as shown below.
You will then be presented with a list of named WebSphere virtual hosts.
Click default host
Click Host_Aliases to review the ports listed. We need to ensure that each port of each application server (clone) in our cluster is listed and also the port in which IBM HTTP Server is listening on. This information together with application context roots, defines what will be generated in the plugin-cfg.xml file. This will be generated by WebSphere and then propagated over to IHS, when required.
Mapping ModulesTo Web Servers
Before we can test our Default Application (snoop servlet) we need to ensure that the application’s web module (WAR) is bound to the new web server definition.
To change the deployed Default application EAR file we need to navigate to the Application Types category of the Applications section of the Right-Hand-Side panel in the admin console as shown below.
Click on the DefaultApplication.ear file as shown bellow.
In the Enterprise Application configuration screen click Manage Modules link located in the Modules section as shown below.
Select webserver1 and apply it to the web module of the application as shown below. This will create a URI for the Plugin to map requests from IHS to the Web Application running in Websphere.
Click OK and save changes to complete.
We are now going to tell WebSphere to re-generate the Plugin and propagate to IHS. One gain navigate to the Web Server’s list screen and then click Generate Plug-in, and then Click Propagate Plugin.
Note: Propagate in our example means the DMgr’s version of the Plugin-Cfg.xml is copied to the appropriate location where IHS is looking for the Plugin.
/var/apps/wasnd7/profiles/Dmgr01/config/cells/localhostCell01/nodes/localhostNode01/servers/webserver1/plugin-cfg.xml
Is copied to:
/var/apps/ihs6/Plugins/config/webserver1/plugin-cfg.xml
on the Web server computer
We can now go and look at the updated Plugin-Cfg.xml file in IHS.
Type the command:
view /var/apps/ihs6/P</span><span style="font-family: Arial; font-size: 13pt;">lugins/config/webserver1/plugin-cfg.xml
Below is a snippet of the plugin-cfg.xml file
</span> <span style="font-family: Times New Roman; font-size: 12pt;"><Config ASDisableNagle="false" AcceptAllContent="false" AppServerPortPreference="WebserverPort" ChunkedResponse="false" FIPSEnable="false" IISDisableNagle="false" IISPluginPriority="High" IgnoreDNSFailures="false" RefreshInterval="60" ResponseChunkSize="64" VHostMatchingCompat="false"> <Log LogLevel="Error" Name="/var/apps/ihs6/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="/var/apps/ihs6/Plugins/"/> <VirtualHostGroup Name="default_host"> <VirtualHost Name="*:9080"/> <VirtualHost Name="*:80"/> <VirtualHost Name="*:9443"/> <VirtualHost Name="*:5060"/> <VirtualHost Name="*:5061"/> <VirtualHost Name="*:443"/> <VirtualHost Name="*:9061"/> <VirtualHost Name="*:9044"/> <VirtualHost Name="*:9062"/> <VirtualHost Name="*:9081"/> <VirtualHost Name="*:9444"/> <VirtualHost Name="*:9045"/> </VirtualHostGroup> <ServerCluster CloneSeparatorChange="false" GetDWLMTable="false" IgnoreAffinityRequests="true" LoadBalance="Round Robin" Name="cluster01" PostBufferSize="64" PostSizeLimit="-1" RemoveSpecialHeaders="true" RetryInterval="60"> <Server CloneID="14f9snmv4" ConnectTimeout="5" ExtendedHandshake="false" LoadBalanceWeight="2" MaxConnections="-1" Name="localhostNode01_server01" ServerIOTimeout="60" WaitForContinue="false"> <Transport Hostname="localhost" Port="9080" Protocol="http"/> <Transport Hostname="localhost" Port="9443" Protocol="https"> <Property Name="keyring" Value="/var/apps/ihs6/Plugins/config/webserver1/plugin-key.kdb"/> <Property Name="stashfile" Value="/var/apps/ihs6/Plugins/config/webserver1/plugin-key.sth"/> </Transport> </Server> <Server CloneID="14f9snv2s" ConnectTimeout="5" ExtendedHandshake="false" LoadBalanceWeight="2" MaxConnections="-1" Name="localhostNode01_server02" ServerIOTimeout="60" WaitForContinue="false"> <Transport Hostname="localhost" Port="9081" Protocol="http"/> <Transport Hostname="localhost" Port="9444" Protocol="https"> <Property Name="keyring" Value="/var/apps/ihs6/Plugins/config/webserver1/plugin-key.kdb"/> <Property Name="stashfile" Value="/var/apps/ihs6/Plugins/config/webserver1/plugin-key.sth"/> </Transport> </Server> <PrimaryServers> <Server Name="localhostNode01_server01"/> <Server Name="localhostNode01_server02"/> </PrimaryServers> </ServerCluster> <UriGroup Name=" default_host_cluster01_URIs "> <Uri AffinityCookie="JSESSIONID" AffinityURLIdentifier="jsessionid" Name="/snoop/* "/> <Uri AffinityCookie="JSESSIONID" AffinityURLIdentifier="jsessionid" Name="/hello"/> <Uri AffinityCookie="JSESSIONID" AffinityURLIdentifier="jsessionid" Name="/hitcount"/> <Uri AffinityCookie="JSESSIONID" AffinityURLIdentifier="jsessionid" Name="*.jsp"/> <Uri AffinityCookie="JSESSIONID" AffinityURLIdentifier="jsessionid" Name="*.jsv"/> <Uri AffinityCookie="JSESSIONID" AffinityURLIdentifier="jsessionid" Name="*.jsw"/> <Uri AffinityCookie="JSESSIONID" AffinityURLIdentifier="jsessionid" Name="/j_security_check"/> <Uri AffinityCookie="JSESSIONID" AffinityURLIdentifier="jsessionid" Name="/ibm_security_logout"/> <Uri AffinityCookie="JSESSIONID" AffinityURLIdentifier="jsessionid" Name="/servlet/*"/> </UriGroup> <Route ServerCluster="cluster01" UriGroup=" default_host_cluster01_URIs " VirtualHostGroup=" default_host "/>
You see by reviewing the setting in red/bod that the Plugin uses the XML to determine routing paths for http traffic. Because our cluster has two application servers, workload management will occur via the Plugin and Websphere and so each HTTP request on port 80 from IHS will route in a round robin fashion to each of clones i.e. 9080, then 9081, then 9080, then 9081 etc.
We can now restart IHS and test the snoop servlet can be accessed via port 80.
When we navigate to snoop using the URL we used previously in the article we can scroll down to see which application server is loading the servlet. The snippet below shows the initial server being server01.
If you refresh the browser the snoop servlet will be reloaded and the Plugin will “workload manage” between the clones of our cluster. Since we have two clones in our cluster the next server will be server02. The screen capture below shows an example of server02 being hit.