Jun 25, 2009

Installing Sunray II server software on Centos 5.3

I spent many weeks trying to install Sunray server software on Linux.

I was NOT able to make it work with Centos 5.3 x86_64. Maybe this is related somehow to GDM package but it did not work.

It worked when using i386 version of Centos.

See the step by step guide.

1 - Install Centos 5.3 i386
1.1 - If you have more than 3GB of installed RAM, run as root: yum -y install kernel-PAE

2 - Run as root:
yum -y update
reboot

3 - Download:
srss_4.1_linux.zip from http://www.sun.com/software/sunray/getit.jsp
jre-6u13-linux-i586-rpm.bin from http://www.java.com
apache-tomcat-5.5.27.tar.gz from http://tomcat.apache.org/

4 - run as root:
yum install glib dhcp openldap-clients openldap tftp-server libXp openmotif22 openssl compat-libstdc++-33 libusb-devel compat-openldap
yum groupinstall "Development Tools"
yum install kernel-devel

5 - run as root:
cd /usr/lib
ln -sf libldap-2.3.so.0.2.31 libldap.so.199
ln -sf libgdbm.so.2.0.0 libgdbm.so.3
ln -sf liblber-2.3.so.0.2.31 liblber.so.199

6 - install jre that you have downloaded. Run as root:
sh jre-6u13-linux-i586-rpm.bin

7 - install tomcat that you have downloaded. Run as root:
cd /opt
tar xvzf apache-tomcat-5.5.27.tar.gz
ln -sf apache-tomcat-5.5.27 apache-tomcat

8 - Add tomcat as a service. copy and past above code to /etc/init.d/tomcat

#!/bin/sh
#
# Tomcat Server
#
# chkconfig: 345 96 30
# description: Java servlet container

JAVA_HOME=/usr/java/latest/

PATH=${JAVA_HOME}/bin:${PATH}

TOMCAT_START=/opt/apache-tomcat/bin/startup.sh

TOMCAT_STOP=/opt/apache-tomcat/bin/shutdown.sh

export JAVA_HOME PATH

start()
{
if [ -x ${TOMCAT_START} ]; then
echo "Starting tomcat server..."
${TOMCAT_START} &
else
echo "Cannot start tomcat server"
fi
}

stop()
{
if [ -x ${TOMCAT_STOP} ]; then
echo "Stopping tomcat server..."
${TOMCAT_STOP} &
else
echo "Cannot stop tomcat server"
fi
}

restart()
{
stop
sleep 10
start
}

status()
{
echo "No status available for tomcat server"
}

case "$1" in
'start')
start
;;
'stop')
stop
;;
'restart')
restart
;;
'status')
status
;;
*)
echo "Please supply an argument [start|stop|restart]"
esac

9 - To complete tomcat installation, do not forget to:
chmod +x /etc/init.d/tomcat
chkconfig tomcat on
service tomcat start

10 - Unzip the Sunray Server Software that you have downloaded:
unzip srss_4.1_linux.zip
cd srss_4.1
./utinstall
reboot

11 - First Sunray Server Software configuration step:
cd /opt/SUNWut/sbin
./utconfig
reboot

12 - Second Sunray Server Software configuration step:
This is the only dificult step. The utadm uses a logic that I haven't understood about /etc/hosts. The only way to make it works on my scenario is to edit /etc/hosts before running utadm.

The trick is to add an entry to /etc/hosts that contain the real ip address of your server and to comment the 127.0.0.1 entry. See the example above:

Before editing:
vi /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost #Comment this line
::1 localhost6.localdomain6 localhost6

After editing:
# Do not remove the following line, or various programs
# that require network functionality will fail.
#127.0.0.1 localhost.localdomain localhost
::1 localhost6.localdomain6 localhost6
10.0.0.115 localhost localhost.localdomain

Now just run as root:

cd /opt/SUNWut/sbin
./utadm -a eth0

And undo the changes YOU MADE on /etc/hosts. Do not remove the line added by utadm. See how it should look like after you undo your changes:
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost
::1 localhost6.localdomain6 localhost6
#10.0.0.115 localhost localhost.localdomain
192.168.128.1 localhost-eth0.localdomain # SUNRAY ADD - DO NOT MODIFY

Now run as root: reboot

And enjoy it.

3 comments:

Anonymous said...

Very helpful! Thanks

Anonymous said...

Thank you for that nice tutorial!

I've got a question on the last step:
I changed the /etc/hosts file as you described. But all changes I have tried did not work, so either he said that he can not resolve the hostname or he told that the Interface is already used from Where is the first name in the line of the Interfaces-IP-Adress. What I should say is that I have set up CentOS within the installation with another manually set hostname different to localhost.localdomain. Could that be a reason for this issue? If not, have you an idea how to fix that?
Thanks in advance.

Peter Senna Tschudin said...

For 64 bits, please visit: http://blkperl.github.io/tag/centos.html