This page describes the installation of Tomcat and OpenBD on CentOS/RedHat 5.x. The OpenBD application server requires a Java application server to run on. The installation of Java, Tomcat and then OpenBD follow.
Contents |
There are many tutorials on the web how to install Java the best way. In any case, I have installed Java on RedHat systems many times and this has worked all the time 100%.
yum install jpackage-utils
This will start the installation process for the JDK. Actually there is nothing else to do anymore. You should check if Java is installed with:
java -version
If you get something like the below all is well:
java version "1.6.0_11" Java(TM) SE Runtime Environment (build 1.6.0_11-b03) Java HotSpot(TM) Client VM (build 11.0-b16, mixed mode, sharing)
If this fails, you can also try the alternative method to install Java. The CentOS Wiki at http://wiki.centos.org/HowTos/JavaOnCentOS is a great resource for that.
With CentOS/RedHat you could install Tomcat from the YUM repositories, but they only hold the older 5.5.x version. Of course, if you want to have Version 5.5.x installed then you only have to issue a;
yum install tomcat*
But I do recommend that you install Tomcat 6.0.18 (the current version of this writing), since it features better memory handling and some other improvements. The official Tomcat page is your friend in this regard http://tomcat.apache.org/. Luckily, installing Tomcat is straight forward.
tar xzvf apache-tomcat-6.0.18.tar.gz
ln -s /opt/apache-tomcat-6.0.18 tomcat
/opt/tomcat/bin/startup.sh
All should be fine, right? Ok, move on.
Now, that Tomcat and OpenDB runs nicely you might want to have it automatically started when you reboot your system. For that we can use the following script and "chkconfig" command line.
vi /etc/init.d/tomcat
#!/bin/bash
#
# Init file for SixSigns Tomcat server
#
# chkconfig: 2345 55 25
# description: SixSigns Tomcat server
#
# Source function library.
. /etc/init.d/functions
RUN_AS_USER=tomcat # Adjust run user here
CATALINA_HOME=/opt/tomcat
start() {
echo "Starting Razuna Tomcat: "
if [ "x$USER" != "x$RUN_AS_USER" ]; then
su - $RUN_AS_USER -c "$CATALINA_HOME/bin/startup.sh"
else
$CATALINA_HOME/bin/startup.sh
fi
echo "done."
}
stop() {
echo "Shutting down Razuna Tomcat: "
if [ "x$USER" != "x$RUN_AS_USER" ]; then
su - $RUN_AS_USER -c "$CATALINA_HOME/bin/shutdown.sh"
else
$CATALINA_HOME/bin/shutdown.sh
fi
echo "done."
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
stop
sleep 10
#echo "Hard killing any remaining threads.."
#kill -9 `cat $CATALINA_HOME/work/catalina.pid`
start
;;
*)
echo "Usage: $0 {start|stop|restart}"
esac
exit 0
chkconfig --add tomcat
chkconfig --level 345 tomcat on
chkconfig --list
You should see a;
tomcat 0:off 1:off 2:on 3:on 4:on 5:on 6:off
/etc/init.d/tomcat restart