Tuesday, 27 December 2011

Installing IBM HTTP Server 7 on CentOS Linux 6.2

Working with a friend to get IHS v7 working on CentOS 6.2, he ( and eventually I ) were hitting the following exception: -

(Dec 27, 2011 8:09:47 PM), Process, com.ibm.ws.install.ihs.ismp.actions.ExecWizardActionFromDirectory, err, java.io.IOException: Cannot run program "/opt/IBM/HTTPServer/bin/htpasswd" (in directory "/opt/IBM/HTTPServer"): java.io.IOException: error=2, No such file or directory
STACK_TRACE: 15
java.io.IOException: Cannot run program "/opt/IBM/HTTPServer/bin/htpasswd" (in directory "/opt/IBM/HTTPServer"): java.io.IOException: error=2, No such file or directory
        at java.lang.ProcessBuilder.start(ProcessBuilder.java:470)
        at java.lang.Runtime.exec(Runtime.java:604)
        at com.ibm.ws.install.ihs.ismp.actions.ExecWizardActionFromDirectory.executeProcess(ExecWizardActionFromDirectory.java:202)

        at com.installshield.wizard.StandardWizardListener.currentBeanChanged(StandardWizardListener.java:106)
        at com.installshield.wizard.Wizard$RunThread.run(Wizard.java:1569)
Caused by: java.io.IOException: java.io.IOException: error=2, No such file or directory
        at java.lang.Throwable.<init>(Throwable.java:67)
        at java.lang.UNIXProcess.<init>(UNIXProcess.java:197)
        at java.lang.ProcessImpl.start(ProcessImpl.java:101)
        at java.lang.ProcessBuilder.start(ProcessBuilder.java:463)
        ... 6 more

In order to prove and, hopefully, resolve the issue, I downloaded CentOS ( CentOS-6.2-x86_64-LiveCD ) as a 700 MB ISO image. From this, I was able to quickly create a new virtual machine using VMware Fusion, and go through the IHS installation.

Given that I'm using a 64-bit version of CentOS, I also needed to install the corresponding package of IHS - for the record, IHS v7 is a 32-bit binary BUT is delivered in two packages; one 32-bit and one 64-bit.

( If you're looking for more detail, check out my other blog posts here and here )

I downloaded the x86-64 version of the product via this image: -

IBM WebSphere Application Server V7.0 Supplements (1 of 2) for Linux on x86-64 bit (IBM HTTP Server, Web Server Plug-ins and Update Installer) Multilingual (C1G00ML) - 246 MB

as detailed here: -


and unpacked the corresponding TAR file - C1G00ML.tar.gz.

$ cd /tmp
$ mkdir IHS
$ cd IHS
$ tar xvzf C1G00ML.tar.gz  

and ran the installation routine: -

$ ./IHS/install

This ran through, with me taking all the defaults, and completed BUT displayed the following message: -


When I looked at the log.txt file, I saw the exception referred to previously: -

<snip>
java.io.IOException: Cannot run program "/opt/IBM/HTTPServer/bin/htpasswd" (in directory "/opt/IBM/HTTPServer"): java.io.IOException: error=2, No such file or directory
</snip>

When I attempted to manually run the htpasswd program: -

$ /opt/IBM/HTTPServer/htpasswd

it failed with: -

bash: /opt/IBM/HTTPServer/bin/htpasswd: /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory

A quick Google search threw up this hit which suggested that I was missing the ld-linux.so.2 library ( which actually ties up with the above error !! ) and, more importantly, showed me the way to go home …..

Simply put, I needed to install the library as follows: -

$ yum install ld-linux.so.2

which downloaded 4.4 MB of code: -

================================================================================
 Package                   Arch        Version                Repository   Size
================================================================================
Installing:
 glibc                     i686        2.12-1.47.el6          base        4.3 M
Installing for dependencies:
 nss-softokn-freebl        i686        3.12.9-11.el6          base        116 k

Transaction Summary
================================================================================
Install       2 Package(s)


Having done that, htpasswd now runs perfectly: -

$ /opt/IBM/HTTPServer/bin/htpasswd

Usage:
htpasswd [-cmdpsD] passwordfile username
htpasswd -b[cmdpsD] passwordfile username password

htpasswd -n[mdps] username
htpasswd -nb[mdps] username password
 -c  Create a new file.
 -n  Don't update file; display results on stdout.
 -m  Force MD5 encryption of the password.
 -d  Force CRYPT encryption of the password (default).
 -p  Do not encrypt the password (plaintext).
 -s  Force SHA encryption of the password.
 -b  Use the password from the command line rather than prompting for it.
 -D  Delete the specified user.
On Windows, NetWare and TPF systems the '-m' flag is used by default.
On all other systems, the '-p' flag will probably not work.


I removed and reinstalled IHS; I still see the "Partial Success" message, but no longer see any nasty exceptions relating to htpasswd and I'm able to start/stop/use IHS without problems.

:-)

1 comment:

Dave Hay said...

*UPDATE*

I also saw this: -

libgcc_s.so.1 must be installed for pthread_cancel to work
JVMDUMP006I Processing dump event "abort", detail "" - please wait.
JVMDUMP007I JVM Requesting System dump using '/opt/IBM/WebSphere/UpdateInstaller/maintenance/core.20111227.211128.9569.0001.dmp'
libgcc_s.so.1 must be installed for pthread_cancel to work
/opt/IBM/HTTPServer/bin/versionInfo.sh: line 11: 9569 Aborted "$JAVA_HOME/jre/bin/java" -Dwas.install.root="$WAS_HOME" -classpath "$WAS_CLASSPATH" com.ibm.websphere.product.VersionInfo "$@"
[root@localhost maintenance]#

when I ran commands such as: -

$ /opt/IBM/HTTPServer/bin/versionInfo.sh

I fixed this (simply) by installing libgcc_s.so.1 as follows: -

$ yum install libgcc_s.so.1

Job done :-)